shell

Hi,

Please help me with this error which I am getting below :

play-book:

Hi,

Please help me with this error which I am getting below :

play-book:

---
- name: Directory creation with current date
  hosts: local
  user: manish
  sudo: yes

  tasks:

  - name: Ansible fact - ansible_date_time
     shell: date.sh
     args:
       chdir: /home/manish/mk/ansible/linux/

Error:

ERROR! Syntax Error while loading YAML.
  mapping values are not allowed in this context

Your indentation is incorrect. The last three lines need 2 spaces less
indentation each.

Sebastian

Hi,

Please help me with this error which I am getting below :

play-book:

---
- name: Directory creation with current date
hosts: local
user: manish
sudo: yes

tasks:

- name: Ansible fact - ansible_date_time
shell: date.sh
args:
chdir: /home/manish/mk/ansible/linux/

Error:

ERROR! Syntax Error while loading YAML.
mapping values are not allowed in this context

The error appears to be in '/home/manish/mk/ansible/linux/main.yml': line 10, column 11, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: Ansible fact - ansible_date_time
shell: date.sh
^ here

Fix your indentation, it should look like that:

- name: Ansible fact - ansible_date_time
  shell: date.sh
  args:
    chdir: /home/manish/mk/ansible/linux/

It really doesn't hurt to thoroughly read the error message and look at the documentation basics.

Regards
         Racke