use include_tasks instead of include

include is marked as deprecated since ansible 2.4[0]

Switch to include_tasks or import_playbook as necessary

[0] https://docs.ansible.com/ansible/2.4/include_module.html#deprecated

Change-Id: I0fcc921ab5382d5f5a303be0bb989f135fa5cf9b
This commit is contained in:
ZhijunWei 2018-08-19 11:45:07 -04:00 committed by weizj
parent 7075184469
commit 2f5b325565
12 changed files with 27 additions and 34 deletions

View File

@ -24,13 +24,12 @@
tags:
- always
- include: rabbitmq_pre_install.yml
- include_tasks: rabbitmq_pre_install.yml
tags:
- rabbitmq_server-install
# The install process will be skipped if `rabbitmq_ignore_version_state=true`
- include: rabbitmq_install.yml
static: no
- include_tasks: rabbitmq_install.yml
when: not rabbitmq_ignore_version_state | bool
# RabbitMQ SSL/TLS listener configuration
@ -43,28 +42,27 @@
#
# playbooks/roles/rabbitmq_server/defaults/main.yml
#
- include: rabbitmq_ssl_self_signed.yml
static: no
- include_tasks: rabbitmq_ssl_self_signed.yml
when: >
rabbitmq_user_ssl_cert is not defined or
rabbitmq_user_ssl_key is not defined
tags:
- rabbitmq_server-config
- include: rabbitmq_ssl_user_provided.yml
- include_tasks: rabbitmq_ssl_user_provided.yml
tags:
- rabbitmq_server-config
- include: rabbitmq_set_cookie.yml
- include_tasks: rabbitmq_set_cookie.yml
tags:
- rabbitmq_server-config
- rabbitmq-config
- include: rabbitmq_post_install.yml
- include_tasks: rabbitmq_post_install.yml
tags:
- rabbitmq_server-config
- include: rabbitmq_cluster.yml
- include_tasks: rabbitmq_cluster.yml
tags:
- rabbitmq_server-config
- rabbitmq-cluster

View File

@ -41,8 +41,7 @@
- "_cluster_name.stdout != rabbitmq_cluster_name"
- name: Join cluster on secondary nodes
include: rabbitmq_cluster_join.yml
static: no
include_tasks: rabbitmq_cluster_join.yml
when:
- "ansible_hostname != rabbitmq_primary_cluster_node"
- "_cluster_name.stdout != rabbitmq_cluster_name"

View File

@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- include: rabbitmq_upgrade_check.yml
- include_tasks: rabbitmq_upgrade_check.yml
- include: "install_{{ ansible_pkg_mgr }}.yml"
- include_tasks: "install_{{ ansible_pkg_mgr }}.yml"
tags:
- rabbitmq-apt-packages
- rabbitmq-yum-packages
@ -41,6 +41,6 @@
- rabbitmq-policy-file
- rabbitmq_server-config
- include: rabbitmq_started.yml
- include_tasks: rabbitmq_started.yml
tags:
- rabbitmq_server-config

View File

@ -84,8 +84,7 @@
- rabbitmq-config
- rabbitmq-cluster
- include: rabbitmq_restart.yml
static: no
- include_tasks: rabbitmq_restart.yml
when: rabbit_config is changed or rabbitmq_plugin is changed or rabbitmq_policy is changed
# This is being done because the rabbitctl command used by the module

View File

@ -13,5 +13,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- include: rabbitmq_stopped.yml
- include: rabbitmq_started.yml
- include_tasks: rabbitmq_stopped.yml
- include_tasks: rabbitmq_started.yml

View File

@ -22,13 +22,11 @@
group: rabbitmq
register: cookie_set
- include: rabbitmq_stopped.yml
static: no
- include_tasks: rabbitmq_stopped.yml
when:
- cookie_set is changed
- include: rabbitmq_started.yml
static: no
- include_tasks: rabbitmq_started.yml
when:
- cookie_set is changed

View File

@ -15,11 +15,11 @@
# We create the self-signed SSL certificate and key only on the first
# RabbitMQ container.
- include: rabbitmq_ssl_key_create.yml
- include_tasks: rabbitmq_ssl_key_create.yml
when: inventory_hostname == groups[rabbitmq_host_group][0]
- include: rabbitmq_ssl_key_store.yml
- include_tasks: rabbitmq_ssl_key_store.yml
when: inventory_hostname == groups[rabbitmq_host_group][0]
- include: rabbitmq_ssl_key_distribute.yml
- include_tasks: rabbitmq_ssl_key_distribute.yml
when: inventory_hostname != groups[rabbitmq_host_group][0]

View File

@ -68,6 +68,5 @@
- rabbitmq-package-rpm
- rabbitmq-apt-packages
- include: rabbitmq_upgrade_prep.yml
static: no
- include_tasks: rabbitmq_upgrade_prep.yml
when: rabbitmq_upgrade | bool

View File

@ -23,7 +23,7 @@
- rabbitmq-policy-file
- rabbitmq-upgrade
- include: rabbitmq_stopped.yml
- include_tasks: rabbitmq_stopped.yml
- name: Ensure erlang epmd is stopped
shell: |

View File

@ -14,7 +14,7 @@
# limitations under the License.
# Install RabbitMQ server
- include: common/test-install-rabbitmq.yml
- import_playbook: common/test-install-rabbitmq.yml
# Run functional tests
- include: test-rabbitmq-functional.yml
- import_playbook: test-rabbitmq-functional.yml

View File

@ -14,4 +14,4 @@
# limitations under the License.
# Setup the host
- include: common/test-setup-host.yml
- import_playbook: common/test-setup-host.yml

View File

@ -14,10 +14,10 @@
# limitations under the License.
# Setup the host
- include: common/test-setup-host.yml
- import_playbook: common/test-setup-host.yml
# Install RabbitMQ server
- include: common/test-install-rabbitmq.yml
- import_playbook: common/test-install-rabbitmq.yml
# Run functional tests
- include: test-rabbitmq-functional.yml
- import_playbook: test-rabbitmq-functional.yml