Skip to content

Commit 6f52f20

Browse files
committed
bastion: added storage cleanup steps
1 parent bf4a804 commit 6f52f20

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

playbooks/deploy-ocp-hybrid-multinode.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@
360360
pull_secret_file: /tmp/pullsecret
361361
api_vips: "{{ api_vips_string | from_yaml }}"
362362
ingress_vips: "{{ ingress_vips_string | from_yaml }}"
363+
http_directory: /opt/http_store
363364

364365
tasks:
365366
- name: Populate pull secret
@@ -504,11 +505,17 @@
504505
ocp_version_facts_release: "{{ release }}"
505506
ocp_version_release_age_max_days: "{{ release_age_max_days | default(10000) | int }}"
506507

508+
- name: Clean HTTP storage directory
509+
ansible.builtin.file:
510+
path: "{{ http_directory }}"
511+
state: absent
512+
507513
- name: Setup HTTP storage
508514
ansible.builtin.import_role:
509515
name: redhatci.ocp.setup_http_store
510516
vars:
511517
http_port: "{{ share_http_iso_port }}"
518+
http_dir: "{{ http_directory }}"
512519

513520
- name: Deploy/Redeploy OCP client
514521
ansible.builtin.import_role:

playbooks/deploy-ocp-sno.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,15 @@
206206
ipv6_only: false
207207
disconnected: false
208208
pull_secret_file: /tmp/pullsecret
209+
http_directory: /opt/http_store
209210
tasks:
210211

212+
- name: Remove all Podman images
213+
containers.podman.podman_prune:
214+
image: true
215+
image_filters:
216+
dangling_only: false
217+
211218
- name: Render bastion variables from inventory strings
212219
delegate_to: bastion
213220
ansible.builtin.set_fact:
@@ -273,9 +280,15 @@
273280
ansible.builtin.import_role:
274281
name: ocp_version_facts
275282

283+
- name: Clean HTTP storage directory
284+
ansible.builtin.file:
285+
path: "{{ http_directory }}"
286+
state: absent
287+
276288
- name: Set up HTTP storage
277289
vars:
278290
http_port: "{{ share_http_iso_port }}"
291+
http_dir: "{{ http_directory }}"
279292
ansible.builtin.import_role:
280293
name: redhatci.ocp.setup_http_store
281294

playbooks/roles/ocp_operator_mirror/tasks/main.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
ansible.builtin.include_tasks: reset_registry_storage.yaml
4444
when: not (ocp_operator_mirror_skip_internal_registry_cleanup | default(false) | bool)
4545

46+
- name: Reset oc-mirror cache
47+
ansible.builtin.file:
48+
path: "{{ ansible_env.HOME }}/.oc-mirror/.cache"
49+
state: absent
50+
4651
- name: Configure registry authentication
4752
ansible.builtin.include_tasks: set_auth.yaml
4853

0 commit comments

Comments
 (0)