Files
AnsibleTest/A000003.yml
T
CHIEFSOFT\ameye 671636f3bb fis file
2025-07-16 19:30:06 -04:00

50 lines
1.7 KiB
YAML

---
- hosts: "{{ WHAT_HOST_IN_USE }}"
become: true
tasks:
- name: "Creates directory {{ DESTINATION_FOLDER }}"
ansible.builtin.file:
path: "{{ DESTINATION_FOLDER }}"
state: directory
mode: 0775
recurse: yes
- name: "Creates local directory for composer {{ ANSIBLE_TRANSPORT_PATH }}"
ansible.builtin.file:
path: "/home/semaphore/parts/{{ ANSIBLE_TRANSPORT_PATH }}"
state: directory
mode: 0775
recurse: yes
# - name: Copy file from machine1 to machine2
# shell: sshpass -p '{{ RSYNC_PASSWORD }}' scp {{WHAT_PART_REMOTE}}/docker-compose.yml /home/semaphore/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml
- name: Copy composers file locally up docker-compose file
delegate_to: localhost
environment:
RSYNC_PASSWORD: "{{ RSYNC_PASSWORD }}"
synchronize:
src: "rsync://{{WHAT_PART_REMOTE}}/docker-compose.yml"
dest: "/home/semaphore/{{ANSIBLE_TRANSPORT_PATH}}"
tags: download,local
- name: Set up remote docker-compose file
template:
src: "rsync://{{WHAT_PART_REMOTE}}/docker-compose.yml"
dest: "{{DESTINATION_FOLDER}}"
remote_src: true
- name: Set up docker-compose file
template:
src: "/home/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml"
dest: "{{DESTINATION_FOLDER}}"
# template:
# src: "{{WHAT_PART_REMOTE}}/docker-compose.yml"
# dest: "{{DESTINATION_FOLDER}}"
- name: docker compose up
shell:
chdir: "{{DESTINATION_FOLDER}}/"
cmd: docker-compose up -d