Files
AnsibleTest/A000002.yml
T
CHIEFSOFT\ameye 7b8019de9c Added docker pull
2025-07-19 20:29:28 -04:00

50 lines
1.6 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 push registry.chiefsoft.com/pweb/pweb-01-merms-pweb0001:latest
- name: docker pull image 2
shell:
cmd: docker push registry.chiefsoft.com/pweb/pweb-01-merms-pweb0001:latest
- 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