diff --git a/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml b/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml index 3113ae21d9..3846810d10 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_aio_config.yml @@ -139,34 +139,46 @@ config_overrides: "{{ user_variables_overrides | default({}) }}" config_type: yaml -- name: Add user_apt_conf_files to contain the list of files to copy into containers +- name: Determine if the host has a global pip config file + stat: + path: /etc/pip.conf + register: pip_conf_file + +- name: Add user_conf_files to contain the list of files to copy into containers file: - path: /etc/openstack_deploy/user_apt_conf_files.yml + path: /etc/openstack_deploy/user_conf_files.yml state: touch when: - - apt_conf_files is defined - - apt_conf_files.stdout_lines | length > 0 + - apt_conf_files is defined or pip_conf_file.stat.exists tags: - - apt-conf-files + - container-conf-files -- name: Ensure that the first two lines in user_apt_conf_files are correct +- name: Ensure that the first two lines in user_conf_files are correct lineinfile: - dest: /etc/openstack_deploy/user_apt_conf_files.yml + dest: /etc/openstack_deploy/user_conf_files.yml line: "---\nlxc_container_cache_files:" insertbefore: BOF when: - - apt_conf_files is defined - - apt_conf_files.stdout_lines | length > 0 + - apt_conf_files is defined or pip_conf_file.stat.exists tags: - - apt-conf-files + - container-conf-files -- name: Add the list of dicts into user_apt_conf_files +- name: Add the dict to copy the global pip config file into user_conf_files lineinfile: - dest: /etc/openstack_deploy/user_apt_conf_files.yml + dest: /etc/openstack_deploy/user_conf_files.yml + line: " - { src: '/etc/pip.conf', dest: '/etc/pip.conf' }" + when: + - pip_conf_file.stat.exists + tags: + - container-conf-files + +- name: Add the list of dicts for the apt config files into user_conf_files + lineinfile: + dest: /etc/openstack_deploy/user_conf_files.yml line: " - { src: '/etc/apt/apt.conf.d/{{ item }}', dest: '/etc/apt/apt.conf.d/{{ item }}' }" with_items: apt_conf_files.stdout_lines when: - apt_conf_files is defined - apt_conf_files.stdout_lines | length > 0 tags: - - apt-conf-files + - container-conf-files