Skip to content

Commit

Permalink
new podnodeselector plugin configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
titansmc authored and Josep Manel Andres Moscardo committed Oct 31, 2023
1 parent 5f9a7b9 commit 44fdf16
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 14 additions & 4 deletions roles/etcd/handlers/backup_cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
- name: Cleanup etcd backups
command: /bin/true
notify:
- Find old etcd backups
- Remove old etcd backups

- name: Find old etcd backups
ansible.builtin.find:
file_type: directory
recurse: false
paths: "{{ etcd_backup_prefix }}"
patterns: "etcd-*"
register: _etcd_backups
when: etcd_backup_retention_count >= 0

- name: Remove old etcd backups
shell:
chdir: "{{ etcd_backup_prefix }}"
cmd: "set -o pipefail && find . -name 'etcd-*' -type d | sort -n | head -n -{{ etcd_backup_retention_count }} | xargs rm -rf"
executable: /bin/bash
ansible.builtin.file:
state: absent
path: "{{ item }}"
loop: "{{ (_etcd_backups.files | sort(attribute='ctime', reverse=True))[etcd_backup_retention_count:] | map(attribute='path') }}"
when: etcd_backup_retention_count >= 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
podNodeSelectorPluginConfig:
clusterDefaultNodeSelector: {{ kube_apiserver_admission_plugins_podnodeselector_default_node_selector }}

0 comments on commit 44fdf16

Please sign in to comment.