Skip to content

Commit

Permalink
change location of docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
kthare10 committed Dec 13, 2024
1 parent 95ad7c9 commit e4da250
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions fabric_am/playbooks/roles/head_switch_provisioning/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,6 @@
shell: systemctl disable freerouter.service
when: operation == 'config' and freerouter_service_check.rc == 0

- name: Upload docker-compose.yml file to /root directory
copy:
src: ./docker-compose.yml # Path to the file on your local machine
dest: /root/docker-compose.yml # Destination path in the /root directory on the target machine
owner: root
group: root
mode: '0644'
when: operation == 'config'

#- name: Reboot the system after installing Docker
# shell: reboot
# ignore_errors: true
Expand Down Expand Up @@ -200,10 +191,19 @@
append: yes
when: operation == 'config'

- name: Upload docker-compose.yml file
copy:
src: ./docker-compose.yml # Path to the file on your local machine
dest: "/home/{{ new_user }}/docker-compose.yml" # Destination path in the /home/fabric directory on the target machine
owner: "{{ new_user }}"
group: "{{ new_user }}"
mode: '0644'
when: operation == 'config'

- name: Bring up Docker containers in detached mode
shell: docker compose up -d
args:
chdir: /root/ # Directory with docker-compose.yml
chdir: "/home/{{ new_user }}/" # Directory with docker-compose.yml
when: operation == 'post-reboot'

- name: Wait for 10 seconds
Expand All @@ -214,7 +214,7 @@
- name: Restart the Docker container
shell: docker compose restart
args:
chdir: /root/ # Directory with docker-compose.yml
chdir: "/home/{{ new_user }}/" # Directory with docker-compose.yml
when: operation == 'post-reboot'

- name: Remove SSH key from authorized_keys
Expand Down

0 comments on commit e4da250

Please sign in to comment.