[backup]
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
gather_facts: false
|
||||
vars:
|
||||
user: sgratias
|
||||
user_mail: stephane.gratiasquiquandon@gmail.com
|
||||
token: !vault |
|
||||
$ANSIBLE_VAULT;1.2;AES256;prod
|
||||
30383538646164373137616166636632353964373362323735626239656337306139616265323138
|
||||
@@ -25,7 +26,7 @@
|
||||
# msg: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=apps/data/postgres token=prout url=https://hash.jingoh.fr') }}"
|
||||
|
||||
- ansible.builtin.git:
|
||||
repo: https://{{ user }}:{{ token }}@gitea.jingoh.fr/sgratias/backup.git
|
||||
repo: https://{{ user }}:{{ token }}@gitea.jingoh.fr/{{ user }}/backup.git
|
||||
dest: "{{ playbook_dir }}/backup"
|
||||
single_branch: yes
|
||||
force: true
|
||||
@@ -95,11 +96,11 @@
|
||||
|
||||
- name: Push backup to git
|
||||
ansible.builtin.shell: |
|
||||
git config user.email "stephane.gratiasquiquandon@gmail.com"
|
||||
git config user.name "sgratias"
|
||||
git config user.email "{{ user_mail }}"
|
||||
git config user.name "{{ user }}"
|
||||
git add .
|
||||
git commit -m "Push Backup with access token"
|
||||
git push https://{{ user }}:{{ token }}@gitea.jingoh.fr/sgratias/backup.git
|
||||
git push https://{{ user }}:{{ token }}@gitea.jingoh.fr/{{ user }}/backup.git
|
||||
args:
|
||||
chdir: "{{ playbook_dir }}/backup/"
|
||||
run_once: true
|
||||
|
||||
Reference in New Issue
Block a user