--
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/06746b76-6bd3-419d-a2d8-6e96d8667844%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
---
- hosts: all
gather_facts: false
become: yes
# become_user: root
# become_method: su
tasks:
- shell: "su - root"
args:
warn: false
- shell: '/scripts/dnscopy.pl -f'
register: (result)
- debug:
var: (result)
verbosity: 2
--
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/ef043055-1226-4a41-862f-2a3c66097b4c%40googlegroups.com.
--
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/b752d5fb-6eab-40d6-be5f-b9614b26fbc6%40googlegroups.com.
--
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/8667307d-c3ee-4c1f-b631-76a11db678b2%40googlegroups.com.
# rndc -s dns1 reload
@args = ("rndc", "-s", "dns1", "reload");
system(@args) == 0
or die "rndc -s dns1 reload failed: $!";
--
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/0e8146dc-6e84-41de-995e-235daf16f513%40googlegroups.com.
/usr/bin/which: no rndc in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/bin:/bin) <-- not a surprise; BIND isn't installed on this machine
--
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/d3545631-8f41-4eb2-af66-0a024ab76982%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACHJvyPhExxTL0HFkGJO652TxXwZgFcOdNZGyP7PQcCa_5Ktaw%40mail.gmail.com.
--
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/1705138.hhaqN51Kjx%40x1.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACHJvyMpuD0H0sjznPfAOdFTm7b%3DMxa6nb3EsndZ%2BqXS0zcfYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2B%2BT08RiM7jMM34bEC7iaRvFW30TQTUA4gdDs8s4XWHfM%2BGHRA%40mail.gmail.com.
---
- hosts: all
gather_facts: false
become: yes
become_method: su
become_flags: '-'
vars:
ansible_become_pass: "rootpass"
tasks:
- shell: /scripts/dnscopy.pl -f
register: script_output
- debug:
var: script_output.stdout_lines
TASK [command] ****************************************************************
task path: /etc/ansible/playbooks/rundeck/dnscopy.yml:13
Using module file /usr/lib/python2.7/site-packages/ansible/modules/commands/command.py
<admin1> ESTABLISH SSH CONNECTION FOR USER: a-scripting
<admin1> SSH: EXEC sshpass -d12 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=a-scripting -o ConnectTimeout=300 -o ControlPath=/root/.ansible/cp/00d0d0be4b admin1 '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<admin1> (0, '/home/a-scripting\n', '')
<admin1> ESTABLISH SSH CONNECTION FOR USER: a-scripting
<admin1> SSH: EXEC sshpass -d12 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=a-scripting -o ConnectTimeout=300 -o ControlPath=/root/.ansible/cp/00d0d0be4b admin1 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/a-scripting/.ansible/tmp/ansible-tmp-1544020870.43-70326662458073 `" && echo ansible-tmp-1544020870.43-70326662458073="` echo /home/a-scripting/.ansible/tmp/ansible-tmp-1544020870.43-70326662458073 `" ) && sleep 0'"'"''
<admin1> (0, 'ansible-tmp-1544020870.43-70326662458073=/home/a-scripting/.ansible/tmp/ansible-tmp-1544020870.43-70326662458073\n', '')
<admin1> PUT /tmp/tmpKrQPZW TO /home/a-scripting/.ansible/tmp/ansible-tmp-1544020870.43-70326662458073/command.py
<admin1> SSH: EXEC sshpass -d12 sftp -o BatchMode=no -b - -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=a-scripting -o ConnectTimeout=300 -o ControlPath=/root/.ansible/cp/00d0d0be4b '[admin1]'
<admin1> (0, 'sftp> put /tmp/tmpKrQPZW /home/a-scripting/.ansible/tmp/ansible-tmp-1544020870.43-70326662458073/command.py\n', '')
<admin1> ESTABLISH SSH CONNECTION FOR USER: a-scripting
<admin1> SSH: EXEC sshpass -d12 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=a-scripting -o ConnectTimeout=300 -o ControlPath=/root/.ansible/cp/00d0d0be4b admin1 '/bin/sh -c '"'"'chmod u+x /home/a-scripting/.ansible/tmp/ansible-tmp-1544020870.43-70326662458073/ /home/a-scripting/.ansible/tmp/ansible-tmp-1544020870.43-70326662458073/command.py && sleep 0'"'"''
<admin1> (0, '', '')
<admin1> ESTABLISH SSH CONNECTION FOR USER: a-scripting
<admin1> SSH: EXEC sshpass -d12 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o User=a-scripting -o ConnectTimeout=300 -o ControlPath=/root/.ansible/cp/00d0d0be4b -tt admin1 '/bin/sh -c '"'"'su - root -c '"'"'"'"'"'"'"'"'/bin/sh -c '"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-ekoalvjsxgctatfhsngmjohojiatrsbx; /usr/bin/python /home/a-scripting/.ansible/tmp/ansible-tmp-1544020870.43-70326662458073/command.py; rm -rf "/home/a-scripting/.ansible/tmp/ansible-tmp-1544020870.43-70326662458073/" > /dev/null 2>&1'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"'"''"'"'"'"'"'"'"'"' && sleep 0'"'"''
<admin1> (0, '\r\n\r\n{"changed": true, "end": "2018-12-05 09:41:14.641125", "stdout": "server reload successful\\nserver reload successful\\nserver reload successful\\nserver reload successful", "cmd": "/scripts/dnscopy.pl -f", "rc": 0, "start": "2018-12-05 09:41:10.058261", "stderr": "", "delta": "0:00:04.582864", "invocation": {"module_args": {"warn": true, "executable": null, "_uses_shell": true, "_raw_params": "/scripts/dnscopy.pl -f", "removes": null, "creates": null, "chdir": null}}, "warnings": []}\r\n', 'Shared connection to admin1 closed.\r\n')
changed: [admin1] => {
"changed": true,
"cmd": "/scripts/dnscopy.pl -f",
"delta": "0:00:04.582864",
"end": "2018-12-05 09:41:14.641125",
"invocation": {
"module_args": {
"_raw_params": "/scripts/dnscopy.pl -f",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"warn": true
}
},
"rc": 0,
"start": "2018-12-05 09:41:10.058261"
}
STDOUT:
server reload successful
server reload successful
server reload successful
server reload successful
TASK [debug] ****************************************************************
task path: /etc/ansible/playbooks/rundeck/dnscopy.yml:15
ok: [admin1] => {
"script_output.stdout_lines": [
"server reload successful",
"server reload successful",
"server reload successful",
"server reload successful"
]
}