Hello Guyz,

I have got the answer its ignore_errors which does the work.


On Saturday, August 5, 2017 at 11:00:12 PM UTC+5:30, Sameer Modak wrote:
>
> Hello Team,
>
>
>
> Below is the case where in first attempt when zypper code was on put first 
> before all other tasks, It failed to excute register and copy task on 
> [neslds12ainfo01],[NESLTR10AJAWA01] as previous zypper task failed it did 
> not try to execute the valid task on it. Note: (Zypper task will fail as 
> these two servers are redhat )
>
> When I swapped the last two tasks before zypper task it worked as expected 
> .
>
> However, it should not have happened as the task which correctly should 
> work as expected irrespective of 
> earlier tasks fails or passes on same node.
>
>
> Below is the Output before changing task order:-
>
> [smodak@hel-shell-2 ~]$ ansible-playbook -K sample.yml
> SSH password:
> SUDO password[defaults to SSH password]:
>
> PLAY [all] 
> *********************************************************************
>
> TASK [setup] 
> *******************************************************************
> fatal: [NESBWDA01]: FAILED! => {"changed": false, "failed": true, 
> "module_stderr": "Shared connection to nesbwda01 closed.\r\n", 
> "module_stdout": "Could not chdir to home directory /home/smodak: No such 
> file or directory\r\n\r\nsmodak is not in the sudoers file.  This incident 
> will be reported.\r\n", "msg": "MODULE FAILURE"}
> ok: [NESGWDDB01]
> ok: [NESEPDDB01]
> ok: [NESGRDDB01]
> ok: [NESHBDHDB01]
> ok: [neslds12ainfo01]
> ok: [NESLTR10AJAWA01]
> ok: [NESHEDHDB01]
> ok: [NESECDA01]
> ok: [NESMIDDB01]
> ok: [NESPIDDB01]
> ok: [NESHMDHDB01]
> ok: [NESNDIDB01]
> ok: [NESMGDA01]
> ok: [NESSMDDB01]
> ok: [NESSTDDB01]
>
> TASK [basic : Installing VIM] 
> **************************************************
> ok: [NESNDIDB01] => (item=[u'vim', u'ntp'])
> ok: [NESHMDHDB01] => (item=[u'vim', u'ntp'])
> ok: [NESMIDDB01] => (item=[u'vim', u'ntp'])
> ok: [NESECDA01] => (item=[u'vim', u'ntp'])
> failed: [NESLTR10AJAWA01] (item=[u'vim', u'ntp']) => {"cmd": 
> "/usr/bin/zypper --quiet --non-interactive --xmlout search --type package 
> --match-exact --details --installed-only ntp vim", "failed": true, "item": 
> ["vim", "ntp"], "msg": "[Errno 2] No such file or directory", "rc": 2}
> ok: [NESHEDHDB01] => (item=[u'vim', u'ntp'])
> failed: [neslds12ainfo01] (item=[u'vim', u'ntp']) => {"cmd": 
> "/usr/bin/zypper --quiet --non-interactive --xmlout search --type package 
> --match-exact --details --installed-only ntp vim", "failed": true, "item": 
> ["vim", "ntp"], "msg": "[Errno 2] No such file or directory", "rc": 2}
> ok: [NESEPDDB01] => (item=[u'vim', u'ntp'])
> ok: [NESGRDDB01] => (item=[u'vim', u'ntp'])
> ok: [NESGWDDB01] => (item=[u'vim', u'ntp'])
> ok: [NESPIDDB01] => (item=[u'vim', u'ntp'])
> ok: [NESMGDA01] => (item=[u'vim', u'ntp'])
> ok: [NESSMDDB01] => (item=[u'vim', u'ntp'])
> ok: [NESSTDDB01] => (item=[u'vim', u'ntp'])
> ok: [NESHBDHDB01] => (item=[u'vim', u'ntp'])
>
> TASK [basic : return motd to registered var] 
> ***********************************
> changed: [NESGWDDB01]
> changed: [NESHBDHDB01]
> changed: [NESECDA01]
> changed: [NESGRDDB01]
> changed: [NESEPDDB01]
> changed: [NESHEDHDB01]
> changed: [NESMIDDB01]
> changed: [NESNDIDB01]
> changed: [NESMGDA01]
> changed: [NESPIDDB01]
> changed: [NESHMDHDB01]
> changed: [NESSMDDB01]
> changed: [NESSTDDB01]
>
> TASK [basic : copying file in temp] 
> ********************************************
> ok: [NESGWDDB01]
> ok: [NESECDA01]
> ok: [NESGRDDB01]
> ok: [NESEPDDB01]
> ok: [NESHEDHDB01]
> ok: [NESNDIDB01]
> ok: [NESMIDDB01]
> ok: [NESHBDHDB01]
> ok: [NESPIDDB01]
> ok: [NESMGDA01]
> ok: [NESHMDHDB01]
> ok: [NESSMDDB01]
> ok: [NESSTDDB01]
>
>
> ===============================================================================
>
> _______________________>
>
> Below is the output after swapping task:
>
>
>
> [smodak@hel-shell-2 ~]$ ansible-playbook -K sample.yml
> SSH password:
> SUDO password[defaults to SSH password]:
>
> PLAY [all] 
> *********************************************************************
>
> TASK [setup] 
> *******************************************************************
> fatal: [NESBWDA01]: FAILED! => {"changed": false, "failed": true, 
> "module_stderr": "Shared connection to nesbwda01 closed.\r\n", 
> "module_stdout": "Could not chdir to home directory /home/smodak: No such 
> file or directory\r\n\r\nsmodak is not in the sudoers file.  This incident 
> will be reported.\r\n", "msg": "MODULE FAILURE"}
> ok: [NESECDA01]
> ok: [NESHBDHDB01]
> ok: [NESGWDDB01]
> ok: [NESEPDDB01]
> ok: [NESHEDHDB01]
> ok: [NESGRDDB01]
> ok: [neslds12ainfo01]
> ok: [NESHMDHDB01]
> ok: [NESLTR10AJAWA01]
> ok: [NESMIDDB01]
> ok: [NESMGDA01]
> ok: [NESPIDDB01]
> ok: [NESNDIDB01]
> ok: [NESSMDDB01]
> ok: [NESSTDDB01]
>
> TASK [basic : copying file in temp] 
> ********************************************
> ok: [NESGWDDB01]
> ok: [NESHBDHDB01]
> ok: [NESECDA01]
> ok: [NESGRDDB01]
> ok: [NESEPDDB01]
> ok: [NESHEDHDB01]
> changed: [NESLTR10AJAWA01]
> changed: [neslds12ainfo01]
> ok: [NESHMDHDB01]
> ok: [NESMGDA01]
> ok: [NESNDIDB01]
> ok: [NESPIDDB01]
> ok: [NESSMDDB01]
> ok: [NESSTDDB01]
> ok: [NESMIDDB01]
>
> TASK [basic : Installing VIM] 
> **************************************************
> ok: [NESHMDHDB01] => (item=[u'vim', u'ntp'])
> ok: [NESPIDDB01] => (item=[u'vim', u'ntp'])
> failed: [NESLTR10AJAWA01] (item=[u'vim', u'ntp']) => {"cmd": 
> "/usr/bin/zypper --quiet --non-interactive --xmlout search --type package 
> --match-exact --details --installed-only ntp vim", "failed": true, "item": 
> ["vim", "ntp"], "msg": "[Errno 2] No such file or directory", "rc": 2}
> ok: [NESHEDHDB01] => (item=[u'vim', u'ntp'])
> failed: [neslds12ainfo01] (item=[u'vim', u'ntp']) => {"cmd": 
> "/usr/bin/zypper --quiet --non-interactive --xmlout search --type package 
> --match-exact --details --installed-only ntp vim", "failed": true, "item": 
> ["vim", "ntp"], "msg": "[Errno 2] No such file or directory", "rc": 2}
> ok: [NESHBDHDB01] => (item=[u'vim', u'ntp'])
> ok: [NESEPDDB01] => (item=[u'vim', u'ntp'])
> ok: [NESECDA01] => (item=[u'vim', u'ntp'])
> ok: [NESGRDDB01] => (item=[u'vim', u'ntp'])
> ok: [NESGWDDB01] => (item=[u'vim', u'ntp'])
> ok: [NESNDIDB01] => (item=[u'vim', u'ntp'])
> ok: [NESMGDA01] => (item=[u'vim', u'ntp'])
> ok: [NESMIDDB01] => (item=[u'vim', u'ntp'])
> ok: [NESSMDDB01] => (item=[u'vim', u'ntp'])
> ok: [NESSTDDB01] => (item=[u'vim', u'ntp'])
>
>

-- 
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/5d3573ac-e844-48e2-9c77-b947e5e1c359%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to