Skip to content

Commit

Permalink
Merge pull request #41 from avinetworks/rc-20.1.4
Browse files Browse the repository at this point in the history
updating with 20.1.4 assets
  • Loading branch information
Chaitanya Deshpande authored Feb 15, 2021
2 parents 87b1ac4 + 89a9a9e commit 7e2cfb2
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 0 deletions.
12 changes: 12 additions & 0 deletions files/systemd/avihost.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=Avi Host Service

[Service]
TimeoutStartSec=0
Restart=always

ExecStart=/usr/sbin/avi_host_server.py
ExecStop=pkill -f avi_host_server.py

[Install]
WantedBy=multi-user.target
48 changes: 48 additions & 0 deletions tasks/docker/avihost.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
- block:
- name: Check Cpuset installed
command: cset --version
register: csetres
failed_when: csetres.rc > 0
changed_when: false
- name: Check Taskset installed
command: taskset --version
register: tsres
failed_when: tsres.rc > 0
changed_when: false
become: true
when: se_dp_isolation|bool

- name: Cleanup avihost service
service: name=avihost enabled=no state=stopped
become: true
ignore_errors: yes
when: se_dp_isolation|bool

- name: Copy Avi Host script to remote machine
copy:
src: "/opt/avi/scripts/avi_host_server.py"
dest: /usr/sbin/avi_host_server.py
mode: 0755
become: true
ignore_errors: yes

- name: systemd | Deploy the avihost service
copy:
src: "systemd/avihost.service"
dest: /etc/systemd/system/avihost.service
mode: 0644
become: true
ignore_errors: yes

- name: Avi Host | Services | systemd | Daemon reload
systemd: daemon_reload=yes name=avihost
become: true
ignore_errors: yes
when: se_dp_isolation|bool

- name: Avi Host | Services | Start the avihost service
service: name=avihost enabled=yes state=started
become: true
ignore_errors: yes
when: se_dp_isolation|bool
4 changes: 4 additions & 0 deletions tasks/docker/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
- name: Include disk checks
include: disk_checks.yml

- name: Include disk checks
include: avihost.yml
when: ansible_service_mgr == "systemd"

- block:
- name: Check if AVI SE is running in systemd
command: systemctl status avise
Expand Down
11 changes: 11 additions & 0 deletions tasks/docker/se_cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@
ignore_errors: yes
become: true

- block:
- name: Cleanup avihost service
service: name=avihost enabled=no state=stopped
- name: remove avihost server file
file: path=/usr/sbin/avi_host_server.py state=absent
- name: remove service file
file: path=/etc/systemd/system/avihost.service state=absent
when: ansible_service_mgr == "systemd" and se_action == "cleanup"
ignore_errors: yes
become: true

- block:
- name: Get list of running se containers
command: "{{ se_deploy_type }} ps -q -f name=avise"
Expand Down
12 changes: 12 additions & 0 deletions tasks/docker/se_start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@
when: se_docker_match.stdout|int != 1
become: true

- block:
- name: Enable Podman Socket
command: "systemctl enable io.podman.socket"
when: se_deploy_type == "podman"
become: true

- block:
- name: Start Podman Socket
command: "systemctl start io.podman.socket"
when: se_deploy_type == "podman"
become: true

- name: Avi SE | Install DPDK
include: dpdk.yml
when: se_dpdk
Expand Down
11 changes: 11 additions & 0 deletions tasks/docker/services/systemd/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,14 @@
notify:
- Avi SE | Services | systemd | Daemon reload
- Avi SE | Services | Restart the avise service

- name: restorecon avise SELinux context to systemd_unit_file_t
command: "restorecon /etc/systemd/system/avise.service -F"
register: result
failed_when: result.rc > 0
become: true
ignore_errors: yes

notify:
- Avi SE | Services | systemd | Daemon reload
- Avi SE | Services | Restart the avise service

0 comments on commit 7e2cfb2

Please sign in to comment.