ansible-ovs-ovn/tasks/ubuntu18.yml

88 lines
2.2 KiB
YAML
Raw Normal View History

2020-11-30 13:50:09 +00:00
- set_fact:
ovsdb_server_md5_value: "ffd9ba2a6b3da6108d7eb97c70e51761"
- set_fact:
ovn_nbctl_md5_value: "031e770fd969617c221b156726c2f1dc"
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 }}"
when: ovsdb_server_exists.stat.exists == True
- name: "Set fact to true if the source file does not exist"
set_fact:
force_new_ovs_download: True
when: ovsdb_server_exists.stat.exists == False
- debug: msg="Installing OpenVSwitch"
when: force_new_ovs_download == True
- debug: msg="NOT Installing OpenVSwitch, MD5 sum matches"
when: force_new_ovs_download == False
- name: "Copy OVN binaries"
copy:
2020-12-02 05:33:17 +00:00
src: "ubuntu18/{{item}}"
2020-11-30 00:43:21 +00:00
dest: "/tmp/{{item}}"
with_items:
2020-12-02 05:35:50 +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
2020-11-30 00:43:21 +00:00
when: force_new_ovs_download == True
- name: "Install packages"
apt:
deb: "{{ item }}"
with_items:
2020-12-02 05:35:50 +00:00
- "/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"
2020-11-30 00:43:21 +00:00
when: force_new_ovs_download == True
- 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 == True
#- 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: ovn_nbctl_exists.stat.exists == False
- debug: msg="Installing OVN"
when: force_new_ovn_download == True
- debug: msg="NOT Installing OVN, MD5 sum matches"
when: force_new_ovn_download == False
- name: "Copy OVN binaries"
copy:
2020-12-02 05:33:17 +00:00
src: "ubuntu18/{{item}}"
2020-11-30 00:43:21 +00:00
dest: "/tmp/{{item}}"
with_items:
2020-12-02 05:42:01 +00:00
- ovn_20.09.0-1_amd64.deb
2020-11-30 00:43:21 +00:00
when: force_new_ovn_download == True
- name: "Install packages"
apt:
deb: "{{ item }}"
with_items:
2020-12-02 05:38:58 +00:00
- "/tmp/ovn_20.09.0-1_amd64.deb"
2020-11-30 00:43:21 +00:00
when: force_new_ovn_download == True