2021-03-05 01:36:53 +00:00
|
|
|
- name: set ovsdb_server_md5_value fact
|
|
|
|
set_fact:
|
2020-11-30 13:47:20 +00:00
|
|
|
ovsdb_server_md5_value: "2183d20b8df5b5cb790aa238f6e1432e"
|
2020-11-30 14:01:42 +00:00
|
|
|
|
2021-03-05 01:36:53 +00:00
|
|
|
- name: set ovn_nbctl_md5_value fact
|
|
|
|
set_fact:
|
2020-11-30 13:47:20 +00:00
|
|
|
ovn_nbctl_md5_value: "6007bc53bf30b8d4b4c0fab039ee576b"
|
2020-11-30 00:43:21 +00:00
|
|
|
|
|
|
|
- name: "Set fact to true if the source file exists but the MD5 sum does not match"
|
|
|
|
set_fact:
|
|
|
|
force_new_ovs_download: "{{ ovsdb_server_exists.stat.checksum != ovsdb_server_md5_value }}"
|
2021-03-05 01:36:53 +00:00
|
|
|
when: ovsdb_server_exists.stat.exists
|
2020-11-30 00:43:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
- name: "Set fact to true if the source file does not exist"
|
|
|
|
set_fact:
|
|
|
|
force_new_ovs_download: True
|
2021-03-05 01:36:53 +00:00
|
|
|
when: not ovsdb_server_exists.stat.exists
|
2020-11-30 00:43:21 +00:00
|
|
|
|
2021-03-05 01:36:53 +00:00
|
|
|
- name: Debug out force_new_ovs_download
|
|
|
|
debug: msg="Installing OpenVSwitch"
|
|
|
|
when: force_new_ovs_download
|
2020-11-30 00:43:21 +00:00
|
|
|
|
2021-03-05 01:36:53 +00:00
|
|
|
- name: Debug out force_new_ovs_download
|
|
|
|
debug: msg="NOT Installing OpenVSwitch, MD5 sum matches"
|
|
|
|
when: not force_new_ovs_download
|
2020-11-30 00:43:21 +00:00
|
|
|
|
2021-03-08 00:32:15 +00:00
|
|
|
- name: "Copy OpenVSwitch packages"
|
2020-11-30 00:43:21 +00:00
|
|
|
copy:
|
2021-03-05 01:36:53 +00:00
|
|
|
src: "ubuntu20/{{ item }}"
|
|
|
|
dest: "/tmp/{{ item }}"
|
2020-11-30 00:43:21 +00:00
|
|
|
with_items:
|
2020-11-30 14:01:42 +00:00
|
|
|
- libopenvswitch_2.14.0-1_amd64.deb
|
|
|
|
- openvswitch-common_2.14.0-1_amd64.deb
|
|
|
|
- openvswitch-switch_2.14.0-1_amd64.deb
|
2021-03-05 01:36:53 +00:00
|
|
|
when: force_new_ovs_download
|
2020-11-30 00:43:21 +00:00
|
|
|
|
2021-03-08 00:32:15 +00:00
|
|
|
- name: "Install OpenVSwitch packages"
|
2020-11-30 00:43:21 +00:00
|
|
|
apt:
|
|
|
|
deb: "{{ item }}"
|
|
|
|
with_items:
|
|
|
|
- "/tmp/libopenvswitch_2.14.0-1_amd64.deb"
|
|
|
|
- "/tmp/openvswitch-common_2.14.0-1_amd64.deb"
|
|
|
|
- "/tmp/openvswitch-switch_2.14.0-1_amd64.deb"
|
2021-03-05 01:36:53 +00:00
|
|
|
when: force_new_ovs_download
|
2020-11-30 00:43:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: "Set fact to true if the source file exists but the MD5 sum does not match"
|
|
|
|
set_fact:
|
|
|
|
force_new_ovn_download: "{{ ovn_nbctl_exists.stat.checksum != ovn_nbctl_md5_value }}"
|
2021-03-05 01:36:53 +00:00
|
|
|
when: ovn_nbctl_exists.stat.exists and use_ovn
|
2020-11-30 00:43:21 +00:00
|
|
|
|
|
|
|
#- debug: msg={{ovn_nbctl_md5_value}}
|
|
|
|
#- debug: msg={{ovn_nbctl_exists}}
|
|
|
|
|
|
|
|
- name: "Set fact to true if the source file does not exist"
|
|
|
|
set_fact:
|
|
|
|
force_new_ovn_download: True
|
2021-03-05 01:36:53 +00:00
|
|
|
when: not ovn_nbctl_exists.stat.exists and use_ovn
|
2020-11-30 00:43:21 +00:00
|
|
|
|
|
|
|
- debug: msg="Installing OVN"
|
2021-03-05 01:36:53 +00:00
|
|
|
when: force_new_ovn_download and use_ovn
|
2020-11-30 00:43:21 +00:00
|
|
|
|
|
|
|
- debug: msg="NOT Installing OVN, MD5 sum matches"
|
2021-03-05 01:36:53 +00:00
|
|
|
when: not force_new_ovn_download and use_ovn
|
2020-11-30 00:43:21 +00:00
|
|
|
|
2021-03-08 00:32:15 +00:00
|
|
|
- name: "Copy OVN packages"
|
2020-11-30 00:43:21 +00:00
|
|
|
copy:
|
2021-03-05 01:36:53 +00:00
|
|
|
src: "ubuntu20/{{ item }}"
|
|
|
|
dest: "/tmp/{{ item }}"
|
2020-11-30 00:43:21 +00:00
|
|
|
with_items:
|
2020-11-30 14:01:42 +00:00
|
|
|
- ovn_20.06.0-1_amd64.deb
|
2021-03-05 01:36:53 +00:00
|
|
|
when: force_new_ovn_download and use_ovn
|
2020-11-30 00:43:21 +00:00
|
|
|
|
2021-03-08 00:32:15 +00:00
|
|
|
- name: "Install OVN packages"
|
2020-11-30 00:43:21 +00:00
|
|
|
apt:
|
|
|
|
deb: "{{ item }}"
|
|
|
|
with_items:
|
|
|
|
- "/tmp/ovn_20.06.0-1_amd64.deb"
|
2021-03-05 01:36:53 +00:00
|
|
|
when: force_new_ovn_download and use_ovn
|