diff options
author | Markos Chandras <mchandras@suse.de> | 2017-12-12 14:58:50 +0000 |
---|---|---|
committer | Markos Chandras <mchandras@suse.de> | 2017-12-13 20:30:51 +0000 |
commit | 151d8e21a5f146418e9f28d91c6e93edbac367ea (patch) | |
tree | bdd36deace7d468a426d29c22644426fbe845236 /xci/playbooks/configure-localhost.yml | |
parent | 304a45bbdc52aa5e7f4374d027e4e17f42d2cd75 (diff) |
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 <mchandras@suse.de>
Diffstat (limited to 'xci/playbooks/configure-localhost.yml')
-rw-r--r-- | xci/playbooks/configure-localhost.yml | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/xci/playbooks/configure-localhost.yml b/xci/playbooks/configure-localhost.yml index 0265fd2c..279ae162 100644 --- a/xci/playbooks/configure-localhost.yml +++ b/xci/playbooks/configure-localhost.yml @@ -12,14 +12,7 @@ vars_files: - ../var/opnfv.yml - roles: - - role: clone-repository - project: "openstack/openstack-ansible-openstack_openrc" - repo: "{{ OPENSTACK_OSA_OPENRC_GIT_URL }}" - dest: roles/openstack-ansible-openstack_openrc - version: "master" - - tasks: + pre_tasks: - name: Load distribution variables include_vars: file: ../var/{{ ansible_os_family }}.yml @@ -29,11 +22,23 @@ state: absent recurse: no with_items: - - "{{ OPENSTACK_BIFROST_PATH }}" - - "{{ OPENSTACK_OSA_PATH }}" - - "{{ OPENSTACK_OSA_ETC_PATH }}" + - "{{ XCI_CACHE }}/repos" - "{{ LOG_PATH }} " - "{{ OPNFV_SSH_HOST_KEYS_PATH }}" + + roles: + - role: clone-repository + project: "openstack/openstack-ansible-openstack_openrc" + repo: "{{ OPENSTACK_OSA_OPENRC_GIT_URL }}" + dest: roles/openstack-ansible-openstack_openrc + version: "master" + - role: clone-repository + project: "openstack/openstack-ansible" + repo: "{{ OPENSTACK_OSA_GIT_URL }}" + dest: "{{ XCI_CACHE }}/repos/openstack-ansible" + version: "{{ OPENSTACK_OSA_VERSION }}" + + tasks: - name: create log directory {{LOG_PATH}} file: path: "{{LOG_PATH}}" @@ -56,3 +61,12 @@ - name: generate self signed certificate command: openssl req -new -nodes -x509 -subj "{{ XCI_SSL_SUBJECT }}" -days 3650 -keyout "/etc/ssl/private/xci.key" -out "/etc/ssl/certs/xci.crt" -extensions v3_ca become: true + - name: Synchronize local development OSA repository to XCI paths + # command module is much faster than the copy module + synchronize: + src: "{{ OPENSTACK_OSA_DEV_PATH }}" + dest: "{{ XCI_CACHE }}/repos/openstack-ansible" + recursive: yes + delete: yes + when: + - OPENSTACK_OSA_DEV_PATH != "" |