Skip to content

Commit

Permalink
Merge pull request #383 from redhatci/clean_assisted
Browse files Browse the repository at this point in the history
Cleanup previous assisted installation
  • Loading branch information
betoredhat authored Jul 15, 2024
2 parents fe0a843 + 5968699 commit eb8bc4d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 2 additions & 0 deletions roles/setup_assisted_installer/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ assisted_service_installer_image: "{{ assisted_service_image_repo_url }}/assiste
assisted_postgres_image: quay.io/centos7/postgresql-12-centos7:centos7
assisted_installer_dir: /opt/assisted-installer
assisted_installer_data_dir: "{{ assisted_installer_dir }}/data"
setup_assisted_installer_keep_data: true
assisted_installer_pod_volumes: {}
# Useful if you want to e.g. install extra certificate chains in the pods prior
# to setting up the AI service, e.g. you built your own AI images and pushed
Expand Down Expand Up @@ -58,3 +59,4 @@ podman_ipv6_network_subnet: 'fd00::1:8:0/112'
podman_ipv6_network_gateway: 'fd00::1:8:1'
assisted_service_extra_config: {}
insecure_skip_verify: false
...
18 changes: 15 additions & 3 deletions roles/setup_assisted_installer/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,26 @@
- name: Open ports zone internal and public, for firewalld
firewalld:
port: "{{ item.1 }}/tcp"
permanent: yes
immediate: yes
permanent: true
immediate: true
state: enabled
zone: "{{ item.0 }}"
loop: "{{ ['internal', 'public'] | product(['8000', port, assisted_service_gui_port, assisted_service_image_service_port]) | list }}"

- name: Create directories for assisted-installer
- name: Delete previous assisted-installer directories
file:
path: "{{ item }}"
state: absent
force: true
with_items:
- "{{ assisted_installer_data_dir }}"
- "{{ assisted_installer_dir }}"
failed_when: false
when:
- setup_assisted_installer_keep_data | bool

- name: Create directories for assisted-installer
ansible.builtin.file:
path: "{{ item }}"
mode: 0775
state: directory
Expand Down

0 comments on commit eb8bc4d

Please sign in to comment.