[ansible-project] ImportError: cannot import name callbacks

2018-05-04 Thread niraj pandey
I am getting the following error while using ansible module in my python 
script.

Traceback (most recent call last):
  File "./ansible_playbook.py", line 2, in 
from ansible import playbook, callbacks
ImportError: cannot import name callbacks


Python version:  2.7.10

Ansible module version 2.5.2 (
https://files.pythonhosted.org/packages/d8/5f/3e7d8243159ba831942b851891d8eeac04615323a91e8447365aa7311299/ansible-2.5.2.tar.gz
)


Thanks
Niraj

-- 
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/e00738dd-6c30-4236-84de-88a98908bc86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible copy file on remote machines on different location.

2017-03-22 Thread niraj pandey
Many thanks !!

On Friday, March 3, 2017 at 3:03:04 PM UTC+5:30, niraj pandey wrote:
>
>
>
> down votefavorite 
> <http://stackoverflow.com/questions/42433905/ansible-copy-file#>
>
> How can I copy a file from machine A to machine B and machine C on 
> different location. ie:
>
> On machine A I have file abc and I want to copy it on the /tmp area of 
> machine B and /opt area of  machine C.
>
>
> I tried this so far:
>
>
> *My inventory file:*
>
>
> [webserver]
>
> machine-B dst=/tmp
>
> machine-C dst=/opt
>
>
> *Playbook:*
>
>
> - hosts: webserver
>
>   tasks:
>
> - name: Transfer file from ServerA to ServerB
>
>   synchronize:
>
> src: /home/niraj/ansible_testing
>
> dest: "{{ hostvars[item]['dst'] }}"
>
>   with_items: "{{ groups['webserver'] }}"
>
> #dest: /home/niraj
>
> #mode: pull
>
>   delegate_to: machine-A
>

-- 
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/913769eb-d4ab-47b4-a6ac-0b3016759538%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible copy file on remote machines on different location.

2017-03-09 Thread niraj pandey
Can someone please help me on this.

On Friday, March 3, 2017 at 3:24:46 PM UTC+5:30, niraj pandey wrote:
>
> I tried this but it copying the file on both the location on both the 
> machines.
>
> On Friday, March 3, 2017 at 3:03:04 PM UTC+5:30, niraj pandey wrote:
>>
>>
>>
>> down votefavorite 
>> <http://stackoverflow.com/questions/42433905/ansible-copy-file#>
>>
>> How can I copy a file from machine A to machine B and machine C on 
>> different location. ie:
>>
>> On machine A I have file abc and I want to copy it on the /tmp area of 
>> machine B and /opt area of  machine C.
>>
>>
>> I tried this so far:
>>
>>
>> *My inventory file:*
>>
>>
>> [webserver]
>>
>> machine-B dst=/tmp
>>
>> machine-C dst=/opt
>>
>>
>> *Playbook:*
>>
>>
>> - hosts: webserver
>>
>>   tasks:
>>
>> - name: Transfer file from ServerA to ServerB
>>
>>   synchronize:
>>
>> src: /home/niraj/ansible_testing
>>
>> dest: "{{ hostvars[item]['dst'] }}"
>>
>>   with_items: "{{ groups['webserver'] }}"
>>
>> #dest: /home/niraj
>>
>> #mode: pull
>>
>>   delegate_to: machine-A
>>
>

-- 
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/6679deeb-1f20-4822-a772-3c2de5da6558%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible copy file on remote machines on different location.

2017-03-03 Thread niraj pandey
I tried this but it copying the file on both the location on both the 
machines.

On Friday, March 3, 2017 at 3:03:04 PM UTC+5:30, niraj pandey wrote:
>
>
>
> down votefavorite 
> <http://stackoverflow.com/questions/42433905/ansible-copy-file#>
>
> How can I copy a file from machine A to machine B and machine C on 
> different location. ie:
>
> On machine A I have file abc and I want to copy it on the /tmp area of 
> machine B and /opt area of  machine C.
>
>
> I tried this so far:
>
>
> *My inventory file:*
>
>
> [webserver]
>
> machine-B dst=/tmp
>
> machine-C dst=/opt
>
>
> *Playbook:*
>
>
> - hosts: webserver
>
>   tasks:
>
> - name: Transfer file from ServerA to ServerB
>
>   synchronize:
>
> src: /home/niraj/ansible_testing
>
> dest: "{{ hostvars[item]['dst'] }}"
>
>   with_items: "{{ groups['webserver'] }}"
>
> #dest: /home/niraj
>
> #mode: pull
>
>   delegate_to: machine-A
>

-- 
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/9edabaf2-fe96-45d8-8549-cfe158e76b81%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible copy file on remote machines on different location.

2017-03-03 Thread niraj pandey


down votefavorite 


How can I copy a file from machine A to machine B and machine C on 
different location. ie:

On machine A I have file abc and I want to copy it on the /tmp area of 
machine B and /opt area of  machine C.


I tried this so far:


*My inventory file:*


[webserver]

machine-B dst=/tmp

machine-C dst=/opt


*Playbook:*


- hosts: webserver

  tasks:

- name: Transfer file from ServerA to ServerB

  synchronize:

src: /home/niraj/ansible_testing

dest: "{{ hostvars[item]['dst'] }}"

  with_items: "{{ groups['webserver'] }}"

#dest: /home/niraj

#mode: pull

  delegate_to: machine-A

-- 
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/2e7572ed-986d-4318-8198-d10ba38c1e6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Need some help

2016-07-18 Thread niraj pandey
Thanks ,

Is this applicable on RHEL5 machines as well ?

Thanks
Niraj

On Thursday, July 14, 2016 at 10:20:57 PM UTC+5:30, niraj pandey wrote:
>
> Hi,
>
> I have just started to learn Ansible and facing some issue while executing 
> a simple ping command:
>
> ansible webserver -m ping
>
> wllog | FAILED! => {
> "changed": false,
> "failed": true,
> "module_stderr": "",
> "module_stdout": "Traceback (most recent call last):\r\n  File 
> \"/home/niraj/.ansible/tmp/ansible-tmp-1468471044.71-226020658252160/ping.py\",
>  
> line 120, in ?\r\nexitcode = invoke_module(module, zipped_mod, 
> ZIPLOADER_PARAMS)\r\n  File 
> \"/home/niraj/.ansible/tmp/ansible-tmp-1468471044.71-226020658252160/ping.py\",
>  
> line 29, in invoke_module\r\n(stdout, stderr) = 
> p.communicate(json_params)\r\n  File 
> \"/usr/lib64/python2.4/subprocess.py\", line 1064, in communicate\r\n   
>  bytes_written = os.write(self.stdin.fileno(), input[:512])\r\nOSError: 
> [Errno 32] Broken pipe\r\n",
> "msg": "MODULE FAILURE",
> "parsed": false
> }
>
> Little bit googling hints that I need to install simplejason module on the 
> client machine.
>
> Is there any way that ansible use the python from alternate location on 
> client machine to pass information back instead of it's default location 
> (/usr/bin/python).
>
> As I have a python installed centrally and accessible from all the hosts. 
> This python carrying most of the modules. So I want client should use that 
> python to pass information back to ansible.
>
> Thanks
> ~Niraj
>
>

-- 
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/a14d4f71-bd4f-4134-9cbf-c7f772794d04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Need some help

2016-07-14 Thread niraj pandey
Hi,

I have just started to learn Ansible and facing some issue while executing 
a simple ping command:

ansible webserver -m ping

wllog | FAILED! => {
"changed": false,
"failed": true,
"module_stderr": "",
"module_stdout": "Traceback (most recent call last):\r\n  File 
\"/home/niraj/.ansible/tmp/ansible-tmp-1468471044.71-226020658252160/ping.py\", 
line 120, in ?\r\nexitcode = invoke_module(module, zipped_mod, 
ZIPLOADER_PARAMS)\r\n  File 
\"/home/niraj/.ansible/tmp/ansible-tmp-1468471044.71-226020658252160/ping.py\", 
line 29, in invoke_module\r\n(stdout, stderr) = 
p.communicate(json_params)\r\n  File 
\"/usr/lib64/python2.4/subprocess.py\", line 1064, in communicate\r\n   
 bytes_written = os.write(self.stdin.fileno(), input[:512])\r\nOSError: 
[Errno 32] Broken pipe\r\n",
"msg": "MODULE FAILURE",
"parsed": false
}

Little bit googling hints that I need to install simplejason module on the 
client machine.

Is there any way that ansible use the python from alternate location on 
client machine to pass information back instead of it's default location 
(/usr/bin/python).

As I have a python installed centrally and accessible from all the hosts. 
This python carrying most of the modules. So I want client should use that 
python to pass information back to ansible.

Thanks
~Niraj

-- 
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/cb8574ab-345f-46d2-986e-2ac2c1353776%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.