Set check_mode variable every time

In check mode, the security role will fail when tags are used. This
is because the check_mode variable wasn't being set when tags were
provided. This patch ensures that the tasks that check for check mode
and set the subsequent check_mode variable will run every time.

This is a manual backport of Ib6a29ee4c36632cd6d982ce87105f0ddec4a891d
since the master/Newton branch includes some new things for systemd that
doesn't make sense in Mitaka/Liberty.

Closes-bug: 1590086

Change-Id: Ib6a29ee4c36632cd6d982ce87105f0ddec4a891d
This commit is contained in:
Major Hayden 2016-06-09 08:19:27 -05:00
parent 932bae76d2
commit 6213c87d51
2 changed files with 13 additions and 2 deletions

View File

@ -0,0 +1,7 @@
---
fixes:
- |
When the security role was run in Ansible's check mode and a tag was
provided, the ``check_mode`` variable was not being set. Any tasks which
depend on that variable would fail. This `bug is fixed <https://bugs.launchpad.net/openstack-ansible/+bug/1590086>`_
and the ``check_mode`` variable is now set properly on every playbook run.

View File

@ -16,10 +16,14 @@
- name: Verify if we're using check mode
command: /bin/true
register: noop_result
tags:
- always
- name: Set a fact if we're in check mode
- name: Set facts
set_fact:
check_mode: "{{ noop_result|skipped }}"
check_mode: "{{ noop_result | skipped }}"
tags:
- always
- include: apt.yml
- include: auditd.yml