Skip to content

Commit 510663b

Browse files
committed
bastion: added storage cleanup steps
1 parent bf4a804 commit 510663b

3 files changed

Lines changed: 33 additions & 0 deletions

File tree

playbooks/deploy-ocp-hybrid-multinode.yml

Lines changed: 14 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
@@ -374,6 +375,12 @@
374375
extra_machine_networks: "{{ extra_machine_networks_string | from_yaml }}"
375376
extra_service_networks: "{{ extra_service_networks_string | from_yaml }}"
376377

378+
- name: Remove all Podman images
379+
containers.podman.podman_prune:
380+
image: true
381+
image_filters:
382+
dangling_only: false
383+
377384
- name: Prepare disconnected infrastructure
378385
become: true
379386
when: internal_registry | bool or disconnected | bool
@@ -504,11 +511,18 @@
504511
ocp_version_facts_release: "{{ release }}"
505512
ocp_version_release_age_max_days: "{{ release_age_max_days | default(10000) | int }}"
506513

514+
- name: Clean HTTP storage directory
515+
become: true
516+
ansible.builtin.file:
517+
path: "{{ http_directory }}"
518+
state: absent
519+
507520
- name: Setup HTTP storage
508521
ansible.builtin.import_role:
509522
name: redhatci.ocp.setup_http_store
510523
vars:
511524
http_port: "{{ share_http_iso_port }}"
525+
http_dir: "{{ http_directory }}"
512526

513527
- name: Deploy/Redeploy OCP client
514528
ansible.builtin.import_role:

playbooks/deploy-ocp-sno.yml

Lines changed: 14 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,16 @@
273280
ansible.builtin.import_role:
274281
name: ocp_version_facts
275282

283+
- name: Clean HTTP storage directory
284+
become: true
285+
ansible.builtin.file:
286+
path: "{{ http_directory }}"
287+
state: absent
288+
276289
- name: Set up HTTP storage
277290
vars:
278291
http_port: "{{ share_http_iso_port }}"
292+
http_dir: "{{ http_directory }}"
279293
ansible.builtin.import_role:
280294
name: redhatci.ocp.setup_http_store
281295

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)