Project

General

Profile

Actions

Bug #27311

closed

With ansible-runner there is no partial success as is with ansible-playbook

Added by Adam Ruzicka almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1730344

Description of problem:
With ansible-runner there is no partial success as is with ansible-playbook.
if ansible REX job fails for one host the other hosts are marked as failed too even though job succeeded for them.

Version-Release number of selected component (if applicable):
@Satellite-6.6.0 Snap9
tfm-rubygem-foreman_ansible-3.0.3-3.el7sat.noarch
tfm-rubygem-foreman_ansible_core-3.0.0-1.el7sat.noarch
rubygem-smart_proxy_ansible-3.0.1-1.el7sat.noarch
ansible-runner-1.3.4-2.el7ar.noarch
ansible-2.8.2-1.el7ae.noarch

How reproducible:
deterministic

Steps to Reproduce:
1. Have Satellite and two hosts set up for REX using ansible-runner

  1. yum install ansible-runner
  2. hammer settings set --name ansible_implementation --value ansible-runner

2. On 1st host create a dir while on latter it doesn't exist

@host # mkdir /tmp/foo

3. Run Ansible Command job against the two hosts with command "cd /tmp/foo"

-------------
1:
2:PLAY [all] *************************************************************
3:
4:TASK [Gathering Facts] *************************************************
5:ok: [host1.example.com]
6:
7:TASK [shell] ***********************************************************
8:changed: [host1.example.com]
9:
10:TASK [debug] ***********************************************************
11:ok: [host1.example.com] => {
12: "out": {
13: "changed": true,
14: "cmd": "cd /tmp/foo\n",
15: "delta": "0:00:00.005329",
16: "end": "2019-07-16 08:49:49.585670",
17: "failed": false,
18: "rc": 0,
19: "start": "2019-07-16 08:49:49.580341",
20: "stderr": "",
21: "stderr_lines": [],
22: "stdout": "",
23: "stdout_lines": []
24: }
25:}
26:PLAY RECAP *************************************************************
27:host1.example.com : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
28:Exit status: 2
-------------
1:
2:PLAY [all] *************************************************************
3:
4:TASK [Gathering Facts] *************************************************
5:ok: [host2.example.com]
6:
7:TASK [shell] ***********************************************************
8:fatal: [host2.example.com]: FAILED! => {"changed": true, "cmd": "cd /tmp/foo\n", "delta": "0:00:00.004742", "end": "2019-07-16 08:49:49.584202", "msg": "non-zero return code", "rc": 1, "start": "2019-07-16 08:49:49.579460", "stderr": "/bin/sh: line 0: cd: /tmp/foo: No such file or directory", "stderr_lines": ["/bin/sh: line 0: cd: /tmp/foo: No such file or directory"], "stdout": "", "stdout_lines": []}
9:
10:TASK [debug] ***********************************************************
11:PLAY RECAP *************************************************************
12:host2.example.com : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
13:Exit status: 2
-------------

Actual results:
100% Failure (if 1 host fails then all hosts fail)

Expected results:
50% Success (failure of 1 host doesn't prevent other hosts to be successful)

Actions #1

Updated by The Foreman Bot almost 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_ansible/pull/282 added
Actions #2

Updated by Marek Hulán almost 6 years ago

  • Subject changed from With ansible-runner there is no partial success as is with ansible-playbook to With ansible-runner there is no partial success as is with ansible-playbook
  • Fixed in Releases foreman-ansible 3.0.4 added
Actions #3

Updated by Anonymous almost 6 years ago

  • Status changed from Ready For Testing to Closed
Actions #4

Updated by Adam Ruzicka almost 6 years ago

  • Fixed in Releases foreman_ansible_core 3.0.1 added
  • Fixed in Releases deleted (foreman-ansible 3.0.4)
Actions

Also available in: Atom PDF