I am trying to get a good inventory from both a spacewalk and an older satellite server. I was able to share the spacewalk.py script with those server and produce an output, which is all one 1 line, and looks something like this: {“CentOS6_Servers”: [“server1”, “server2”, “server3”, “server4”, “server5”, … etc for 600+ servers and many many groops. When I try this:
ansible CentOS6_Servers -a “hostname” -i /etc/ansible/inventory/spacewalk_list_07-11-2014.txt
I get this → ERROR: Invalid ini entry: [ncias-p584.nci.nih.gov, - need more than 1 value to unpack
Is this due to the file being all one line? Is this improper YAML syntax, maybe? Sorry, I am a new to YAML Syntax, and Ansible.
Am I using spacewalk.py incorrectly?
Thanks for assistance you can give me.
David Jacobs <psychodj@gmail.com> napisał:
I am trying to get a good inventory from both a spacewalk and an older
satellite server. I was able to share the spacewalk.py script with
those
server and produce an output, which is all one 1 line, and looks
something
like this: {"CentOS6_Servers": ["server1", "server2", "server3",
"server4", "server5", ... etc for 600+ servers and many many groops.
When I try this:
ansible CentOS6_Servers -a "hostname" -i
/etc/ansible/inventory/spacewalk_list_07-11-2014.txt
I get this -> ERROR: Invalid ini entry: [ncias-p584.nci.nih.gov, -
need
more than 1 value to unpack
Is this due to the file being all one line? Is this improper YAML
syntax,
maybe? Sorry, I am a new to YAML Syntax, and Ansible.
Am I using spacewalk.py incorrectly?
Yes. You should point Ansible to the script, not saved output (if the file given to -i is executable, Ansible will use it as dynamic inventory).
The error you are getting says that Ansible expects static inventories to be in an INI-like syntax.
so, like this?
ansible -i spacewalk.py textfile.txt?
David Jacobs <psychodj@gmail.com> napisał:
so, like this?
ansible -i spacewalk.py textfile.txt?
More like:
ansible CentOS6_Servers -i spacewalk.py -m ping
What was textfile.txt meant to be?
ansible -i spacewalk.py playbook.yml
and spacewalk.py should be marked executable (chmod +x)
Dnia śro, 16 lip 2014, 21:37:54 Michael DeHaan pisze:
ansible -i spacewalk.py playbook.yml
You mean "ansible-playbook -i spacewalk.py playbook.yml"?