From fa4937e52efaf47d3ca8da9c16f5eb703c150a77 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Tue, 2 May 2017 15:08:22 +0100 Subject: [PATCH] Remove connection: local usage In Ansible 2.3 the local connection plugin overrides the host vars for the ansible_python_interpreter, causing tests to use the wrong interpreter and install python packages into unexpected locations. This is especially visible when using host delegation to localhost instead of the targeting localhost directly. To ensure that the behaviour remains consistent with our expectations all local connection usage for localhost is removed and localhost is targeted as a remote host. Change-Id: Ifcccf3c25aa10085b35017b01644354e10eca15a --- destroy_containers.yml | 1 - get-ansible-role-requirements.yml | 5 +++++ test-install-openstack-hosts.yml | 1 - test-prepare-containers.yml | 1 - test-prepare-host.yml | 2 -- test-prepare-keys.yml | 2 -- 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/destroy_containers.yml b/destroy_containers.yml index ffabc760..a2a9f26d 100644 --- a/destroy_containers.yml +++ b/destroy_containers.yml @@ -17,7 +17,6 @@ serial: 1 become: true gather_facts: false - connection: local tasks: - name: Destroy a container lxc_container: diff --git a/get-ansible-role-requirements.yml b/get-ansible-role-requirements.yml index af788af4..91aef68a 100644 --- a/get-ansible-role-requirements.yml +++ b/get-ansible-role-requirements.yml @@ -13,6 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Note(odyssey4me): +# This uses a local connection for the lint test which +# never sets up host keys and therefore cannot connect +# to localhost as a remote host. +# - name: Clone the role ansible-role-requirements hosts: localhost connection: local diff --git a/test-install-openstack-hosts.yml b/test-install-openstack-hosts.yml index 77371a66..e2ecec08 100644 --- a/test-install-openstack-hosts.yml +++ b/test-install-openstack-hosts.yml @@ -15,7 +15,6 @@ - name: Execute the openstack-host role hosts: localhost - connection: local become: true gather_facts: true pre_tasks: diff --git a/test-prepare-containers.yml b/test-prepare-containers.yml index 584d9bd4..f1e06fa4 100644 --- a/test-prepare-containers.yml +++ b/test-prepare-containers.yml @@ -15,7 +15,6 @@ - name: Playbook for creating containers hosts: localhost - connection: local become: true gather_facts: true diff --git a/test-prepare-host.yml b/test-prepare-host.yml index 4469fe91..108d6f48 100644 --- a/test-prepare-host.yml +++ b/test-prepare-host.yml @@ -15,7 +15,6 @@ - name: Playbook for configuring hosts hosts: localhost - connection: local become: true pre_tasks: - include: "common-tasks/test-set-nodepool-vars.yml" @@ -33,7 +32,6 @@ - name: Playbook for configuring the LXC host hosts: localhost - connection: local become: true roles: - role: "lxc_hosts" diff --git a/test-prepare-keys.yml b/test-prepare-keys.yml index 6a97594b..a2822c2e 100644 --- a/test-prepare-keys.yml +++ b/test-prepare-keys.yml @@ -15,7 +15,6 @@ - name: Playbook for establishing ssh keys hosts: localhost - connection: local gather_facts: false become: true tasks: @@ -58,7 +57,6 @@ - name: Playbook for establishing user ssh keys hosts: localhost - connection: local become: false tasks: # Shell used because facts may not be ready yet