From 151d8e21a5f146418e9f28d91c6e93edbac367ea Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Tue, 12 Dec 2017 14:58:50 +0000 Subject: xci: Fix checkout location for OpenStack-Ansible The OPENSTACK_OSA_PATH only makes sense on localhost. As such, when we use it on playbooks that operate on remote hosts, the result is not predictable. However, we rsync the entire releng-xci repository to the opfnv host so we can make everything predictable by simply clone everything in advance in the .cache directory. That directory is then rsync'd to the opnfv host. As such, we can repurpose the OPENSTACK_OSA_PATH to point to the path into the OPNFV host. Moreover, all external repositories are being cloned to .cache/repos so we can eliminate some variables in order to simplify the code. Finally, we bring back the ability to use an external OSA repository for development purposes. Change-Id: Ieef3e22ae2085f6735185634d555cfc0d4b69b39 Signed-off-by: Markos Chandras --- xci/playbooks/configure-opnfvhost.yml | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'xci/playbooks/configure-opnfvhost.yml') diff --git a/xci/playbooks/configure-opnfvhost.yml b/xci/playbooks/configure-opnfvhost.yml index e9e4f6bb..0ceacc02 100644 --- a/xci/playbooks/configure-opnfvhost.yml +++ b/xci/playbooks/configure-opnfvhost.yml @@ -7,23 +7,6 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -- hosts: opnfv - remote_user: root - vars_files: - - ../var/opnfv.yml - pre_tasks: - - name: Load distribution variables - include_vars: - file: ../var/{{ ansible_os_family }}.yml - file: ../file/{{ XCI_FLAVOR }}/flavor-vars.yml - - roles: - - role: clone-repository - project: "openstack/openstack-ansible" - repo: "{{ OPENSTACK_OSA_GIT_URL }}" - dest: "{{ OPENSTACK_OSA_PATH }}" - version: "{{ OPENSTACK_OSA_VERSION }}" - - hosts: opnfv remote_user: root vars_files: @@ -35,9 +18,14 @@ with_items: - ../var/{{ ansible_os_family }}.yml - ../file/{{ XCI_FLAVOR }}/flavor-vars.yml + - name: Set facts for remote deployment + set_fact: + remote_xci_path: "{{ ansible_env.HOME }}/releng-xci" + remote_xci_flavor_files: "{{ ansible_env.HOME }}/releng-xci/xci/file/{{ XCI_FLAVOR }}" + remote_xci_playbooks: "{{ ansible_env.HOME }}/releng-xci/xci/playbooks" roles: - - role: configure-network + - role: configure-network tasks: - name: generate SSH keys @@ -49,11 +37,6 @@ src: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub" dest: "../file/authorized_keys" flat: yes - - name: Set facts for remote deployment - set_fact: - remote_xci_path: "{{ ansible_env.HOME }}/releng-xci" - remote_xci_flavor_files: "{{ ansible_env.HOME }}/releng-xci/xci/file/{{ XCI_FLAVOR }}" - remote_xci_playbooks: "{{ ansible_env.HOME }}/releng-xci/xci/playbooks" - name: Copy releng-xci to remote host synchronize: src: "{{ XCI_PATH }}/" -- cgit 1.2.3-korg