From 9d635836945cf76c8f9533ac06a68cf28b30cb9b Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Sun, 13 May 2018 20:29:59 +0100 Subject: [PATCH] Implement clouds.yaml on test hosts In order to allow us to make use of the Ansible shade modules to interact with the running OpenStack environment in tests, we execute the openstack_openrc role against the test host. The include_vars for the follow-on play is moved to make it easier to find, and the initial play's 'pre_tasks' are renamed to 'tasks' as there is no 'roles' implementation in the play. Change-Id: Iec4f266324d4e5f81d21163f68f8d5c32c34f86d --- test-prepare-host.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/test-prepare-host.yml b/test-prepare-host.yml index 1d755a95..7903c614 100644 --- a/test-prepare-host.yml +++ b/test-prepare-host.yml @@ -18,7 +18,9 @@ - name: Playbook for configuring hosts hosts: localhost become: true - pre_tasks: + vars_files: + - test-vars.yml + tasks: - include: "common-tasks/test-set-nodepool-vars.yml" - name: Clear iptables rules shell: "{{ playbook_dir }}/iptables-clear.sh" @@ -48,12 +50,18 @@ - name: Use present for package_state on CentOS and openSUSE set_fact: package_state: "{{ (ansible_pkg_mgr in ['dnf', 'yum', 'zypper']) | ternary('present', 'latest') }}" + - name: Setup clouds.yaml + include_role: + name: openstack_openrc + private: yes - include: test-install-openstack-hosts.yml - name: Playbook for configuring the LXC host hosts: localhost become: true + vars_files: + - test-vars.yml roles: - role: "lxc_hosts" lxc_net_address: 10.100.100.1 @@ -218,6 +226,3 @@ command: /usr/local/bin/lxc-system-manage iptables-create tags: - skip_ansible_lint - - vars_files: - - test-vars.yml