I have this snippet of Ansible:
- name: check for reboot request
stat:
path: /var/run/reboot-required
register: reboot_request
- name: reboot if requested
reboot:
reboot_timeout: 180
test_command: whoami
when: reboot_request.stat.exists
...which generates this warning:
[WARNING]: The value True (type bool) in a string field was converted to
u'True' (type string). If this does not look like what you expect, quote the
entire value to ensure it does not change.
I find the error message not super-helpful. What would be the proper syntax?
I am running Ansible 2.9.7 on MacOS 10.15.4 and the target machine is Ubuntu 18.04.3 built with Vagrant 2.2.7, if any of that matters! :)
EDIT: Here is my whole playbook
---
- hosts: all
become: yes
tasks:
- name: Ubuntu Update and Upgrade
apt:
upgrade: yes
update_cache: yes
cache_valid_time: 3600
- name: check for reboot request
stat:
path: /var/run/reboot-required
register: reboot_request
- name: reboot if requested
reboot:
reboot_timeout: 180
test_command: whoami
when: reboot_request.stat.exists