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
This commit is contained in:
David Moreau Simard 2019-07-02 11:18:15 -04:00
parent 92772d0c2e
commit ca5927fc1c
No known key found for this signature in database
GPG Key ID: CBEB466764A9E621
3 changed files with 6 additions and 3 deletions

View File

@ -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.

View File

@ -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.

View File

@ -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.