2 # Copyright 2015, Rackspace US, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 - name: Create the required deployment directories
21 mode: u=rwx,g=rwx,o=rwx
23 - "/etc/openstack_deploy/"
24 - "/etc/openstack_deploy/conf.d"
29 - name: Deploy user conf.d configuration
31 src: "{{ item.path | default(bootstrap_host_aio_config_path ~ '/conf.d') }}/{{ item.name }}"
32 dest: "/etc/openstack_deploy/conf.d/{{ item.name | regex_replace('.aio$', '') }}"
33 config_overrides: "{{ item.override | default({}) }}"
35 with_items: "{{ openstack_confd_entries | default([]) }}"
39 - name: Deploy openstack_user_config
41 src: "{{ bootstrap_host_aio_config_path }}/{{ bootstrap_host_aio_config_name }}"
42 dest: "/etc/openstack_deploy/openstack_user_config.yml"
44 - deploy-openstack-user-config
46 - name: Deploy user_secrets file
48 src: "{{ bootstrap_host_aio_config_path }}/user_secrets.yml"
49 dest: "/etc/openstack_deploy/{{ bootstrap_host_user_secrets_filename }}"
50 config_overrides: "{{ user_secrets_overrides | default({}) }}"
55 - name: Generate any missing values in user_secrets
56 command: "{{ bootstrap_host_aio_script_path }}/pw-token-gen.py --file /etc/openstack_deploy/{{ bootstrap_host_user_secrets_filename }}"
61 - name: Detect whether the host is an OpenStack-CI host
64 register: nodepool_dir
66 - name: Set the UCA repository URL in OpenStack-CI
68 uca_apt_repo_url: "{{ bootstrap_host_ubuntu_repo | netorigin }}/ubuntu-cloud-archive"
70 - nodepool_dir.stat.exists
71 - bootstrap_host_ubuntu_repo is defined
73 - name: Set the package cache timeout to 60 mins in OpenStack-CI
77 - cache_timeout is not defined
78 - nodepool_dir.stat.exists
80 - name: Determine if the host has a global pip config file
83 register: pip_conf_file
85 - name: Determine the fastest available OpenStack-Infra wheel mirror
86 command: "{{ bootstrap_host_aio_script_path }}/fastest-infra-wheel-mirror.py"
87 register: fastest_wheel_mirror
88 when: not pip_conf_file.stat.exists
90 - name: Set repo_build_pip_extra_indexes fact
92 repo_build_pip_extra_indexes: "{{ fastest_wheel_mirror.stdout_lines }}"
93 when: not pip_conf_file.stat.exists
95 - name: Check whether the host has a git cache
97 path: /opt/git/openstack
98 register: _local_git_cache
100 - name: Set repo_build_git_cache fact
102 repo_build_git_cache: /opt/git/openstack
103 when: _local_git_cache.stat.exists
105 - name: Copy example user_variables
107 src: "{{ bootstrap_host_aio_config_path }}/{{ bootstrap_host_user_variables_filename }}"
108 dest: "/etc/openstack_deploy/user_variables.yml"
110 - name: Create /etc/openstack_deploy/env.d/ directories
112 path: "/etc/openstack_deploy/env.d/"
114 when: bootstrap_env_file is defined
116 - name: Copy example user_variables
118 src: "{{ bootstrap_env_file }}"
119 dest: "/etc/openstack_deploy/env.d/"
120 when: bootstrap_env_file is defined
122 - name: Add user_conf_files to contain the list of files to copy into containers
124 path: /etc/openstack_deploy/user_conf_files.yml
126 when: pip_conf_file.stat.exists
128 - container-conf-files
130 - name: Ensure that the first line in user_conf_files is correct
132 dest: /etc/openstack_deploy/user_conf_files.yml
135 when: pip_conf_file.stat.exists
137 - container-conf-files
139 - name: Ensure that the second line in user_conf_files is correct
141 dest: /etc/openstack_deploy/user_conf_files.yml
142 line: "lxc_container_cache_files:"
144 when: pip_conf_file.stat.exists
146 - container-conf-files
148 - name: Add the dict to copy the global pip config file into user_conf_files
150 dest: /etc/openstack_deploy/user_conf_files.yml
151 line: " - { src: '/etc/pip.conf', dest: '/etc/pip.conf' }"
152 when: pip_conf_file.stat.exists
154 - container-conf-files