diff --git a/files/ubuntu18/libopenvswitch-dev_2.14.0-1_amd64.deb b/files/ubuntu18/libopenvswitch-dev_2.14.0-1_amd64.deb new file mode 100644 index 0000000..c9e7066 Binary files /dev/null and b/files/ubuntu18/libopenvswitch-dev_2.14.0-1_amd64.deb differ diff --git a/files/ubuntu18/libopenvswitch_2.14.0-1_amd64.deb b/files/ubuntu18/libopenvswitch_2.14.0-1_amd64.deb new file mode 100644 index 0000000..5603d9b Binary files /dev/null and b/files/ubuntu18/libopenvswitch_2.14.0-1_amd64.deb differ diff --git a/files/ubuntu18/openvswitch-common_2.14.0-1_amd64.deb b/files/ubuntu18/openvswitch-common_2.14.0-1_amd64.deb new file mode 100644 index 0000000..505fa8e Binary files /dev/null and b/files/ubuntu18/openvswitch-common_2.14.0-1_amd64.deb differ diff --git a/files/ubuntu18/openvswitch-datapath-dkms_2.14.0-1_all.deb b/files/ubuntu18/openvswitch-datapath-dkms_2.14.0-1_all.deb new file mode 100644 index 0000000..b860446 Binary files /dev/null and b/files/ubuntu18/openvswitch-datapath-dkms_2.14.0-1_all.deb differ diff --git a/files/ubuntu18/openvswitch-datapath-source_2.14.0-1_all.deb b/files/ubuntu18/openvswitch-datapath-source_2.14.0-1_all.deb new file mode 100644 index 0000000..9f08173 Binary files /dev/null and b/files/ubuntu18/openvswitch-datapath-source_2.14.0-1_all.deb differ diff --git a/files/ubuntu18/openvswitch-dbg_2.14.0-1_amd64.deb b/files/ubuntu18/openvswitch-dbg_2.14.0-1_amd64.deb new file mode 100644 index 0000000..40a7c28 Binary files /dev/null and b/files/ubuntu18/openvswitch-dbg_2.14.0-1_amd64.deb differ diff --git a/files/ubuntu18/openvswitch-ipsec_2.14.0-1_amd64.deb b/files/ubuntu18/openvswitch-ipsec_2.14.0-1_amd64.deb new file mode 100644 index 0000000..f0c140e Binary files /dev/null and b/files/ubuntu18/openvswitch-ipsec_2.14.0-1_amd64.deb differ diff --git a/files/openvswitch-pki_2.14.0-1_all.deb b/files/ubuntu18/openvswitch-pki_2.14.0-1_all.deb similarity index 100% rename from files/openvswitch-pki_2.14.0-1_all.deb rename to files/ubuntu18/openvswitch-pki_2.14.0-1_all.deb diff --git a/files/ubuntu18/openvswitch-switch_2.14.0-1_amd64.deb b/files/ubuntu18/openvswitch-switch_2.14.0-1_amd64.deb new file mode 100644 index 0000000..4564164 Binary files /dev/null and b/files/ubuntu18/openvswitch-switch_2.14.0-1_amd64.deb differ diff --git a/files/ubuntu18/openvswitch-test_2.14.0-1_all.deb b/files/ubuntu18/openvswitch-test_2.14.0-1_all.deb new file mode 100644 index 0000000..255c141 Binary files /dev/null and b/files/ubuntu18/openvswitch-test_2.14.0-1_all.deb differ diff --git a/files/ubuntu18/openvswitch-testcontroller_2.14.0-1_amd64.deb b/files/ubuntu18/openvswitch-testcontroller_2.14.0-1_amd64.deb new file mode 100644 index 0000000..0b3030e Binary files /dev/null and b/files/ubuntu18/openvswitch-testcontroller_2.14.0-1_amd64.deb differ diff --git a/files/ubuntu18/openvswitch-vtep_2.14.0-1_amd64.deb b/files/ubuntu18/openvswitch-vtep_2.14.0-1_amd64.deb new file mode 100644 index 0000000..a41e0df Binary files /dev/null and b/files/ubuntu18/openvswitch-vtep_2.14.0-1_amd64.deb differ diff --git a/files/ubuntu18/ovn_20.09.0-1_amd64.deb b/files/ubuntu18/ovn_20.09.0-1_amd64.deb new file mode 100644 index 0000000..7c125db Binary files /dev/null and b/files/ubuntu18/ovn_20.09.0-1_amd64.deb differ diff --git a/files/ubuntu18/python3-openvswitch_2.14.0-1_all.deb b/files/ubuntu18/python3-openvswitch_2.14.0-1_all.deb new file mode 100644 index 0000000..745b176 Binary files /dev/null and b/files/ubuntu18/python3-openvswitch_2.14.0-1_all.deb differ diff --git a/files/libopenvswitch-dev_2.14.0-1_amd64.deb b/files/ubuntu20/libopenvswitch-dev_2.14.0-1_amd64.deb similarity index 100% rename from files/libopenvswitch-dev_2.14.0-1_amd64.deb rename to files/ubuntu20/libopenvswitch-dev_2.14.0-1_amd64.deb diff --git a/files/libopenvswitch_2.14.0-1_amd64.deb b/files/ubuntu20/libopenvswitch_2.14.0-1_amd64.deb similarity index 100% rename from files/libopenvswitch_2.14.0-1_amd64.deb rename to files/ubuntu20/libopenvswitch_2.14.0-1_amd64.deb diff --git a/files/openvswitch-common_2.14.0-1_amd64.deb b/files/ubuntu20/openvswitch-common_2.14.0-1_amd64.deb similarity index 100% rename from files/openvswitch-common_2.14.0-1_amd64.deb rename to files/ubuntu20/openvswitch-common_2.14.0-1_amd64.deb diff --git a/files/openvswitch-datapath-dkms_2.14.0-1_all.deb b/files/ubuntu20/openvswitch-datapath-dkms_2.14.0-1_all.deb similarity index 100% rename from files/openvswitch-datapath-dkms_2.14.0-1_all.deb rename to files/ubuntu20/openvswitch-datapath-dkms_2.14.0-1_all.deb diff --git a/files/openvswitch-datapath-source_2.14.0-1_all.deb b/files/ubuntu20/openvswitch-datapath-source_2.14.0-1_all.deb similarity index 100% rename from files/openvswitch-datapath-source_2.14.0-1_all.deb rename to files/ubuntu20/openvswitch-datapath-source_2.14.0-1_all.deb diff --git a/files/openvswitch-dbg_2.14.0-1_amd64.deb b/files/ubuntu20/openvswitch-dbg_2.14.0-1_amd64.deb similarity index 100% rename from files/openvswitch-dbg_2.14.0-1_amd64.deb rename to files/ubuntu20/openvswitch-dbg_2.14.0-1_amd64.deb diff --git a/files/openvswitch-ipsec_2.14.0-1_amd64.deb b/files/ubuntu20/openvswitch-ipsec_2.14.0-1_amd64.deb similarity index 100% rename from files/openvswitch-ipsec_2.14.0-1_amd64.deb rename to files/ubuntu20/openvswitch-ipsec_2.14.0-1_amd64.deb diff --git a/files/ubuntu20/openvswitch-pki_2.14.0-1_all.deb b/files/ubuntu20/openvswitch-pki_2.14.0-1_all.deb new file mode 100644 index 0000000..8ac9fba Binary files /dev/null and b/files/ubuntu20/openvswitch-pki_2.14.0-1_all.deb differ diff --git a/files/openvswitch-switch_2.14.0-1_amd64.deb b/files/ubuntu20/openvswitch-switch_2.14.0-1_amd64.deb similarity index 100% rename from files/openvswitch-switch_2.14.0-1_amd64.deb rename to files/ubuntu20/openvswitch-switch_2.14.0-1_amd64.deb diff --git a/files/openvswitch-test_2.14.0-1_all.deb b/files/ubuntu20/openvswitch-test_2.14.0-1_all.deb similarity index 100% rename from files/openvswitch-test_2.14.0-1_all.deb rename to files/ubuntu20/openvswitch-test_2.14.0-1_all.deb diff --git a/files/openvswitch-testcontroller_2.14.0-1_amd64.deb b/files/ubuntu20/openvswitch-testcontroller_2.14.0-1_amd64.deb similarity index 100% rename from files/openvswitch-testcontroller_2.14.0-1_amd64.deb rename to files/ubuntu20/openvswitch-testcontroller_2.14.0-1_amd64.deb diff --git a/files/openvswitch-vtep_2.14.0-1_amd64.deb b/files/ubuntu20/openvswitch-vtep_2.14.0-1_amd64.deb similarity index 100% rename from files/openvswitch-vtep_2.14.0-1_amd64.deb rename to files/ubuntu20/openvswitch-vtep_2.14.0-1_amd64.deb diff --git a/files/ovn_20.09.0-1_amd64.deb b/files/ubuntu20/ovn_20.09.0-1_amd64.deb similarity index 100% rename from files/ovn_20.09.0-1_amd64.deb rename to files/ubuntu20/ovn_20.09.0-1_amd64.deb diff --git a/files/python3-openvswitch_2.14.0-1_all.deb b/files/ubuntu20/python3-openvswitch_2.14.0-1_all.deb similarity index 100% rename from files/python3-openvswitch_2.14.0-1_all.deb rename to files/ubuntu20/python3-openvswitch_2.14.0-1_all.deb diff --git a/tasks/main.yml b/tasks/main.yml index cd83e0c..a0b2405 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,3 +1,20 @@ +#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" + + + - name: "Checking presense of OpenVsitch and comparing MD5 hash value" stat: path: /usr/sbin/ovsdb-server @@ -11,53 +28,6 @@ set_fact: force_new_ovs_download: False -- 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: - src: "{{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 == True - - - - -- name: "Install 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 == True - - - - - - - - - - name: "Checking presense of OVN and comparing MD5 hash value" stat: path: /usr/bin/ovn-nbctl @@ -71,47 +41,34 @@ set_fact: force_new_ovn_download: False -- 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 +- name: Include tasks based on OS being Ubuntu 18 + include_tasks: ubuntu18.yml + when: + - ansible_distribution_major_version=="18" + - ansible_distribution == "Ubuntu" + tags: ceph + +- name: Include tasks based on OS being Ubuntu 20 + include_tasks: ubuntu20.yml + when: + - ansible_distribution_major_version=="20" + - ansible_distribution == "Ubuntu" + tags: ceph + + + + + + + -- debug: msg="NOT Installing OVN, MD5 sum matches" - when: force_new_ovn_download == False -- name: "Copy OVN binaries" - copy: - src: "{{item}}" - dest: "/tmp/{{item}}" - with_items: - - ovn_20.09.0-1_amd64.deb - when: force_new_ovn_download == True -- name: "Install packages" - apt: - deb: "{{ item }}" - with_items: - - "/tmp/ovn_20.09.0-1_amd64.deb" - when: force_new_ovn_download == True -- set_fact: ovn_sb_group_name_rendered="{{hostvars[ansible_hostname].ovn_sb_db_group}}" - tags: service -- name: Generate OVN SB Connection fact - set_fact: OVN_SB_Connection="{% for host in groups[ovn_sb_group_name_rendered] %}tcp:{{ hostvars[host].host_loopback_IP }}:6642{% if not loop.last %},{% endif %}{% endfor %}" - tags: service - #Install the custom service to start OVS and OVN as required - name: "Copy /usr/sbin/ovsovn-service-manager.sh file" template: diff --git a/tasks/ubuntu18.yml b/tasks/ubuntu18.yml new file mode 100644 index 0000000..401c4b2 --- /dev/null +++ b/tasks/ubuntu18.yml @@ -0,0 +1,85 @@ +#OVS Version 2.14.0 \ Ubuntu 20 +- set_fact: ovsdb_server_md5_value: "ffd9ba2a6b3da6108d7eb97c70e51761" +#OVN Version 20.09.0 \ Ubuntu 20 +- set_fact: ovn_nbctl_md5_value: "031e770fd969617c221b156726c2f1dc" + + +- 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: + src: "{{item}}" + dest: "/tmp/{{item}}" + with_items: + - libopenvswitch_2.13.0-1_amd64.deb + - openvswitch-common_2.13.0-1_amd64.deb + - openvswitch-switch_2.13.0-1_amd64.deb + when: force_new_ovs_download == True + + + + +- name: "Install packages" + apt: + deb: "{{ item }}" + with_items: + - "/tmp/libopenvswitch_2.13.0-1_amd64.deb" + - "/tmp/openvswitch-common_2.13.0-1_amd64.deb" + - "/tmp/openvswitch-switch_2.13.0-1_amd64.deb" + 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: + src: "{{item}}" + dest: "/tmp/{{item}}" + with_items: + - ovn_20.06.0-1_amd64.deb + when: force_new_ovn_download == True + +- name: "Install packages" + apt: + deb: "{{ item }}" + with_items: + - "/tmp/ovn_20.06.0-1_amd64.deb" + when: force_new_ovn_download == True diff --git a/tasks/ubuntu20.yml b/tasks/ubuntu20.yml new file mode 100644 index 0000000..b16405b --- /dev/null +++ b/tasks/ubuntu20.yml @@ -0,0 +1,84 @@ +#OVS Version 2.14.0 \ Ubuntu 20 +- set_fact: ovsdb_server_md5_value: "2183d20b8df5b5cb790aa238f6e1432e" +#OVN Version 20.09.0 \ Ubuntu 20 +- 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 == 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: + src: "{{item}}" + dest: "/tmp/{{item}}" + with_items: + - ubuntu20/libopenvswitch_2.14.0-1_amd64.deb + - ubuntu20/openvswitch-common_2.14.0-1_amd64.deb + - ubuntu20/openvswitch-switch_2.14.0-1_amd64.deb + when: force_new_ovs_download == True + + + + +- name: "Install 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 == 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: + src: "{{item}}" + dest: "/tmp/{{item}}" + with_items: + - ubuntu20/ovn_20.06.0-1_amd64.deb + when: force_new_ovn_download == True + +- name: "Install packages" + apt: + deb: "{{ item }}" + with_items: + - "/tmp/ovn_20.06.0-1_amd64.deb" + when: force_new_ovn_download == True diff --git a/templates/ovsovn-service-manager.sh.j2 b/templates/ovsovn-service-manager.sh.j2 index b995969..dfc1fdc 100644 --- a/templates/ovsovn-service-manager.sh.j2 +++ b/templates/ovsovn-service-manager.sh.j2 @@ -21,8 +21,8 @@ START(){ /usr/share/openvswitch/scripts/ovs-ctl start --system-id=$hostname #Instruct OVSDB to listen on 127.0.0.2:6640 so the ovs-vsctl command from within a container can access OpenVswitch ovs-appctl -t ovsdb-server ovsdb-server/add-remote ptcp:6640 - ovs-vsctl del-br br-int - + #ovs-vsctl del-br br-int + ovs-vsctl set open . external-ids:ovn-bridge=br-int ovs-vsctl set open . external-ids:ovn-remote={{OVN_SB_Connection}} ovs-vsctl set open . external-ids:ovn-encap-type=geneve