strange behairvoir ansible inventory file

Posted on

[ansible@manage01 ~]$ ansible --list-hosts all
hosts (6):
manage02
manage03
tstansble001
[ansible@manage01 ~]$ mv development ./group_vars/
[ansible@manage01 ~]$ ansible --list-hosts all
hosts (6):
manage02
manage03
tstansble001
[ansible@manage01 ~]$ ansible --list-hosts development
hosts (3):
manage02
manage03
[ansible@manage01 ~]$ ansible-playbook james.yml

PLAY [test playbook for role james] ********************************************************************************************************
ERROR! Syntax Error while loading YAML.
did not find expected

The error appears to be in '/opt/usr/ansible/group_vars/development': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

[development]
manage02
^ here
[ansible@manage01 ~]$ cat ./group_vars/development
[development]
manage02
manage03

[ansible@manage01 ~]$ cat james.yml

  • name: test playbook for role james
    hosts: all
    vars_files:

    • "/opt/usr/ansible/host_vars/{{ inventory_hostname }}_vars.yml"
      roles:
    • james
      [ansible@manage01 ~]$