Skip to content

Commit

Permalink
fix controller deployment via working servvice file
Browse files Browse the repository at this point in the history
  • Loading branch information
sabandi committed Apr 9, 2021
1 parent b7fe99f commit 114e523
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 28 deletions.
1 change: 0 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ con_image: "avinetworks/controller:{{ con_version }}"

# docker deployment parameters
con_force_deploy: false
con_new_service: false
con_fresh_install: false
con_controller_ip: "{{ ansible_default_ipv4.address }}"
con_cores: "{{ ansible_processor_cores * ansible_processor_count }}"
Expand Down
4 changes: 0 additions & 4 deletions tasks/docker/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@
when: con_docker_repo != None
when: not con_package_deploy

- name: Avi Controller | Set service facts for deploy
set_fact:
con_new_service: "{{ con_version is version_compare('19.1.1', '>=') }}"

- name: Avi Controller | Docker | Cleanup
include: services/cleanup.yml

Expand Down
15 changes: 3 additions & 12 deletions tasks/docker/services/install.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
---
- block:
- name: Avi Controller | Services | systemd | Install the Avi Controller service
include: "systemd/install.yml"
when: ansible_service_mgr == "systemd"
when: not con_new_service
- name: Avi Controller | Services | systemd | Install the Avi Controller service
include: "systemd/install.yml"
when: ansible_service_mgr == "systemd"

- block:
- name: Avi Controller | Services | Install the Avi Controller service file | New
template: src=avicontroller.j2 dest=/usr/sbin/avicontroller mode=0755
notify: Avi Controller | Services | Restart the avicontroller service
- name: Avi Controller | Services | {{ ansible_service_mgr }} | Install the Avi Controller service | New
include: "{{ ansible_service_mgr }}/install.yml"
when: con_new_service

- name: Avi Controller | Services | {{ ansible_service_mgr }} | Start the service since it's not running |
service: name=avicontroller enabled=yes state=started
Expand Down
11 changes: 0 additions & 11 deletions tasks/docker/services/systemd/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,4 @@
notify:
- Avi Controller | Services | systemd | Daemon reload
- Avi Controller | Services | Restart the avicontroller service
when: not con_new_service

- name: Avi Controller | Services | systemd | Deploy the avicontroller service | New Service
copy:
src: systemd/avicontroller.service
dest: /etc/systemd/system/avicontroller.service
mode: 0644
register: avicontroller_service
notify:
- Avi Controller | Services | systemd | Daemon reload
- Avi Controller | Services | Restart the avicontroller service
when: con_new_service

0 comments on commit 114e523

Please sign in to comment.