ansible-ovs-ovn/tasks/ubuntu20.yml

87 lines
2.3 KiB
YAML

- name: set ovsdb_server_md5_value fact
set_fact:
ovsdb_server_md5_value: "2183d20b8df5b5cb790aa238f6e1432e"
- name: set ovn_nbctl_md5_value fact
set_fact:
ovn_nbctl_md5_value: "6007bc53bf30b8d4b4c0fab039ee576b"
- 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 }}"
when: ovsdb_server_exists.stat.exists
- name: "Set fact to true if the source file does not exist"
set_fact:
force_new_ovs_download: True
when: not ovsdb_server_exists.stat.exists
- name: Debug out force_new_ovs_download
debug: msg="Installing OpenVSwitch"
when: force_new_ovs_download
- name: Debug out force_new_ovs_download
debug: msg="NOT Installing OpenVSwitch, MD5 sum matches"
when: not force_new_ovs_download
- name: "Copy OpenVSwitch packages"
copy:
src: "ubuntu20/{{ item }}"
dest: "/tmp/{{ item }}"
with_items:
- libopenvswitch_2.14.0-1_amd64.deb
- openvswitch-common_2.14.0-1_amd64.deb
- openvswitch-switch_2.14.0-1_amd64.deb
when: force_new_ovs_download
- name: "Install OpenVSwitch packages"
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"
when: force_new_ovs_download
- 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 }}"
when: ovn_nbctl_exists.stat.exists and use_ovn
#- 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
when: not ovn_nbctl_exists.stat.exists and use_ovn
- debug: msg="Installing OVN"
when: force_new_ovn_download and use_ovn
- debug: msg="NOT Installing OVN, MD5 sum matches"
when: not force_new_ovn_download and use_ovn
- name: "Copy OVN packages"
copy:
src: "ubuntu20/{{ item }}"
dest: "/tmp/{{ item }}"
with_items:
- ovn_20.06.0-1_amd64.deb
when: force_new_ovn_download and use_ovn
- name: "Install OVN packages"
apt:
deb: "{{ item }}"
with_items:
- "/tmp/ovn_20.06.0-1_amd64.deb"
when: force_new_ovn_download and use_ovn