etc-git: create gitignore files differently so that it stays idempotent
This commit is contained in:
parent
e1ae8fefb9
commit
490b733f1a
4
roles/etc-git/files/gitignore_etc
Normal file
4
roles/etc-git/files/gitignore_etc
Normal file
|
@ -0,0 +1,4 @@
|
|||
aliases.db
|
||||
*.swp
|
||||
random.seed
|
||||
openvpn/ipp.txt
|
0
roles/etc-git/files/gitignore_usr_share_scripts
Normal file
0
roles/etc-git/files/gitignore_usr_share_scripts
Normal file
|
@ -19,11 +19,6 @@
|
|||
- include: repository.yml
|
||||
vars:
|
||||
repository_path: "/etc"
|
||||
gitignore_items:
|
||||
- "aliases.db"
|
||||
- "*.swp"
|
||||
- "random.seed"
|
||||
- "openvpn/ipp.txt"
|
||||
|
||||
- name: verify /usr/share/scripts presence
|
||||
stat:
|
||||
|
@ -33,7 +28,6 @@
|
|||
- include: repository.yml
|
||||
vars:
|
||||
repository_path: "/usr/share/scripts"
|
||||
gitignore_items: []
|
||||
when:
|
||||
- _usr_share_scripts.stat.isdir
|
||||
|
||||
|
|
|
@ -29,21 +29,14 @@
|
|||
- etc-git
|
||||
|
||||
- name: "{{ repository_path }}/.gitignore is present"
|
||||
file:
|
||||
path: "{{ repository_path }}/.gitignore"
|
||||
copy:
|
||||
src: "gitignore{{ repository_path | replace('/','_') }}"
|
||||
dest: "{{ repository_path }}/.gitignore"
|
||||
owner: root
|
||||
mode: "0600"
|
||||
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
|
||||
|
||||
- name: Set vim as default editor
|
||||
git_config:
|
||||
name: core.editor
|
||||
|
|
Loading…
Reference in a new issue