|
11 | 11 | state: latest |
12 | 12 | become: yes |
13 | 13 | when: ansible_os_family == 'RedHat' |
14 | | - tags: install |
| 14 | + tags: host-setup |
15 | 15 |
|
16 | 16 | - name: Install required packages |
17 | 17 | ansible.builtin.package: |
18 | 18 | name: |
19 | | - - ansible |
20 | 19 | - gcc |
21 | 20 | - git-core |
22 | 21 | - make |
|
25 | 24 | - python3-pip |
26 | 25 | state: latest |
27 | 26 | become: yes |
28 | | - tags: install |
| 27 | + tags: host-setup |
29 | 28 |
|
30 | 29 | - name: Install ansible |
31 | 30 | ansible.builtin.package: |
|
38 | 37 | ansible_distribution == 'Rocky' or |
39 | 38 | ansible_distribution == 'RedHat') |
40 | 39 | - ansible_distribution_major_version | int == 8 |
41 | | - tags: install |
| 40 | + tags: host-setup |
42 | 41 |
|
43 | 42 | - name: Install ansible-core |
44 | 43 | ansible.builtin.package: |
|
51 | 50 | ansible_distribution == 'Rocky' or |
52 | 51 | ansible_distribution == 'RedHat') |
53 | 52 | - ansible_distribution_major_version | int >= 9 |
54 | | - tags: install |
| 53 | + tags: host-setup |
55 | 54 |
|
56 | 55 | - name: Install kubefwd_amd64 |
57 | 56 | ansible.builtin.dnf: |
|
60 | 59 | disable_gpg_check: True |
61 | 60 | become: yes |
62 | 61 | when: ansible_os_family == 'RedHat' |
63 | | - tags: install |
| 62 | + tags: host-setup |
64 | 63 |
|
65 | 64 | - name: Install some extra packages |
66 | 65 | ansible.builtin.package: |
|
70 | 69 | - vim |
71 | 70 | state: latest |
72 | 71 | become: yes |
73 | | - tags: install |
| 72 | + tags: host-setup |
74 | 73 |
|
75 | 74 | - name: Pip install pre-commit as user |
76 | 75 | ansible.builtin.pip: |
77 | 76 | name: |
78 | 77 | - pre-commit |
79 | 78 | extra_args: --user |
80 | | - tags: install |
| 79 | + tags: host-setup |
81 | 80 |
|
82 | 81 | - name: Clone operators using Git |
83 | 82 | ansible.builtin.git: "{{ item }}" |
|
88 | 87 | template: |
89 | 88 | src: pull-secret.txt.j2 |
90 | 89 | dest: "~/pull-secret.txt" |
91 | | - tags: [crc, pre-config] |
| 90 | + tags: host-setup |
92 | 91 |
|
93 | 92 | - name: Ensure ~/.config/openstack directory exists |
94 | 93 | ansible.builtin.file: |
95 | 94 | path: ~/.config/openstack |
96 | 95 | state: directory |
97 | 96 | mode: '0755' |
98 | | - tags: [crc, pre-config] |
| 97 | + tags: host-setup |
99 | 98 |
|
100 | 99 | - name: Set up ~/.config/openstack/clouds.yaml |
101 | 100 | copy: |
102 | 101 | src: clouds.yaml |
103 | 102 | dest: ~/.config/openstack/clouds.yaml |
104 | | - tags: [crc, pre-config] |
| 103 | + tags: host-setup |
| 104 | + |
| 105 | +- name: Add exports to .bashrc |
| 106 | + lineinfile: |
| 107 | + path: ~/.bashrc |
| 108 | + line: "{{ item }}" |
| 109 | + with_items: |
| 110 | + - export GOPATH=$HOME/go |
| 111 | + - export PATH=$PATH:~/bin:$GOPATH/bin:~/.crc/bin/oc |
| 112 | + - export OS_CLOUD=default |
| 113 | + - export OS_PASSWORD=12345678 |
| 114 | + - export EDPM_COMPUTE_CEPH_ENABLED=false |
| 115 | + - export BMO_SETUP=false |
| 116 | + - export KUBECONFIG=~/.kube/config |
| 117 | + - alias openstack='oc exec -ti openstackclient -- openstack' |
| 118 | + tags: host-setup |
105 | 119 |
|
106 | | -- name: Create devsetup using make (may take 30 minutes or more) |
| 120 | +- name: Cleanup previous CRC setup |
| 121 | + make: |
| 122 | + target: crc_cleanup |
| 123 | + chdir: "~/install_yamls/devsetup" |
| 124 | + tags: [devsetup, cleanup] |
| 125 | + ignore_errors: True |
| 126 | + |
| 127 | +- name: Clean up ~/bin directory |
| 128 | + file: |
| 129 | + path: "~/bin/{{ item }}" |
| 130 | + state: absent |
| 131 | + with_items: [ crc, kubectl, kubectl-kuttl, kustomize, operator-sdk ] |
| 132 | + tags: [cleanup] |
| 133 | + |
| 134 | +- name: Clean up ~/.crc directory |
| 135 | + file: |
| 136 | + path: "~/.crc" |
| 137 | + state: absent |
| 138 | + tags: [cleanup] |
| 139 | + |
| 140 | +- name: Create crc using make (may take 30 minutes or more) |
107 | 141 | make: |
108 | 142 | target: crc |
109 | 143 | params: |
110 | 144 | CPUS: "{{ make_crc_cpus }}" |
111 | 145 | MEMORY: "{{ make_crc_memory }}" |
112 | 146 | DISK: "{{ make_crc_disk }}" |
| 147 | + CRC_VERSION: 2.33.0 |
113 | 148 | chdir: "~/install_yamls/devsetup" |
114 | | - tags: crc |
| 149 | + tags: devsetup |
115 | 150 |
|
116 | 151 | - name: Run make download_tools |
117 | 152 | make: |
118 | 153 | target: download_tools |
119 | 154 | chdir: "~/install_yamls/devsetup" |
120 | | - tags: crc |
| 155 | + tags: devsetup |
121 | 156 |
|
122 | 157 | - name: Create symbolic link for kubectl |
123 | 158 | file: |
124 | 159 | src: ~/.crc/bin/oc/oc |
125 | 160 | dest: ~/.crc/bin/oc/kubectl |
126 | 161 | state: link |
127 | | - tags: crc |
| 162 | + tags: host-setup |
128 | 163 |
|
129 | 164 | - name: Run make crc_attach_default_interface |
130 | 165 | shell: |
131 | 166 | cmd: | |
132 | 167 | set -exo pipefail |
133 | | - eval $(crc oc-env) |
134 | | - oc login -u kubeadmin -p 12345678 https://api.crc.testing:6443 |
| 168 | + sleep 30 |
| 169 | + eval $(crc oc-env); oc login -u kubeadmin -p 12345678 https://api.crc.testing:6443 |
135 | 170 | make attach_default_interface_cleanup |
| 171 | + sleep 10 |
136 | 172 | make crc_attach_default_interface |
| 173 | + sleep 30 |
137 | 174 | EDPM_TOTAL_NODES=1 EDPM_COMPUTE_VCPUS=16 EDPM_COMPUTE_RAM=100 EDPM_COMPUTE_DISK_SIZE=100 make edpm_compute |
138 | 175 | exit 0 |
139 | 176 | chdir: "~/install_yamls/devsetup" |
140 | | - tags: crc |
| 177 | + tags: devsetup |
141 | 178 |
|
142 | 179 | # Without this there could be image pull limit errors when deploying rabbitmq |
143 | 180 | # Based on https://docs.openshift.com/container-platform/4.13/openshift_images/managing_images/using-image-pull-secrets.html#images-update-global-pull-secret_using-image-pull-secrets |
|
154 | 191 | --to=pull-secret.json |
155 | 192 | oc set data secret/pull-secret -n openshift-config \ |
156 | 193 | --from-file=.dockerconfigjson=pull-secret.json |
157 | | - tags: pull-secret |
158 | | - |
159 | | -- name: Add exports to .bashrc |
160 | | - lineinfile: |
161 | | - path: ~/.bashrc |
162 | | - line: "{{ item }}" |
163 | | - with_items: |
164 | | - - export GOPATH=$HOME/go |
165 | | - - export PATH=$PATH:~/bin:$GOPATH/bin:~/.crc/bin/oc |
166 | | - - export OS_CLOUD=default |
167 | | - - export OS_PASSWORD=12345678 |
168 | | - - export EDPM_COMPUTE_CEPH_ENABLED=false |
169 | | - - export BMO_SETUP=false |
170 | | - - export KUBECONFIG=~/.kube/config |
171 | | - - alias openstack='oc exec -ti openstackclient -- openstack' |
172 | | - tags: config |
| 194 | + tags: devsetup |
173 | 195 |
|
174 | 196 | - name: Deploy openstack operators |
175 | 197 | shell: |
176 | 198 | cmd: | |
177 | 199 | set -exo pipefail |
178 | | - eval $(crc oc-env) |
179 | | - oc login -u kubeadmin -p 12345678 https://api.crc.testing:6443 |
| 200 | + eval $(crc oc-env); oc login -u kubeadmin -p 12345678 https://api.crc.testing:6443 |
180 | 201 | make crc_storage |
181 | 202 | make input |
182 | 203 | make openstack_wait 2>&1 | tee make_openstack.log |
183 | | - sleep 20 |
184 | | - TIMEOUT=800s make openstack_wait_deploy 2>&1 | \ |
185 | | - tee make_openstack_deploy.log |
186 | | - sleep 20 |
187 | | - TIMEOUT=800s DATAPLANE_TOTAL_NODES=1 make edpm_wait_deploy |
| 204 | + sleep 60 |
| 205 | + TIMEOUT=800s make openstack_wait_deploy 2>&1 | tee make_openstack_deploy.log |
| 206 | + sleep 60 |
| 207 | + TIMEOUT=800s DATAPLANE_TOTAL_NODES=1 make edpm_wait_deploy 2>&1 | tee make_edpm_deploy.log |
188 | 208 |
|
189 | 209 | oc patch csv -n openstack-operators octavia-operator.v0.0.1 --type json \ |
190 | 210 | -p="[{"op": "replace", "path": "/spec/install/spec/deployments/0/spec/replicas", "value": "0"}]" |
|
205 | 225 | exit 0 |
206 | 226 | #creates: "/etc/bash_completion.d/oc_completion" |
207 | 227 | chdir: "~/install_yamls" |
208 | | - tags: crc |
| 228 | + tags: install-yamls |
| 229 | + |
| 230 | +- name: Apply workarounds |
| 231 | + shell: |
| 232 | + cmd: | |
| 233 | + set -exo pipefail |
| 234 | + eval $(crc oc-env); oc login -u kubeadmin -p 12345678 https://api.crc.testing:6443 |
| 235 | + oc patch openstackcontrolplanes.core.openstack.org openstack-galera-network-isolation --type merge --patch \ |
| 236 | + '{"spec":{"octavia":{"template":{"apacheContainerImage":"registry.redhat.io/rhel8/httpd-24:latest"}}}}' |
| 237 | + oc patch openstackcontrolplane openstack-galera-network-isolation --type=merge --patch \ |
| 238 | + '{"spec":{"octavia":{"template":{"amphoraImageContainerImage":"registry-proxy.engineering.redhat.com/rh-osbs/rhosp-dev-preview-octavia-amphora-image:18.0.0"}}}}' |
| 239 | + # Fix networkAttachments for the amphora controller pods |
| 240 | + oc patch openstackcontrolplanes.core.openstack.org openstack-galera-network-isolation \ |
| 241 | + --type=merge --patch '{"spec":{"ovn":{"template":{"ovnController":{"nicMappings":{"octavia":"octavia"}}}}}}' |
| 242 | + oc patch openstackcontrolplanes.core.openstack.org openstack-galera-network-isolation \ |
| 243 | + --type=merge --patch \ |
| 244 | + '{"spec":{"octavia":{"template":{"octaviaHealthManager":{"networkAttachments":["octavia"]},"octaviaHousekeeping":{"networkAttachments":["octavia"]},"octaviaWorker":{"networkAttachments":["octavia"]}}}}}' |
| 245 | + tags: workarounds |
| 246 | + |
| 247 | +- name: make edpm_deploy_instance |
| 248 | + make: |
| 249 | + target: edpm_deploy_instance |
| 250 | + chdir: "~/install_yamls/devsetup" |
| 251 | + tags: install-yamls |
| 252 | + |
| 253 | +- name: Copy PodSet CR with containerImage fields set |
| 254 | + copy: |
| 255 | + src: octavia_v1beta1_octavia.yaml |
| 256 | + dest: ~/octavia_v1beta1_octavia.yaml |
| 257 | + force: no |
| 258 | + tags: post |
209 | 259 |
|
210 | 260 | - name: Install delve debugger |
211 | 261 | command: go install github.com/go-delve/delve/cmd/dlv@latest |
212 | | - tags: config |
| 262 | + tags: vscode |
213 | 263 |
|
214 | 264 | - name: Copy ~/.tmux.conf |
215 | 265 | copy: |
216 | 266 | src: ~/.tmux.conf |
217 | 267 | dest: ~/.tmux.conf |
218 | 268 | force: no |
219 | 269 | ignore_errors: true |
220 | | - tags: config |
| 270 | + tags: vscode |
221 | 271 |
|
222 | 272 | - name: Copy ~/.vscode jsons |
223 | 273 | copy: |
|
227 | 277 | with_items: |
228 | 278 | - launch.json |
229 | 279 | - tasks.json |
230 | | - tags: config |
| 280 | + tags: vscode |
231 | 281 |
|
232 | 282 | - name: Copy VSCode workspace config |
233 | 283 | copy: |
234 | 284 | src: stack.code-workspace |
235 | 285 | dest: ~/ |
236 | 286 | force: no |
237 | | - tags: config |
| 287 | + tags: vscode |
238 | 288 |
|
239 | 289 | - name: Increase max_user_watches for VSCode |
240 | 290 | become: yes |
241 | 291 | lineinfile: |
242 | 292 | path: /etc/sysctl.conf |
243 | 293 | line: fs.inotify.max_user_watches=524288 |
244 | 294 | notify: "Apply sysctl" |
245 | | - tags: config |
246 | | - |
247 | | -- name: Copy PodSet CR with containerImage fields set |
248 | | - copy: |
249 | | - src: octavia_v1beta1_octavia.yaml |
250 | | - dest: ~/octavia_v1beta1_octavia.yaml |
251 | | - force: no |
252 | | - tags: config |
| 295 | + tags: vscode |
253 | 296 |
|
254 | 297 | # Now run the operator as a Go program locally (outside the Kubernetes cluster): |
255 | 298 | # |
|
0 commit comments