etc-git: do not erase custom entries of servers in .gitignore files

dev
Jérémy Dubois 4 months ago
parent 534efdcc01
commit 8e3b4b35cd
  1. 1
      CHANGELOG
  2. 0
      roles/etc-git/files/gitignore
  3. 4
      roles/etc-git/files/gitignore_etc
  4. 6
      roles/etc-git/tasks/repositories.yml
  5. 11
      roles/etc-git/tasks/repository.yml

@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- evocheck: execute evocheck without --cron the first of the month
- etc-git: chmod 600 for local periodic files (daily, weekly, monthly)
- base: loop over fstab entries instead of copying the same task for each entries
- etc-git: do not erase custom entries of servers in .gitignore files
### Fixed

@ -1,4 +0,0 @@
aliases.db
*.swp
random.seed
openvpn/ipp.txt

@ -3,6 +3,11 @@
- include: repository.yml
vars:
repository_path: "/etc"
gitignore_items:
- "aliases.db"
- "*.swp"
- "random.seed"
- "openvpn/ipp.txt"
tags:
- etc-git
@ -16,6 +21,7 @@
- include: repository.yml
vars:
repository_path: "/usr/share/scripts"
gitignore_items: []
when:
- _usr_share_scripts.stat.exists
- _usr_share_scripts.stat.isdir

@ -30,10 +30,19 @@
- name: "{{ repository_path }}/.gitignore is present"
copy:
src: "gitignore{{ repository_path | replace('/','_') }}"
src: gitignore
dest: "{{ repository_path }}/.gitignore"
owner: root
mode: "0600"
force: no
tags:
- etc-git
- name: "Some entries MUST be in the {{ repository_path }}/.gitignore file"
lineinfile:
dest: "{{ repository_path }}/.gitignore"
line: "{{ item }}"
loop: "{{ gitignore_items | default([]) }}"
tags:
- etc-git

Loading…
Cancel
Save