spacewalk.py issues and questions

142 views
Skip to first unread message

David Jacobs

unread,
Jul 15, 2014, 10:37:54 AM7/15/14
to ansible...@googlegroups.com
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.



Tomasz Kontusz

unread,
Jul 16, 2014, 3:51:00 AM7/16/14
to ansible...@googlegroups.com


David Jacobs <psyc...@gmail.com> napisał:
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.

>
>Thanks for assistance you can give me.

--
Wysłane za pomocą K-9 Mail.

David Jacobs

unread,
Jul 16, 2014, 10:16:54 AM7/16/14
to ansible...@googlegroups.com
so, like this?

ansible -i spacewalk.py textfile.txt? 

Tomasz Kontusz

unread,
Jul 16, 2014, 12:31:32 PM7/16/14
to ansible...@googlegroups.com


David Jacobs <psyc...@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?

>On Wednesday, July 16, 2014 3:51:00 AM UTC-4, Tomasz Kontusz wrote:
>>
>>
>>
>> David Jacobs <psyc...@gmail.com <javascript:>> napisał:

Michael DeHaan

unread,
Jul 16, 2014, 3:37:57 PM7/16/14
to ansible...@googlegroups.com
ansible -i spacewalk.py playbook.yml

and spacewalk.py should be marked executable (chmod +x)




--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ccbe806d-b1bb-4ec7-bfc6-823018997cc6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Tomasz Kontusz

unread,
Jul 16, 2014, 3:48:42 PM7/16/14
to ansible...@googlegroups.com
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"?

> and spacewalk.py should be marked executable (chmod +x)
>
>
>
>
> On Wed, Jul 16, 2014 at 10:16 AM, David Jacobs <psyc...@gmail.com
> <mailto:psyc...@gmail.com>> wrote:
>
> so, like this?
>
> ansible -i spacewalk.py textfile.txt?
>
>
> On Wednesday, July 16, 2014 3:51:00 AM UTC-4, Tomasz Kontusz wrote:
>
>
>
> David Jacobs <psyc...@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 <http://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.
>
> >
> >Thanks for assistance you can give me.
>
> --
> Wysłane za pomocą K-9 Mail.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to ansible-proje...@googlegroups.com
> <mailto:ansible-proje...@googlegroups.com>.
> To post to this group, send email to
> ansible...@googlegroups.com
> <mailto:ansible...@googlegroups.com>.
> <https://groups.google.com/d/msgid/ansible-project/ccbe806d-b1bb-4ec7-bfc6-823018997cc6%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ansible-proje...@googlegroups.com
> <mailto:ansible-proje...@googlegroups.com>.
> To post to this group, send email to ansible...@googlegroups.com
> <mailto:ansible...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgx0JHrw3oRtHe5ByMjnjxrrEeRp%2BaxHXnw8jR1De4brcQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgx0JHrw3oRtHe5ByMjnjxrrEeRp%2BaxHXnw8jR1De4brcQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Michael DeHaan

unread,
Jul 16, 2014, 7:49:55 PM7/16/14
to ansible...@googlegroups.com
yes



    To post to this group, send email to
--
You received this message because you are subscribed to the Google
Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/53C6D703.1070300%40gmail.com.
Reply all
Reply to author
Forward
0 new messages