|
|
|
@ -30,6 +30,40 @@
|
|
|
|
|
- name: "etckeeper: Initialize"
|
|
|
|
|
command: etckeeper init creates=/etc/.git/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: "check git user.name"
|
|
|
|
|
command: git config user.name
|
|
|
|
|
args:
|
|
|
|
|
chdir: /etc
|
|
|
|
|
warn: off
|
|
|
|
|
register: name_configured
|
|
|
|
|
ignore_errors: True
|
|
|
|
|
changed_when: False
|
|
|
|
|
|
|
|
|
|
- name: "configure git user.name"
|
|
|
|
|
command: git config user.name "{{etckeeper_user_name}}"
|
|
|
|
|
args:
|
|
|
|
|
chdir: /etc
|
|
|
|
|
warn: off
|
|
|
|
|
when: name_configured.stdout != "{{etckeeper_user_name}}"
|
|
|
|
|
|
|
|
|
|
- name: "check git user.email"
|
|
|
|
|
command: git config user.email
|
|
|
|
|
args:
|
|
|
|
|
chdir: /etc
|
|
|
|
|
warn: off
|
|
|
|
|
register: email_configured
|
|
|
|
|
ignore_errors: True
|
|
|
|
|
changed_when: False
|
|
|
|
|
|
|
|
|
|
- name: "configure git user.email"
|
|
|
|
|
command: git config user.email "{{etckeeper_user_email}}"
|
|
|
|
|
args:
|
|
|
|
|
chdir: /etc
|
|
|
|
|
warn: off
|
|
|
|
|
when: email_configured.stdout != "{{etckeeper_user_email}}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: enable etckeeper commit mails
|
|
|
|
|
template: src=post-commit-mail.j2
|
|
|
|
|
dest=/etc/.git/hooks/post-commit
|
|
|
|
|