blob: a9eb4098910a5351254618c704380ef8f04c6b81 (
plain) (
tree)
|
|
- name: Get list of modified files
become: true
ansible.builtin.shell: |
set -o pipefail && \
git status --porcelain=v1 \
| cut -c 4- \
| grep -G -v '^etckeeper/etckeeper.conf'
args:
chdir: /etc
register: etckeeper_modified_files
changed_when: false
failed_when: etckeeper_modified_files.rc not in [0, 1]
- name: Fail if unexpected files were modified
ansible.builtin.fail:
msg: |
Unexpected files were modified:
{{ etckeeper_modified_files.stdout }}
when: etckeeper_modified_files.rc == 0
- name: etckeeper commit
become: true
ansible.builtin.command: |
etckeeper commit 'configure etckeeper'
|