Skip to content

Commit

Permalink
determine efimgr entry
Browse files Browse the repository at this point in the history
  • Loading branch information
kthare10 committed Sep 13, 2024
1 parent 214d16f commit 4855c68
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions fabric_am/playbooks/roles/head_switch_provisioning/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,12 @@
when: operation == 'config'

- name: Log in to Docker registry
docker_login:
username: "{{ docker_username }}"
password: "{{ docker_password }}"
shell: echo "{{ ansible_ssh_pass }}" | sudo -S docker login -u "{{ docker_username }}" -p "{{ docker_password }}"
no_log: true
when: operation == 'config'

- name: Pull private Docker image
docker_image:
name: "{{ docker_image }}"
source: pull
shell: echo "{{ ansible_ssh_pass }}" | sudo -S docker pull "{{ docker_image }}"
no_log: true
when: operation == 'config'

Expand All @@ -143,14 +139,20 @@
shell: echo "{{ ansible_ssh_pass }}" | sudo -S systemctl stop freerouter.service
when: operation == 'config'

- name: Check if freerouter service exists
command: systemctl status freerouter.service
register: freerouter_service_status
ignore_errors: true
when: operation == 'config'

# Disable the freerouter service
- name: Disable freerouter.service
shell: echo "{{ ansible_ssh_pass }}" | sudo -S systemctl disable freerouter.service
when: operation == 'config'
when: freerouter_service_status.rc == 0 and operation == 'config'

- name: Upload docker-compose.yml file to /root directory
copy:
src: /path/to/local/docker-compose.yml # Path to the file on your local machine
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
Expand Down

0 comments on commit 4855c68

Please sign in to comment.