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