A play encompasses `pre_tasks`, `roles`, `tasks`, and `post_tasks`.  You
are expecting it to end the role.

Perhaps you should instead move all subsequent tasks of that role into a
block or another file and use include_tasks, and then apply the `when`
statement to that (but reverse the logic).

On Wed, Feb 14, 2018 at 1:48 PM, John Harmon <jharmon.ansi...@gmail.com>
wrote:

> I have the following playbook:
> ---
> - hosts: "{{ host }}"
>
>   roles:
>     - ansible_dependencies
>     - aliases
>     - dns_update
>     - cpu_utilization
>     - role: nagios
>       install: yes
>     - password_policy
>     - role: disable_NetworkManager
>       new_install: yes
>     - ldap_users
>     - ps1_customize
>     - vim_customize
>     - sudoers
>     - grub_cmdline_oracle_tuning
>
> - import_playbook: /playbooks/one-offs/bash_history.yml
> - import_playbook: /playbooks/one-offs/dmesg_timestamps.yml
> - import_playbook: /playbooks/one-offs/grub_cmdline.yml
> - import_playbook: /playbooks/one-offs/update_gitlab_scripts.yml
> - import_playbook: /playbooks/one-offs/grub_timeout.yml
> - import_playbook: /playbooks/one-offs/update_sssd_ddns.yml
> - import_playbook: /playbooks/one-offs/authconfig_cleanup.yml
> - import_playbook: /playbooks/one-offs/change_timezone.yml
> - import_playbook: /playbooks/one-offs/firefox_no_gui.yml
> - import_playbook: /playbooks/one-offs/tcp_tuning.yml
>
> In the middle of disable_NetworkManager I have the following.  It works
> perfectly stand-alone.
> - meta: end_play
>   when: nm_installed.rc != 0 and new_install
>
> When this is encountered it skips the remaining roles of my playbook (and
> continues on with my import_playbook sections).
> The following get skipped:
>     - ldap_users
>     - ps1_customize
>     - vim_customize
>     - sudoers
>     - grub_cmdline_oracle_tuning
>
> I expected it to end the play for disable_networkManager, and then
> continue on with the rest of the roles.  Is this the way it is supposed to
> operate in this situation? is there a better approach to it?  Or does this
> sound like a bug?
>
> --
> 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/a114f93b-4365-48df-a3ad-79658047cb62%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/a114f93b-4365-48df-a3ad-79658047cb62%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
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/CAD8N0v_YRQnz%3DqarOnb4nTYnnRC1f0%2BOd%2BOGDP%3DYKOajLN_Quw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to