From 6dcd84fd13897c73549b9d1006ceaad91708c5b5 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Fri, 18 Jul 2025 15:08:48 -0400 Subject: [PATCH] fix ansible templates --- A000001.yml | 31 --------------------------- A000002.yml | 31 --------------------------- A000003.yml | 22 ++------------------ A000004.yml | 24 +++------------------ A000005.yml | 22 ++------------------ BACK-UP-ZFILE.txt | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 60 insertions(+), 123 deletions(-) diff --git a/A000001.yml b/A000001.yml index fadbd00..577fbb5 100644 --- a/A000001.yml +++ b/A000001.yml @@ -9,42 +9,11 @@ mode: 0775 recurse: yes - # - name: Local Dicrectory for Docker Compose File - # ansible.builtin.file: - # # path: /home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}} - # path: /tmp/semaphore/repository_2_2/parts/{{ANSIBLE_TRANSPORT_PATH}} - # state: directory - # register: local_dir - # delegate_to: localhost - - # - name: INFO - Find out playbooks path - # shell: pwd - # register: playbook_path_output - # - debug: var=playbook_path_output.stdout - - # - name: Local Dicrectory for Docker Compose File ON LOCAL - # shell: mkdir parts/{{ANSIBLE_TRANSPORT_PATH}} - - # # - name: Copy file from 10.10.10.13 to Local Directory - # # shell: scp ~/.ssh/id_rsa.pub {{WHAT_PART_REMOTE}}/docker-compose.yml /home/semaphore/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml - # - name: - # shell: mkdir /home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}} - - # - name: Copy file from 10.10.10.13 to LOCAL Directory - # shell: sshpass -p '{{ password_variable }}' scp {{WHAT_PART_REMOTE}}/docker-compose.yml /home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml - # vars: - # password_variable: "May12002!x" # Or, preferably, use Ansible Vault - - 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: Set up docker-compose file - # template: - # src: "/home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml" - # dest: "{{DESTINATION_FOLDER}}" - - name: docker compose up shell: chdir: "{{DESTINATION_FOLDER}}/" diff --git a/A000002.yml b/A000002.yml index 32d7639..fe2ab67 100644 --- a/A000002.yml +++ b/A000002.yml @@ -9,42 +9,11 @@ mode: 0775 recurse: yes - # - name: Local Dicrectory for Docker Compose File - # ansible.builtin.file: - # # path: /home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}} - # path: /tmp/semaphore/repository_2_2/parts/{{ANSIBLE_TRANSPORT_PATH}} - # state: directory - # register: local_dir - # delegate_to: localhost - - # - name: INFO - Find out playbooks path - # shell: pwd - # register: playbook_path_output - # - debug: var=playbook_path_output.stdout - - # - name: Local Dicrectory for Docker Compose File ON LOCAL - # shell: mkdir parts/{{ANSIBLE_TRANSPORT_PATH}} - - # # - name: Copy file from 10.10.10.13 to Local Directory - # # shell: scp ~/.ssh/id_rsa.pub {{WHAT_PART_REMOTE}}/docker-compose.yml /home/semaphore/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml - # - name: - # shell: mkdir /home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}} - - # - name: Copy file from 10.10.10.13 to LOCAL Directory - # shell: sshpass -p '{{ password_variable }}' scp {{WHAT_PART_REMOTE}}/docker-compose.yml /home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml - # vars: - # password_variable: "May12002!x" # Or, preferably, use Ansible Vault - - 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: Set up docker-compose file - # template: - # src: "/home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml" - # dest: "{{DESTINATION_FOLDER}}" - - name: docker compose up shell: chdir: "{{DESTINATION_FOLDER}}/" diff --git a/A000003.yml b/A000003.yml index df35ad7..fdf942e 100644 --- a/A000003.yml +++ b/A000003.yml @@ -9,29 +9,11 @@ mode: 0775 recurse: yes - - name: Local Dicrectory for Docker Compose File - ansible.builtin.file: - path: /home/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}} - state: directory - register: local_dir - delegate_to: localhost - - # # - name: Copy file from 10.10.10.13 to Local Directory - # # shell: scp ~/.ssh/id_rsa.pub {{WHAT_PART_REMOTE}}/docker-compose.yml /home/semaphore/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml - # - name: - # shell: mkdir /home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}} - - - - name: Copy file from 10.10.10.13 to Local Directory - shell: sshpass -p '{{ password_variable }}' scp {{WHAT_PART_REMOTE}}/docker-compose.yml parts/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml + - 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: Set up docker-compose file - template: - src: "/home/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml" - dest: "{{DESTINATION_FOLDER}}" - - name: docker compose up shell: chdir: "{{DESTINATION_FOLDER}}/" diff --git a/A000004.yml b/A000004.yml index 7535ca7..95a6eb1 100644 --- a/A000004.yml +++ b/A000004.yml @@ -9,28 +9,10 @@ mode: 0775 recurse: yes - - name: Local Dicrectory for Docker Compose File - ansible.builtin.file: - path: /home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}} - state: directory - register: local_dir - delegate_to: localhost - - # # - name: Copy file from 10.10.10.13 to Local Directory - # # shell: scp ~/.ssh/id_rsa.pub {{WHAT_PART_REMOTE}}/docker-compose.yml /home/semaphore/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml - # - name: - # shell: mkdir /home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}} - - - - name: Copy file from 10.10.10.13 to Local Directory - shell: sshpass -p '{{ password_variable }}' scp {{WHAT_PART_REMOTE}}/docker-compose.yml parts/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml + - 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: Set up docker-compose file - template: - src: "/home/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml" - dest: "{{DESTINATION_FOLDER}}" + password_variable: "May12002!x" # Or, preferably, use Ansible Vault - name: docker compose up shell: diff --git a/A000005.yml b/A000005.yml index f01c5ad..d70714d 100644 --- a/A000005.yml +++ b/A000005.yml @@ -9,29 +9,11 @@ mode: 0775 recurse: yes - - name: Local Dicrectory for Docker Compose File - ansible.builtin.file: - path: /home/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}} - state: directory - register: local_dir - delegate_to: localhost - - # # - name: Copy file from 10.10.10.13 to Local Directory - # # shell: scp ~/.ssh/id_rsa.pub {{WHAT_PART_REMOTE}}/docker-compose.yml /home/semaphore/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml - # - name: - # shell: mkdir /home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}} - - - - name: Copy file from 10.10.10.13 to Local Directory - shell: sshpass -p '{{ password_variable }}' scp {{WHAT_PART_REMOTE}}/docker-compose.yml parts/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml + - 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: Set up docker-compose file - template: - src: "/home/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml" - dest: "{{DESTINATION_FOLDER}}" - - name: docker compose up shell: chdir: "{{DESTINATION_FOLDER}}/" diff --git a/BACK-UP-ZFILE.txt b/BACK-UP-ZFILE.txt index 19ea01f..053f077 100644 --- a/BACK-UP-ZFILE.txt +++ b/BACK-UP-ZFILE.txt @@ -110,6 +110,59 @@ # dest: "{{DESTINATION_FOLDER}}" + - name: docker compose up + shell: + chdir: "{{DESTINATION_FOLDER}}/" + cmd: docker-compose up -d + + +--- +- 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: Local Dicrectory for Docker Compose File + # ansible.builtin.file: + # # path: /home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}} + # path: /tmp/semaphore/repository_2_2/parts/{{ANSIBLE_TRANSPORT_PATH}} + # state: directory + # register: local_dir + # delegate_to: localhost + + # - name: INFO - Find out playbooks path + # shell: pwd + # register: playbook_path_output + # - debug: var=playbook_path_output.stdout + + # - name: Local Dicrectory for Docker Compose File ON LOCAL + # shell: mkdir parts/{{ANSIBLE_TRANSPORT_PATH}} + + # # - name: Copy file from 10.10.10.13 to Local Directory + # # shell: scp ~/.ssh/id_rsa.pub {{WHAT_PART_REMOTE}}/docker-compose.yml /home/semaphore/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml + # - name: + # shell: mkdir /home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}} + + # - name: Copy file from 10.10.10.13 to LOCAL Directory + # shell: sshpass -p '{{ password_variable }}' scp {{WHAT_PART_REMOTE}}/docker-compose.yml /home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml + # vars: + # password_variable: "May12002!x" # Or, preferably, use Ansible Vault + + - 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: Set up docker-compose file + # template: + # src: "/home/chiefsoft/semaphore/parts/{{ANSIBLE_TRANSPORT_PATH}}/docker-compose.yml" + # dest: "{{DESTINATION_FOLDER}}" + - name: docker compose up shell: chdir: "{{DESTINATION_FOLDER}}/"