From ca5927fc1c1ec7544209c8daf328f3a4b36f1429 Mon Sep 17 00:00:00 2001 From: David Moreau Simard Date: Tue, 2 Jul 2019 11:18:15 -0400 Subject: [PATCH] Use include_role instead of import_role for integration tests Setting "public: yes" makes the variables available after running the role which is what we need for the purpose of testing. The problem with import_role is that the variables are parsed only once at the beginning [1]. [1]: https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.7.html#include-role-and-import-role-variable-exposure Change-Id: I2cc51eb8020bd8928031e75c85bcae22722e33e1 --- tests/with_defaults.yaml | 3 ++- tests/with_mysql.yaml | 3 ++- tests/with_postgresql.yaml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/with_defaults.yaml b/tests/with_defaults.yaml index b286e016..a9118f30 100644 --- a/tests/with_defaults.yaml +++ b/tests/with_defaults.yaml @@ -26,8 +26,9 @@ tasks: - block: - name: Set up the API with the ara_api role - import_role: + include_role: name: ara_api + public: yes # These are tasks rather than a standalone playbook to give us an easy # access to all the variables within the same play. diff --git a/tests/with_mysql.yaml b/tests/with_mysql.yaml index e5d9e157..bb5eed60 100644 --- a/tests/with_mysql.yaml +++ b/tests/with_mysql.yaml @@ -67,8 +67,9 @@ tasks: - block: - name: Set up the API with the ara_api role - import_role: + include_role: name: ara_api + public: yes # These are tasks rather than a standalone playbook to give us an easy # access to all the variables within the same play. diff --git a/tests/with_postgresql.yaml b/tests/with_postgresql.yaml index 69646cd3..7aae5767 100644 --- a/tests/with_postgresql.yaml +++ b/tests/with_postgresql.yaml @@ -63,8 +63,9 @@ tasks: - block: - name: Set up the API with the ara_api role - import_role: + include_role: name: ara_api + public: yes # These are tasks rather than a standalone playbook to give us an easy # access to all the variables within the same play.