Update hardening and add backup playbook
This commit is contained in:
50
backup.yml
Normal file
50
backup.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
- hosts: controller
|
||||
# vars:
|
||||
# become: true
|
||||
gather_facts: true
|
||||
vars:
|
||||
user: staffadmin
|
||||
token: 86839ba0ace61ed3b28ead9d76e89701b22aa90f
|
||||
tasks:
|
||||
|
||||
- name: Example clone of a single branch
|
||||
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
|
||||
|
||||
- name: Specifying a path directly
|
||||
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: Specifying a path directly
|
||||
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
|
||||
Reference in New Issue
Block a user