56 lines
2.2 KiB
YAML
56 lines
2.2 KiB
YAML
- hosts: controller
|
|
# vars:
|
|
# become: true
|
|
gather_facts: true
|
|
vars:
|
|
user: staffadmin
|
|
token: !vault |
|
|
$ANSIBLE_VAULT;1.2;AES256;prod
|
|
35343365393734313034383961616333633265623037303436653739613935366666373237366562
|
|
3663316563663439363333396530376139663731346637390a366335333732303134316364363130
|
|
30313631343534643866383336623837363433303032376264373139306464313866313034663636
|
|
3961303030373531380a343061326437343066663665613833623533376437326630326432363566
|
|
37653135666331633532653436656461396131623736353962643632316135633562346631313036
|
|
6137356332636431643830666461333862613835336631333037
|
|
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
|