Force Ansible to use dynamic includes
Ansible 2.1.1 introduces a regression in the way conditional includes are handled which results in every task in the included file being evaluated even if the condition for the include is not met. This extends the run time significantly for a deployment. This patch forces all conditional includes to be dynamic. Change-Id: I39d0110bae6e1c5b7f24d0ffcb75c35508d27aea Related-Bug: https://github.com/ansible/ansible/issues/17687
This commit is contained in:
7 changed files with 20 additions and 14 deletions
@@ -40,6 +40,7 @@
# The install process will be skipped if `rabbitmq_ignore_version_state=true`
- include:rabbitmq_install.yml
static:no
when:not rabbitmq_ignore_version_state | bool
# RabbitMQ SSL/TLS listener configuration
@@ -53,6 +54,7 @@
# playbooks/roles/rabbitmq_server/defaults/main.yml
#
- include:rabbitmq_ssl_self_signed.yml
static:no
when:>
rabbitmq_user_ssl_cert is not defined or
rabbitmq_user_ssl_key is not defined
@@ -14,9 +14,9 @@
# limitations under the License.
- include:rabbitmq_cluster_create.yml
when:>
ansible_hostname == rabbitmq_primary_cluster_node
static:no
when:ansible_hostname == rabbitmq_primary_cluster_node
- include:rabbitmq_cluster_join.yml
when:>
ansible_hostname != rabbitmq_primary_cluster_node
static:no
when:ansible_hostname != rabbitmq_primary_cluster_node
@@ -16,14 +16,14 @@
- include:rabbitmq_upgrade_check.yml
- include:install_apt.yml
when:
- ansible_pkg_mgr == 'apt'
static:no
when:ansible_pkg_mgr == 'apt'
tags:
- rabbitmq-apt-packages
- include:install_yum.yml
when:
- ansible_pkg_mgr == 'yum'
static:no
when:ansible_pkg_mgr == 'yum'
tags:
- rabbitmq-yum-packages
@@ -78,6 +78,7 @@
- rabbitmq-config
- include:rabbitmq_restart.yml
static:no
when:rabbit_config_changed|changed or rabbitmq_plugin|changed or rabbitmq_queue_mirror|changed
# This is being done because the rabbitctl command used by the module
@@ -22,6 +22,7 @@
- rabbitmq-config
- include:rabbitmq_stopped.yml
static:no
when:tmp_rabbit_cookie.stdout != rabbitmq_cookie_token
tags:
- rabbitmq-config
@@ -39,6 +40,7 @@
- rabbitmq-config
- include:rabbitmq_started.yml
static:no
when:tmp_rabbit_cookie.stdout != rabbitmq_cookie_token
tags:
- rabbitmq-config
@@ -16,13 +16,13 @@
# We create the self-signed SSL certificate and key only on the first
# RabbitMQ container.
- include:rabbitmq_ssl_key_create.yml
when:>
inventory_hostname == groups[rabbitmq_host_group][0]
static:no
when:inventory_hostname == groups[rabbitmq_host_group][0]
- include:rabbitmq_ssl_key_store.yml
when:>
inventory_hostname == groups[rabbitmq_host_group][0]
static:no
when:inventory_hostname == groups[rabbitmq_host_group][0]
- include:rabbitmq_ssl_key_distribute.yml
when:>
inventory_hostname != groups[rabbitmq_host_group][0]
static:no
when:inventory_hostname != groups[rabbitmq_host_group][0]
@@ -66,4 +66,5 @@
- rabbitmq-apt-packages
- include:rabbitmq_upgrade_prep.yml
static:no
when:rabbitmq_upgrade | bool
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.