stuvusIT / ansible_systemd_timesyncd

Ansible role to set timezone and configure systemd-timesyncd
Other
18 stars 23 forks source link

Example Playbook: mapping values are not allowed in this context at line 4 column 22 #13

Open rfjakob opened 3 years ago

rfjakob commented 3 years ago

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:

Screenshot from 2021-01-30 17-26-01

vrusinov commented 2 years ago

FTR, here's what seems to work for me:

- hosts: all
  become: yes
  roles:
    - stuvusit.systemd-timesyncd
  vars:
    timesync_timezone: Europe/Dublin
NoToComments commented 2 years ago

Yes that is the current format.