Skip to content

Commit

Permalink
Keep infra packages chrony and podman installed when purging a cluster
Browse files Browse the repository at this point in the history
By default chrony and podman will remain installed after the cluster
purge as they might already be there at Ceph installation and could be
used by other processes on the nodes.

Fixes: #239

Signed-off-by: Teoman ONAY <[email protected]>
  • Loading branch information
asm0deuz committed Nov 27, 2023
1 parent badf6b3 commit cc83617
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ceph_defaults/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ceph_pkgs:
- cephadm
- podman
- ceph-common
ceph_client_pkgs:
infra_pkgs:
- chrony
- ceph-common
client_group: clients
2 changes: 1 addition & 1 deletion cephadm-clients.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@

- name: install ceph client prerequisites if needed
package:
name: "{{ ceph_client_pkgs }}"
name: "{{ infra_pkgs }}"
state: present
register: result
until: result is succeeded
Expand Down
2 changes: 1 addition & 1 deletion cephadm-preflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@

- name: install prerequisites packages
package:
name: "{{ ceph_pkgs }}"
name: "{{ ceph_pkgs + infra_pkgs }}"
state: "{{ (upgrade_ceph_packages | bool) | ternary('latest', 'present') }}"
register: result
until: result is succeeded
Expand Down
7 changes: 5 additions & 2 deletions cephadm-purge-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
# You must define a group [admin] in your inventory with a node where
# the admin keyring is present at /etc/ceph/ceph.client.admin.keyring
#
# By default, only ceph_pkgs will be removed, infra_pkgs ones will remain installed.
# To uninstall an infra packages as well set infra_pkgs_purge with the packages to remove.
#
# Usage:
#
# ansible-playbook -i <inventory host file> cephadm-purge-cluster.yml -e fsid=<your fsid>
# ansible-playbook -i <inventory host file> cephadm-purge-cluster.yml -e fsid=<your fsid> -e infra_pkgs_purge=<infra packages to purge>


- name: check local prerequisites are in place
Expand Down Expand Up @@ -155,7 +158,7 @@

- name: remove ceph packages
package:
name: "{{ 'ceph-common' if group_names == [client_group] else ceph_pkgs | unique }}"
name: "{{ 'ceph-common' if group_names == [client_group] else (ceph_pkgs + infra_pkgs | intersect(infra_pkgs_purge | default([]))) | unique }}"
state: absent
register: result
until: result is succeeded

0 comments on commit cc83617

Please sign in to comment.