Re: [ansible-project] open(module, 'wb') SyntaxError for raw module in ansible-playbook

2019-04-04 Thread Sebastian Meyer
On 04.04.19 17:59, Henry Iracheta wrote:
> Here is an example of the playbook being tested:
> 
> - hosts: servers
>   remote_user: x
>   tasks:
>   - name: simply test to confirm playbook works
> raw: /bin/hostname
> 
> > Any suggestions on how to work around this issue ?


You need to set gather_facts to no. gather_facts uses the setup module,
which is Python.

- hosts: servers
  gather_facts: no
  tasks:
[...]


Sebastian

> 
> 

-- 
Sebastian Meyer
Linux Consultant & Trainer
Mail: me...@b1-systems.de

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537

-- 
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+unsubscr...@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/1bc1dd8e-001a-b4aa-dee6-8cac35907ce5%40b1-systems.de.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] open(module, 'wb') SyntaxError for raw module in ansible-playbook

2019-04-04 Thread Matt Martz
Ansible no longer supports Python 2.4 on target hosts.  The last version to
support Python 2.4 was Ansible 2.3.

On Thu, Apr 4, 2019 at 10:59 AM Henry Iracheta  wrote:

> I am trying to use Ansible on a remote host that has a version of Python
> 2.4.3 installed. My understanding is that a more recent version of
> Python is required to properly use Ansible; however, I should be able to
> use the "raw" module for such older Python environments. I am able to
> successfully
> use the "raw" module via the ansible CLI; however, when I try to use the
> raw module via the ansible-playbook CLI I get the following error:
>
> "line  39\r\n   with open(module, 'wb') as f:\r\n   ^\r\nSyntaxError:
> invalid syntax\r\n", "msg": "MODULE FAILURE
>
> Mapped "line 39" to file AnsiballZ_setup.py on the remote host. But
> surprised the file was invoked given the raw module was being used.
>
> Here is an example of the playbook being tested:
>
> - hosts: servers
>   remote_user: x
>   tasks:
>   - name: simply test to confirm playbook works
> raw: /bin/hostname
>
>
> Any suggestions on how to work around this issue ?
>
>
> --
> 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+unsubscr...@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/9ae0bd03-ae26-4ce7-84a7-5683a878dd6e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Matt Martz
@sivel
sivel.net

-- 
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+unsubscr...@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/CAD8N0v_eS7VmZ%3DZo1eh7NpJ4tRcmp_F3JMJULrJ9d7fEjLOPUA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.