Skip to content

Commit

Permalink
common: Ignore pve files with etckeeper
Browse files Browse the repository at this point in the history
  • Loading branch information
jocelynj committed Oct 14, 2023
1 parent 76c5e63 commit d13dd5e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,31 @@
validate: 'visudo -cf %s'
when: users_root is defined or group_users_root is defined

- name: Configure .gitignore for etckeeper
blockinfile:
path: /etc/.gitignore
block: |
pve/.clusterlog
pve/.rrd
pve/.vmlist
pve/authkey.pub
pve/local
pve/lxc
pve/nodes/*/lrm_status
pve/openvz
pve/priv/authkey.key
pve/qemu-server
when: "'proxmox' in group_names"
register: gitignore_status

- name: Remove new gitignore items from tracking
shell: |
git rm -r --quiet --cached `git ls-files -i -c --exclude-from=.gitignore`
git add .gitignore
git commit -m "Cleanup git-ignore files"
args:
chdir: /etc/
when: "'proxmox' in group_names and gitignore_status.changed"

- name: Check if user backuppc exists
action: shell /usr/bin/getent passwd backuppc
Expand Down

0 comments on commit d13dd5e

Please sign in to comment.