On Saturday, 5 May 2012 22:24:31 UTC+5:30, Michael DeHaan wrote:
>
> Two new things on the devel branch of interest to people with EL 5
> hosts, or anywhere else where Python isn't 2.5 yet.
>
> (1)
>
> The raw module, added by Adrià Casajús, has been merged in. This
> allows direct SSH communication with hosts without using an Ansible
> module, and is of course therefore reliant on the user's shell and so
> forth.
>
> This is primarily usable in the case where you have a RHEL5/CentOS 5
> host and want to use Ansible with it. Before you can run a playbook
> you could fix them up like so:
>
> ansible all -m raw -a "yum install python-simplejson"
>
> It's also useful for talking to routers and load balancers or whatever
> that don't have Python installed.
>
> (2)
>
> The template, copy, and file modules can all now work without any JSON
> dependencies.
>
> If you need to set up EPEL first to get python-simplejson, you can
> also use the 'template' or 'copy' modules now first, because the file
> module no longer requires any JSON. I think that's pretty awesome, as
> we're now self bootstrapping for legacy hosts!
>
> ansible all -m copy -a "src=/wherever/epel.repo
> dest=/etc/yum.repos.d/epel"
> ansible all -m raw - a "yum install python-simplejson"
>
> Docs section on this coming soon.
>
> Generally any module that does not need to return simple json can be
> made to not have a dependency on JSON, but it's WAY too useful to be
> able to return complex data such that I don't intend to really port
> any additional modules to work this way. This is primarily there as
> instructions on how to get old hosts ready to use Ansible, and we'll
> document it that way.
>
I'm able to run the raw module using Ansible ad-hoc commands however, when
run the playbook with same commands it fails with error:
"invalid output was: Traceback (most recent call last):
File "/tmp/ansible-tmp-1418879078.47-138258829915016/setup", line 187, in
<module>
import locale
ImportError: No module named locale "
Any idea what I might be missing....or how how should I write the playbook
to reflect the same as I'm doing in ad-hoc command.
My ad-hoc command is: "sudo ansible locale1 -i data
--private-key=server.pem -vvvv -u ubuntu -m script -a multivr.sh "
Where miltivr.sh is a small script in bash that removes the multiverse.list.
locale1 is a tag in my inventory file to tell ansible which hosts I need to
run this command on.
Any help would be appreciated.
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/8bab1cd4-bfb2-4901-a2e5-7ad8936c99dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.