I decided to reorganize some playbooks and try a new module timezone.
The task I'm trying is a verbatim copy of the example given on the man page:
- name: set timezone to Asia/Tokyo
timezone:
name: Asia/Tokyo
It does not work on every system I tried. Results for stray cars:
In Debian 8 ( debian/jessie64):
TASK [set time zone to Asia / Tokyo] *************************************** ** ******
fatal: [debian]: FAILED! => {"changed": false, "cmd": "/ usr / bin / timedatectl set-timezone Asia / Tokyo", "failed": true, "msg": "Failed to set the time zone: Name org.freedesktop. PolicyKit1 was not provided by any files .service "," rc ": 1," stderr ":" Failed to set time zone: name org.freedesktop.PolicyKit1 was not provided by any files. \ N "," stdout ":" ", "stdout_lines": []}
On CentOS 7 ( centos/7) - different from Debian:
[ /] ************************************** ********
: [centos]: FAILED! = > { "changed" : false, "cmd" : "/usr/bin/timedatectl set-timezone Asia/Tokyo" , "failed" : true, "msg" : " : "., "rc": 1, "stderr": " : . \n", "stdout": "," stdout_lines": []}
Ubuntu 16.04 (ubuntu/xenial64) - , CentOS, Debian:
[ /] ************************************** ********
: [ubuntu]: FAILED! = > { "changed" : false, "cmd" : "/usr/bin/timedatectl set-timezone Asia/Tokyo" , "failed" : true, "msg" : " : "., "rc": 1, "stderr": " : . \n", "stdout": "," stdout_lines": []}
- ? - ?