Hi,
I am trying to use the os_server_facts module, but I get a syntax error:
The inventory file "oshost" contains only the following line:
localhost ansible_connection=local
The playbook "os_server_facts.yml" is a simple as the example given in the documentation:
- os_server_facts:
server: W1
- debug:
var: openstack_servers
And this is what I get:
admin:~/temp> ansible-playbook -i oshost os_server_facts.yml
ERROR! Syntax Error while loading YAML.
The error appears to have been in '/home/admin/temp/os_server_facts.yml': line 2, column 1, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- os_server_facts:
server: W1
^ here
By the way, the OpemStack environment variables are loaded from the RC file. Other cloud modules, like os_server, are working properly:
admin:~/temp> cat os_server_test.yml
# Test
- name: Launch an instance
gather_facts: no
tasks:
- name: Launch a "Ubuntu 14 LTS" instance
os_server:
state: present
name: Test01
image: a79d8041-b92b-49cc-82c1-fa354469bde0
flavor: 4488da6d-6173-4112-8870-9f76d138ad00
key_name: 'oskey'
nics:
- net-id: 00d39765-718d-43c3-8256-6c73d4bb3752
admin:~/temp>
Any idea, why the os_server_facts returns a syntax error?
Regards
Stavros