stuvusit / ansible_systemd_timesyncd Goto Github PK
View Code? Open in Web Editor NEWAnsible role to set timezone and configure systemd-timesyncd
License: Other
Ansible role to set timezone and configure systemd-timesyncd
License: Other
Ansible beginner here, so maybe I'm doing something stupid. But running the example playbook gets me this:
$ ansible-playbook workstations-ntp-conf.yml
ERROR! We were unable to read either as JSON nor YAML, these are the errors we got from each:
JSON: Expecting value: line 1 column 1 (char 0)
Syntax Error while loading YAML.
mapping values are not allowed in this context
The error appears to be in '/home/jakob.donotbackup/code/mfg-ansible/workstations-ntp-conf.yml': line 4, column 22, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- systemd-timesyncd
timesync_timezone: Europe/Berlin
^ here
yamllint.com does not like it either:
Hi, instead of coding the logic to configure timezone, it's better to use the default module of Ansible : https://docs.ansible.com/ansible/latest/modules/timezone_module.html
Some systems (e.g. RHEL and its derivatives such as CentOS) have a separate package systemd-timesyncd
which needs to be installed before attempting to enable and start the service.
Hi,
My servers have no access with Internet.
I would need a tarball accessible from Github.
Can you please make a release by tagging your master branch?
Thank you very much.
Changes made in dac573c depend on Aptitude being installed on the target server, which is generally not true - it fails on current Ubuntu LTS ( and IIRC Debian Stable doesn't install Aptitude either). The code is somewhat suspicious too: systemd-timesyncd might not be installable, but we start the unit anyway?
I created a PR to fix the issue: #17
EDIT. better explain what was tested
Hi,
I just ran this role against a pizero which doesn't have a RTC. In that case, the "Write adjtime" handler fails:
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
To fix, one could either:
I could create a PR for one of those options.
Hello :)
could you please add tags on your code ?
thanks a lot ! it working great !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.