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
|
- include: repository.yml
|
||||||
vars:
|
vars:
|
||||||
repository_path: "/etc"
|
repository_path: "/etc"
|
||||||
gitignore_items:
|
|
||||||
- "aliases.db"
|
|
||||||
- "*.swp"
|
|
||||||
- "random.seed"
|
|
||||||
- "openvpn/ipp.txt"
|
|
||||||
|
|
||||||
- name: verify /usr/share/scripts presence
|
- name: verify /usr/share/scripts presence
|
||||||
stat:
|
stat:
|
||||||
|
@ -33,7 +28,6 @@
|
||||||
- include: repository.yml
|
- include: repository.yml
|
||||||
vars:
|
vars:
|
||||||
repository_path: "/usr/share/scripts"
|
repository_path: "/usr/share/scripts"
|
||||||
gitignore_items: []
|
|
||||||
when:
|
when:
|
||||||
- _usr_share_scripts.stat.isdir
|
- _usr_share_scripts.stat.isdir
|
||||||
|
|
||||||
|
|
|
@ -29,21 +29,14 @@
|
||||||
- etc-git
|
- etc-git
|
||||||
|
|
||||||
- name: "{{ repository_path }}/.gitignore is present"
|
- name: "{{ repository_path }}/.gitignore is present"
|
||||||
file:
|
copy:
|
||||||
path: "{{ repository_path }}/.gitignore"
|
src: "gitignore{{ repository_path | replace('/','_') }}"
|
||||||
|
dest: "{{ repository_path }}/.gitignore"
|
||||||
owner: root
|
owner: root
|
||||||
mode: "0600"
|
mode: "0600"
|
||||||
tags:
|
tags:
|
||||||
- etc-git
|
- 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
|
- name: Set vim as default editor
|
||||||
git_config:
|
git_config:
|
||||||
name: core.editor
|
name: core.editor
|
||||||
|
|
Loading…
Reference in a new issue