|
4 | 4 | - ../vars/zuul.yml
|
5 | 5 | roles:
|
6 | 6 | - configure-ephemeral
|
7 |
| - tasks: |
8 |
| - - name: Create dir for kolla logs |
9 |
| - file: |
10 |
| - path: "{{ kolla_logs_dir }}" |
11 |
| - state: directory |
12 |
| - |
13 |
| - - name: Dump host info to logs |
14 |
| - command: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tools/dump_info.sh" |
15 |
| - args: |
16 |
| - chdir: "{{ kolla_logs_dir }}" |
17 |
| - |
18 |
| - - name: Create dir for kolla build logs |
19 |
| - file: |
20 |
| - path: "{{ kolla_build_logs_dir }}" |
21 |
| - state: directory |
22 |
| - |
23 |
| - - name: Install Python3 pip and setuptools |
24 |
| - package: |
25 |
| - name: |
26 |
| - - python3-pip |
27 |
| - - python3-setuptools |
28 |
| - become: true |
29 |
| - |
30 |
| - # NOTE(hrw): On RedHat systems venv is part of python3-libs |
31 |
| - - name: Install Python3 venv on Debian systems |
32 |
| - package: |
33 |
| - name: |
34 |
| - - python3-venv |
35 |
| - become: true |
36 |
| - when: |
37 |
| - ansible_os_family == "Debian" |
38 |
| - |
39 |
| - - name: Create virtualenv |
40 |
| - command: python3 -m venv {{ virtualenv_path }} |
41 |
| - |
42 |
| - - name: Install kolla |
43 |
| - command: "{{ virtualenv_path }}/bin/python -m pip install {{ zuul.project.src_dir }}" |
44 |
| - |
45 |
| - - name: Install docker python library |
46 |
| - command: "{{ virtualenv_path }}/bin/python -m pip install docker" |
47 |
| - when: container_engine == "docker" |
48 |
| - |
49 |
| - - name: Install podman python library |
50 |
| - command: "{{ virtualenv_path }}/bin/python -m pip install podman rich" |
51 |
| - when: container_engine == "podman" |
52 |
| - |
53 |
| - - name: Configure Docker repo for Debian/Ubuntu |
54 |
| - block: |
55 |
| - - name: Add key for Docker APT repository |
56 |
| - apt_key: |
57 |
| - url: "{{ nodepool_docker_proxy }}/{{ ansible_distribution | lower }}/gpg" |
58 |
| - state: present |
59 |
| - |
60 |
| - - name: Add Docker APT repository |
61 |
| - apt_repository: |
62 |
| - repo: "deb {{ nodepool_docker_proxy }}/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable" |
63 |
| - state: present |
64 |
| - |
65 |
| - - name: Ensure AppArmor is installed |
66 |
| - package: |
67 |
| - name: apparmor |
68 |
| - state: present |
69 |
| - |
70 |
| - when: |
71 |
| - - ansible_os_family == "Debian" |
72 |
| - - container_engine == "docker" |
73 |
| - become: true |
74 |
| - |
75 |
| - - name: Configure Docker repo for CentOS |
76 |
| - block: |
77 |
| - - name: Add Docker repository |
78 |
| - yum_repository: |
79 |
| - name: docker |
80 |
| - description: Docker |
81 |
| - baseurl: "{{ nodepool_docker_proxy }}/centos/9/$basearch/stable" |
82 |
| - enabled: yes |
83 |
| - gpgcheck: yes |
84 |
| - gpgkey: "{{ nodepool_docker_proxy }}/centos/gpg" |
85 |
| - # module_hotfixes: True # enabled below (dnf, not yum, feature) |
86 |
| - |
87 |
| - - name: Enable module_hotfixes in Docker YUM repository |
88 |
| - lineinfile: |
89 |
| - path: /etc/yum.repos.d/docker.repo |
90 |
| - line: 'module_hotfixes=True' |
91 |
| - when: |
92 |
| - - ansible_os_family == "RedHat" |
93 |
| - - container_engine == "docker" |
94 |
| - become: true |
95 |
| - |
96 |
| - - name: Configure docker |
97 |
| - block: |
98 |
| - - name: Ensure /etc/docker exists |
99 |
| - become: true |
100 |
| - file: |
101 |
| - path: /etc/docker |
102 |
| - state: directory |
103 |
| - mode: 0755 |
104 |
| - |
105 |
| - - name: Configure registry-mirror in daemon.json |
106 |
| - become: true |
107 |
| - copy: |
108 |
| - dest: /etc/docker/daemon.json |
109 |
| - content: | |
110 |
| - { |
111 |
| - "registry-mirrors": [ |
112 |
| - "http://{{ zuul_site_mirror_fqdn }}:8082/" |
113 |
| - ] |
114 |
| - } |
115 |
| -
|
116 |
| - # NOTE(yoctozepto): We configure Docker before installing it because Debuntu starts services |
117 |
| - # during installation. |
118 |
| - - name: Install Docker |
119 |
| - package: |
120 |
| - name: docker-ce |
121 |
| - become: true |
122 |
| - |
123 |
| - - name: Ensure Docker service is started |
124 |
| - service: |
125 |
| - name: docker |
126 |
| - state: started |
127 |
| - become: true |
128 |
| - |
129 |
| - - name: Ensure Docker socket is world-writable |
130 |
| - file: |
131 |
| - path: /run/docker.sock |
132 |
| - mode: 0666 |
133 |
| - become: true |
134 |
| - when: |
135 |
| - - container_engine == "docker" |
136 |
| - |
137 |
| - - name: Configure podman |
138 |
| - block: |
139 |
| - - name: Ensure /etc/containers exists |
140 |
| - become: true |
141 |
| - file: |
142 |
| - path: /etc/containers |
143 |
| - state: directory |
144 |
| - mode: 0755 |
145 |
| - |
146 |
| - - name: Configure registries.conf |
147 |
| - become: true |
148 |
| - copy: |
149 |
| - dest: /etc/containers/registries.conf |
150 |
| - content: | |
151 |
| - unqualified-search-registries = ['docker.io'] |
152 |
| -
|
153 |
| - [[registry]] |
154 |
| - prefix = "docker.io" |
155 |
| - location = "docker.io" |
156 |
| -
|
157 |
| - [[registry.mirror]] |
158 |
| - prefix = "docker.io" |
159 |
| - location = "{{ zuul_site_mirror_fqdn }}:8082" |
160 |
| -
|
161 |
| - - name: Install Podman |
162 |
| - package: |
163 |
| - name: podman |
164 |
| - become: true |
165 |
| - |
166 |
| - # NOTE(jangutter): It appears that the default mount option |
167 |
| - # in the shipped `/etc/containers/storage.conf` for EL9 based distros |
168 |
| - # (Rocky, CentOS Stream, ...) has severe performance implications for |
169 |
| - # Kolla builds. This is because enabling `metacopy=on` disables `Native |
170 |
| - # Overlay Diff` This can be removed if the config is dropped from those |
171 |
| - # distros, or the underlying incompatibility can somehow be addressed. |
172 |
| - # Debian based distros do not ship `storage.conf` and seem |
173 |
| - # to be unaffected. |
174 |
| - - name: Remove metacopy, enable native overlay diff |
175 |
| - ini_file: |
176 |
| - path: /etc/containers/storage.conf |
177 |
| - section: storage.options.overlay |
178 |
| - option: mountopt |
179 |
| - value: '"nodev"' |
180 |
| - become: true |
181 |
| - when: ansible_os_family == "RedHat" |
182 |
| - |
183 |
| - - name: Ensure Podman service is started |
184 |
| - service: |
185 |
| - name: podman |
186 |
| - state: started |
187 |
| - become: true |
188 |
| - |
189 |
| - - name: Ensure Podman socket is world-writable |
190 |
| - file: |
191 |
| - path: /run/podman/podman.sock |
192 |
| - mode: 0666 |
193 |
| - become: true |
194 |
| - when: |
195 |
| - - container_engine == "podman" |
196 |
| - |
197 |
| - - name: Run multiarch/qemu-user-static image to support cross-arch build |
198 |
| - command: |
199 |
| - cmd: "{{ container_engine }} run --rm --privileged multiarch/qemu-user-static --reset -p yes" |
200 |
| - become: true |
201 |
| - when: ansible_facts.architecture != (base_arch | default('x86_64')) |
| 7 | + - kolla-build-deps |
0 commit comments