Files
CHIEFSOFT\ameye ae89d7f9e1 ignore error
2025-08-08 22:57:49 -04:00

71 lines
2.3 KiB
YAML

---
- hosts: "{{ WHAT_HOST_IN_USE }}"
tasks:
- name: "002 Creates directory {{ DESTINATION_FOLDER }}"
ansible.builtin.file:
path: "{{ DESTINATION_FOLDER }}"
state: directory
mode: 0775
recurse: yes
- name: Copy file from 10.10.10.13 to LOCAL Directory
shell: sshpass -p '{{ password_variable }}' scp {{WHAT_PART_REMOTE}}/docker-compose.yml {{DESTINATION_FOLDER}}/docker-compose.yml
vars:
password_variable: "May12002!x" # Or, preferably, use Ansible Vault
- name: Docker Login to Registry
shell:
chdir: "{{DESTINATION_FOLDER}}/"
cmd: docker login -u="merms" -p="may12002!" registry.chiefsoft.com
- name: docker pull image 1
shell:
cmd: docker pull registry.chiefsoft.com/pweb/pweb-01-merms-pweb0001:latest
- name: docker pull image 2
shell:
cmd: docker pull registry.chiefsoft.com/pweb/pweb-01-merms-pweb0002:latest
- name: docker pull image3
shell:
cmd: docker pull registry.chiefsoft.com/pweb/pweb-01-merms-pweb0003:latest
- name: docker pull image4
shell:
cmd: docker pull registry.chiefsoft.com/pweb/pweb-01-merms-pweb0004:latest
- name: stop container is currently active
shell:
# cmd: docker ps -q --filter name='*{{CONTAINER_NAME}}*' | xargs docker stop
cmd: docker stop {{CONTAINER_NAME}}
ignore_errors: yes
- name: remove container is currently available
shell:
# cmd: docker ps -q --filter name='*{{CONTAINER_NAME}}*' | xargs docker rm
cmd: docker rm {{CONTAINER_NAME}}
ignore_errors: yes
- name: docker compose up
shell:
chdir: "{{DESTINATION_FOLDER}}/"
cmd: docker-compose up -d
- name: docker exec create log folder
shell:
cmd: docker exec -it {{CONTAINER_NAME}} mkdir -p /var/www/html/writable/logs
- name: docker exec create cache folder
shell:
cmd: docker exec -it {{CONTAINER_NAME}} mkdir -p /var/www/html/writable/cache
- name: docker exec permission log folder
shell:
cmd: docker exec -it {{CONTAINER_NAME}} chmod 0777 /var/www/html/writable/logs
- name: docker exec permission cache folder
shell:
cmd: docker exec -it {{CONTAINER_NAME}} chmod 0777 /var/www/html/writable/cache