49 lines
1.7 KiB
YAML
49 lines
1.7 KiB
YAML
- hosts: controller
|
|
# vars:
|
|
# become: true
|
|
gather_facts: true
|
|
vars:
|
|
user: staffadmin
|
|
token: 86839ba0ace61ed3b28ead9d76e89701b22aa90f
|
|
tasks:
|
|
|
|
- ansible.builtin.git:
|
|
repo: https://{{ user }}:{{ token }}@gitea.jingoh.fr/staffadmin/backup.git
|
|
dest: "{{ playbook_dir }}/backup"
|
|
single_branch: yes
|
|
# version: masterls
|
|
delegate_to: localhost
|
|
|
|
- ansible.builtin.fetch:
|
|
src: "{{ item }}"
|
|
dest: "{{ playbook_dir }}/backup/"
|
|
loop:
|
|
#! Docker-compose
|
|
- /opt/dockerapps/docker-compose.yml
|
|
#! Dex & traefik-forward
|
|
- /opt/dockerapps/appdata/dex/config.yml
|
|
- /opt/dockerapps/appdata/dex/traefik-auth-conf.env
|
|
#! Gitea & Runner
|
|
- /opt/dockerapps/appdata/gitea/gitea/gitea/conf/app.ini
|
|
- /opt/dockerapps/appdata/gitea/runner/config.yaml
|
|
#! Notification
|
|
- /opt/dockerapps/appdata/alertmanager/config/alertmanager.yml
|
|
#! Homepage
|
|
- /opt/dockerapps/appdata/homepage/homepage/bookmarks.yaml
|
|
- /opt/dockerapps/appdata/homepage/homepage/services.yaml
|
|
- /opt/dockerapps/appdata/homepage/homepage/settings.yaml
|
|
#! Semaphore
|
|
- /opt/dockerapps/appdata/semaphore/config/config.json
|
|
|
|
- name: Push backup to git
|
|
ansible.builtin.shell: |
|
|
git config user.email "stephane.gratiasquiquandon@gmail.com"
|
|
git config user.name "staffadmin"
|
|
git add .
|
|
git commit -m "Push Backup with access token"
|
|
git push https://{{ user }}:{{ token }}@gitea.jingoh.fr/staffadmin/backup.git
|
|
args:
|
|
chdir: "{{ playbook_dir }}/backup/"
|
|
run_once: true
|
|
delegate_to: localhost
|