Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subsequent plays in multi-play playbook don't run when a block rescue runs #13521

Closed
phips opened this issue Dec 11, 2015 · 1 comment
Closed
Labels
bug This issue/PR relates to a bug.
Milestone

Comments

@phips
Copy link
Contributor

phips commented Dec 11, 2015

  • Ansible Configuration:

Yesterday's stable-2.0 branch.

centos7:~$ rpm -q ansible --qf='%{name}-%{version}-%{release}\n'
ansible-2.0.0-0.git201512101810.75e6fb3.stable20.el7.centos
  • Environment:

CentOS 7

  • Summary:

In a multi-play playbook which contains a block with a rescue, if the rescue runs due to a failed task then subsequent plays don't run.

Steps To Reproduce:


---
- name: First play
  hosts: localhost
  connection: local
  tasks:
    - block:
      - command: /bin/false
      rescue:
      - command: /bin/true

    - name: Add to new group
      add_host:
        name: localhost
        ip: "{{ ansible_default_ipv4.address }}"
        group: just_created
      changed_when: false

- name: Second play
  hosts: just_created
  gather_facts: false
  become: true
  tasks:
    - name: Set hostname
      debug:
        var: "{{ ip }}"
  • Expected Results:

Should move onto the second play, but doesn't.

  • Actual Results:

Stops after first play.

(pip)centos7:~$ ansible-playbook fail_reproducer.yml 
 [WARNING]: provided hosts list is empty, only localhost is available


PLAY [First play] **************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [command] *****************************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["/bin/false"], "delta": "0:00:00.002312", "end": "2015-12-11 18:48:16.362123", "failed": true, "rc": 1, "start": "2015-12-11 18:48:16.359811", "stderr": "", "stdout": "", "stdout_lines": [], "warnings": []}

TASK [command] *****************************************************************
changed: [localhost]

TASK [Add to new group] ********************************************************
ok: [localhost]

PLAY RECAP *********************************************************************
localhost                  : ok=3    changed=1    unreachable=0    failed=1   
@jimi-c jimi-c added this to the v2 milestone Dec 11, 2015
@jimi-c jimi-c closed this as completed in 7f7e730 Dec 11, 2015
@jimi-c
Copy link
Member

jimi-c commented Dec 11, 2015

Closing This Ticket

Hi!

We believe the above commit should resolve this problem for you. This will also be included in the next major release.

If you continue seeing any problems related to this issue, or if you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:

Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular issue is resolved.

Thank you!

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue/PR relates to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants