Skip to content

Commit ca3ff51

Browse files
committed
Update install_yamls setup role
1 parent cbad18f commit ca3ff51

File tree

2 files changed

+101
-54
lines changed

2 files changed

+101
-54
lines changed

install_yamls_setup/ansible.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[defaults]
2+
nocows = True
3+
stdout_callback = debug
4+
verbosity = 2

install_yamls_setup/roles/podified_cp/tasks/main.yaml

Lines changed: 97 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111
state: latest
1212
become: yes
1313
when: ansible_os_family == 'RedHat'
14-
tags: install
14+
tags: host-setup
1515

1616
- name: Install required packages
1717
ansible.builtin.package:
1818
name:
19-
- ansible
2019
- gcc
2120
- git-core
2221
- make
@@ -25,7 +24,7 @@
2524
- python3-pip
2625
state: latest
2726
become: yes
28-
tags: install
27+
tags: host-setup
2928

3029
- name: Install ansible
3130
ansible.builtin.package:
@@ -38,7 +37,7 @@
3837
ansible_distribution == 'Rocky' or
3938
ansible_distribution == 'RedHat')
4039
- ansible_distribution_major_version | int == 8
41-
tags: install
40+
tags: host-setup
4241

4342
- name: Install ansible-core
4443
ansible.builtin.package:
@@ -51,7 +50,7 @@
5150
ansible_distribution == 'Rocky' or
5251
ansible_distribution == 'RedHat')
5352
- ansible_distribution_major_version | int >= 9
54-
tags: install
53+
tags: host-setup
5554

5655
- name: Install kubefwd_amd64
5756
ansible.builtin.dnf:
@@ -60,7 +59,7 @@
6059
disable_gpg_check: True
6160
become: yes
6261
when: ansible_os_family == 'RedHat'
63-
tags: install
62+
tags: host-setup
6463

6564
- name: Install some extra packages
6665
ansible.builtin.package:
@@ -70,14 +69,14 @@
7069
- vim
7170
state: latest
7271
become: yes
73-
tags: install
72+
tags: host-setup
7473

7574
- name: Pip install pre-commit as user
7675
ansible.builtin.pip:
7776
name:
7877
- pre-commit
7978
extra_args: --user
80-
tags: install
79+
tags: host-setup
8180

8281
- name: Clone operators using Git
8382
ansible.builtin.git: "{{ item }}"
@@ -88,56 +87,94 @@
8887
template:
8988
src: pull-secret.txt.j2
9089
dest: "~/pull-secret.txt"
91-
tags: [crc, pre-config]
90+
tags: host-setup
9291

9392
- name: Ensure ~/.config/openstack directory exists
9493
ansible.builtin.file:
9594
path: ~/.config/openstack
9695
state: directory
9796
mode: '0755'
98-
tags: [crc, pre-config]
97+
tags: host-setup
9998

10099
- name: Set up ~/.config/openstack/clouds.yaml
101100
copy:
102101
src: clouds.yaml
103102
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
105119

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)
107141
make:
108142
target: crc
109143
params:
110144
CPUS: "{{ make_crc_cpus }}"
111145
MEMORY: "{{ make_crc_memory }}"
112146
DISK: "{{ make_crc_disk }}"
147+
CRC_VERSION: 2.33.0
113148
chdir: "~/install_yamls/devsetup"
114-
tags: crc
149+
tags: devsetup
115150

116151
- name: Run make download_tools
117152
make:
118153
target: download_tools
119154
chdir: "~/install_yamls/devsetup"
120-
tags: crc
155+
tags: devsetup
121156

122157
- name: Create symbolic link for kubectl
123158
file:
124159
src: ~/.crc/bin/oc/oc
125160
dest: ~/.crc/bin/oc/kubectl
126161
state: link
127-
tags: crc
162+
tags: host-setup
128163

129164
- name: Run make crc_attach_default_interface
130165
shell:
131166
cmd: |
132167
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
135170
make attach_default_interface_cleanup
171+
sleep 10
136172
make crc_attach_default_interface
173+
sleep 30
137174
EDPM_TOTAL_NODES=1 EDPM_COMPUTE_VCPUS=16 EDPM_COMPUTE_RAM=100 EDPM_COMPUTE_DISK_SIZE=100 make edpm_compute
138175
exit 0
139176
chdir: "~/install_yamls/devsetup"
140-
tags: crc
177+
tags: devsetup
141178

142179
# Without this there could be image pull limit errors when deploying rabbitmq
143180
# 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,37 +191,20 @@
154191
--to=pull-secret.json
155192
oc set data secret/pull-secret -n openshift-config \
156193
--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
173195

174196
- name: Deploy openstack operators
175197
shell:
176198
cmd: |
177199
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
180201
make crc_storage
181202
make input
182203
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
188208
189209
oc patch csv -n openstack-operators octavia-operator.v0.0.1 --type json \
190210
-p="[{"op": "replace", "path": "/spec/install/spec/deployments/0/spec/replicas", "value": "0"}]"
@@ -205,19 +225,49 @@
205225
exit 0
206226
#creates: "/etc/bash_completion.d/oc_completion"
207227
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
209259

210260
- name: Install delve debugger
211261
command: go install github.com/go-delve/delve/cmd/dlv@latest
212-
tags: config
262+
tags: vscode
213263

214264
- name: Copy ~/.tmux.conf
215265
copy:
216266
src: ~/.tmux.conf
217267
dest: ~/.tmux.conf
218268
force: no
219269
ignore_errors: true
220-
tags: config
270+
tags: vscode
221271

222272
- name: Copy ~/.vscode jsons
223273
copy:
@@ -227,29 +277,22 @@
227277
with_items:
228278
- launch.json
229279
- tasks.json
230-
tags: config
280+
tags: vscode
231281

232282
- name: Copy VSCode workspace config
233283
copy:
234284
src: stack.code-workspace
235285
dest: ~/
236286
force: no
237-
tags: config
287+
tags: vscode
238288

239289
- name: Increase max_user_watches for VSCode
240290
become: yes
241291
lineinfile:
242292
path: /etc/sysctl.conf
243293
line: fs.inotify.max_user_watches=524288
244294
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
253296

254297
# Now run the operator as a Go program locally (outside the Kubernetes cluster):
255298
#

0 commit comments

Comments
 (0)