ansible-ovs-ovn/tasks/main.yml

95 lines
2.5 KiB
YAML
Raw Normal View History

2020-11-30 00:43:21 +00:00
#OVS Version 2.13.0 \ Ubuntu 18
#ovsdb_server_md5_value: "f0a820cb40824c3a9f87f57644037d64"
#OVN Version 20.06.0 \ Ubuntu 18
#ovn_nbctl_md5_value: "4310864bd9676925a49909013071cbec"
#OVS Version 2.14.0 \ Ubuntu 18
#ovsdb_server_md5_value: "ffd9ba2a6b3da6108d7eb97c70e51761"
#OVN Version 20.09.0 \ Ubuntu 18
#ovn_nbctl_md5_value: "031e770fd969617c221b156726c2f1dc"
#OVS Version 2.14.0 \ Ubuntu 20
#ovsdb_server_md5_value: "2183d20b8df5b5cb790aa238f6e1432e"
#OVN Version 20.09.0 \ Ubuntu 20
#ovn_nbctl_md5_value: "6007bc53bf30b8d4b4c0fab039ee576b"
2020-07-30 07:38:37 +00:00
- name: "Checking presense of OpenVsitch and comparing MD5 hash value"
stat:
path: /usr/sbin/ovsdb-server
checksum_algorithm: md5
register: ovsdb_server_exists
# This will ensure that all OpenvSwitch binaries are running the desired version, based on the MD5 value stored in the variables file
# When releasing a new version of ovs, update this md5 an update the copy and install tasks below
- name: "Set fact to False"
set_fact:
force_new_ovs_download: False
2020-11-30 00:43:21 +00:00
- name: "Checking presense of OVN and comparing MD5 hash value"
stat:
path: /usr/bin/ovn-nbctl
checksum_algorithm: md5
register: ovn_nbctl_exists
2020-07-30 07:38:37 +00:00
2020-11-30 00:43:21 +00:00
# This will ensure that all OVN binaries are running the desired version, based on the MD5 value stored in the variables file
# When releasing a new version of OVN, update this md5 an update the copy and install tasks below
2020-07-30 07:38:37 +00:00
2020-11-30 00:43:21 +00:00
- name: "Set fact to False"
2020-07-30 07:38:37 +00:00
set_fact:
2020-11-30 00:43:21 +00:00
force_new_ovn_download: False
2020-07-30 07:38:37 +00:00
2020-11-30 00:43:21 +00:00
- name: Include tasks based on OS being Ubuntu 18
include_tasks: ubuntu18.yml
when:
- ansible_distribution_major_version=="18"
- ansible_distribution == "Ubuntu"
tags: ceph
2020-07-30 07:38:37 +00:00
2020-11-30 00:43:21 +00:00
- name: Include tasks based on OS being Ubuntu 20
include_tasks: ubuntu20.yml
when:
- ansible_distribution_major_version=="20"
- ansible_distribution == "Ubuntu"
tags: ceph
2020-07-30 07:38:37 +00:00
#Install the custom service to start OVS and OVN as required
- name: "Copy /usr/sbin/ovsovn-service-manager.sh file"
template:
src: ovsovn-service-manager.sh.j2
dest: "/usr/sbin/ovsovn-service-manager.sh"
mode: +x
notify:
- restart ovsovn.service
tags: service
- name: "Configure ovsovn.service"
action: template src=files/ovsovn.service dest=/etc/systemd/system/ovsovn.service backup=no
notify:
- restart ovsovn.service
tags: service
- name: "Reload systemctl then enable & start ovsovn service"
systemd:
state: started
enabled: True
daemon_reload: yes
name: ovsovn.service
tags: service