diff options
-rw-r--r-- | roles/etckeeper/defaults/main.yml | 3 | ||||
-rw-r--r-- | roles/etckeeper/tasks/main.yml | 26 |
2 files changed, 29 insertions, 0 deletions
diff --git a/roles/etckeeper/defaults/main.yml b/roles/etckeeper/defaults/main.yml index 077855f..176453c 100644 --- a/roles/etckeeper/defaults/main.yml +++ b/roles/etckeeper/defaults/main.yml @@ -1,2 +1,5 @@ git_name: Egor Tensin git_email: Egor.Tensin@gmail.com + +etckeeper_remote_name: origin +#etckeeper_remote_url: diff --git a/roles/etckeeper/tasks/main.yml b/roles/etckeeper/tasks/main.yml index f7d9427..6752f92 100644 --- a/roles/etckeeper/tasks/main.yml +++ b/roles/etckeeper/tasks/main.yml @@ -46,3 +46,29 @@ value: '1' - name: AVOID_COMMIT_BEFORE_INSTALL value: '1' + +- name: Configure repository remote + when: etckeeper_remote_url is defined + become: true + block: + - name: git remote add + ansible.builtin.command: + argv: + - git + - remote + - add + - '{{ etckeeper_remote_name }}' + - '{{ etckeeper_remote_url }}' + chdir: /etc + creates: '/etc/.git/refs/remotes/{{ etckeeper_remote_name }}/' + + - name: Configure pushes for etckeeper + community.general.ini_file: + path: /etc/etckeeper/etckeeper.conf + no_extra_spaces: true + owner: root + group: root + mode: '644' + section: null + option: PUSH_REMOTE + value: '{{ etckeeper_remote_name }}' |