This repository has been archived on 2026-03-22. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
kube_build/playbooks/redeploy.yml
T
2023-12-12 10:19:03 -05:00

36 lines
1.2 KiB
YAML

- name: Rebuild OCI Stack
hosts: Docker
tasks:
- name: Create folder
ansible.builtin.file:
path: ~/OCI_Build/docker
state: directory
mode: '0755'
- name: Pull backups
shell: |
unset HISTFILE
export RESTIC_REPOSITORY="s3:idnfqwbge7v2.compat.objectstorage.us-ashburn-1.oraclecloud.com/madereddy-docker-backup"
export AWS_ACCESS_KEY_ID="5195c76754bda8137f89f7141e2915f203eeeae8"
export AWS_SECRET_ACCESS_KEY="PYWvfbsdu6ZFrtTZBBhnWVXmWCp40/cRI/C3yphVOHI="
export RESTIC_PASSWORD=ei\&SNrq\!7t^Zqkc2#^H6DYvR5^X32HGnUUnd#n
cd ~/OCI_Build/docker
restic restore latest:/source/gcloud --target ./
- name: Start container using Docker Compose
ansible.builtin.command:
cmd: docker compose up -d
chdir: ~/OCI_Build/docker
ignore_errors: yes
- name: Pause for 30 seconds to allow containers to stabilize
ansible.builtin.pause:
seconds: 30
- name: Check container status
ansible.builtin.shell: docker compose ps -q | xargs -n1 docker container inspect --format '{{ "{{" }} .State.Running {{ "}}" }}'
args:
chdir: ~/OCI_Build/docker
register: container_status
ignore_errors: yes