Ansible lint compliance

This commit is contained in:
Cory 2021-03-05 12:06:53 +10:30
parent 22e957f2bf
commit 4c01378119
2 changed files with 48 additions and 40 deletions

View File

@ -1,27 +1,31 @@
- set_fact: - name: set ovsdb_server_md5_value fact
set_fact:
ovsdb_server_md5_value: "ffd9ba2a6b3da6108d7eb97c70e51761" ovsdb_server_md5_value: "ffd9ba2a6b3da6108d7eb97c70e51761"
- set_fact: - name: set ovn_nbctl_md5_value fact
set_fact:
ovn_nbctl_md5_value: "031e770fd969617c221b156726c2f1dc" ovn_nbctl_md5_value: "031e770fd969617c221b156726c2f1dc"
- name: "Set fact to true if the source file exists but the MD5 sum does not match" - name: "Set fact to true if the source file exists but the MD5 sum does not match"
set_fact: set_fact:
force_new_ovs_download: "{{ ovsdb_server_exists.stat.checksum != ovsdb_server_md5_value }}" force_new_ovs_download: "{{ ovsdb_server_exists.stat.checksum != ovsdb_server_md5_value }}"
when: ovsdb_server_exists.stat.exists == True when: ovsdb_server_exists.stat.exists
- name: "Set fact to true if the source file does not exist" - name: "Set fact to true if the source file does not exist"
set_fact: set_fact:
force_new_ovs_download: True force_new_ovs_download: True
when: ovsdb_server_exists.stat.exists == False when: not ovsdb_server_exists.stat.exists
- debug: msg="Installing OpenVSwitch" - name: Debug out force_new_ovs_download
when: force_new_ovs_download == True debug: msg="Installing OpenVSwitch"
when: force_new_ovs_download
- debug: msg="NOT Installing OpenVSwitch, MD5 sum matches" - name: Debug out force_new_ovs_download
when: force_new_ovs_download == False debug: msg="NOT Installing OpenVSwitch, MD5 sum matches"
when: not force_new_ovs_download
- name: "Copy OVN binaries" - name: "Copy OVN binaries"
copy: copy:
@ -31,7 +35,7 @@
- libopenvswitch_2.14.0-1_amd64.deb - libopenvswitch_2.14.0-1_amd64.deb
- openvswitch-common_2.14.0-1_amd64.deb - openvswitch-common_2.14.0-1_amd64.deb
- openvswitch-switch_2.14.0-1_amd64.deb - openvswitch-switch_2.14.0-1_amd64.deb
when: force_new_ovs_download == True when: force_new_ovs_download
@ -43,7 +47,7 @@
- "/tmp/libopenvswitch_2.14.0-1_amd64.deb" - "/tmp/libopenvswitch_2.14.0-1_amd64.deb"
- "/tmp/openvswitch-common_2.14.0-1_amd64.deb" - "/tmp/openvswitch-common_2.14.0-1_amd64.deb"
- "/tmp/openvswitch-switch_2.14.0-1_amd64.deb" - "/tmp/openvswitch-switch_2.14.0-1_amd64.deb"
when: force_new_ovs_download == True when: force_new_ovs_download
@ -55,7 +59,7 @@
- name: "Set fact to true if the source file exists but the MD5 sum does not match" - name: "Set fact to true if the source file exists but the MD5 sum does not match"
set_fact: set_fact:
force_new_ovn_download: "{{ ovn_nbctl_exists.stat.checksum != ovn_nbctl_md5_value }}" force_new_ovn_download: "{{ ovn_nbctl_exists.stat.checksum != ovn_nbctl_md5_value }}"
when: ovn_nbctl_exists.stat.exists == True when: ovn_nbctl_exists.stat.exists
#- debug: msg={{ovn_nbctl_md5_value}} #- debug: msg={{ovn_nbctl_md5_value}}
#- debug: msg={{ovn_nbctl_exists}} #- debug: msg={{ovn_nbctl_exists}}
@ -63,13 +67,13 @@
- name: "Set fact to true if the source file does not exist" - name: "Set fact to true if the source file does not exist"
set_fact: set_fact:
force_new_ovn_download: True force_new_ovn_download: True
when: ovn_nbctl_exists.stat.exists == False when: not ovn_nbctl_exists.stat.exists
- debug: msg="Installing OVN" - debug: msg="Installing OVN"
when: force_new_ovn_download == True when: force_new_ovn_download
- debug: msg="NOT Installing OVN, MD5 sum matches" - debug: msg="NOT Installing OVN, MD5 sum matches"
when: force_new_ovn_download == False when: not force_new_ovn_download
- name: "Copy OVN binaries" - name: "Copy OVN binaries"
copy: copy:
@ -77,11 +81,11 @@
dest: "/tmp/{{ item }}" dest: "/tmp/{{ item }}"
with_items: with_items:
- ovn_20.09.0-1_amd64.deb - ovn_20.09.0-1_amd64.deb
when: force_new_ovn_download == True when: force_new_ovn_download
- name: "Install packages" - name: "Install packages"
apt: apt:
deb: "{{ item }}" deb: "{{ item }}"
with_items: with_items:
- "/tmp/ovn_20.09.0-1_amd64.deb" - "/tmp/ovn_20.09.0-1_amd64.deb"
when: force_new_ovn_download == True when: force_new_ovn_download

View File

@ -1,25 +1,29 @@
- set_fact: - name: set ovsdb_server_md5_value fact
set_fact:
ovsdb_server_md5_value: "2183d20b8df5b5cb790aa238f6e1432e" ovsdb_server_md5_value: "2183d20b8df5b5cb790aa238f6e1432e"
- set_fact: - name: set ovn_nbctl_md5_value fact
set_fact:
ovn_nbctl_md5_value: "6007bc53bf30b8d4b4c0fab039ee576b" ovn_nbctl_md5_value: "6007bc53bf30b8d4b4c0fab039ee576b"
- name: "Set fact to true if the source file exists but the MD5 sum does not match" - name: "Set fact to true if the source file exists but the MD5 sum does not match"
set_fact: set_fact:
force_new_ovs_download: "{{ ovsdb_server_exists.stat.checksum != ovsdb_server_md5_value }}" force_new_ovs_download: "{{ ovsdb_server_exists.stat.checksum != ovsdb_server_md5_value }}"
when: ovsdb_server_exists.stat.exists == True when: ovsdb_server_exists.stat.exists
- name: "Set fact to true if the source file does not exist" - name: "Set fact to true if the source file does not exist"
set_fact: set_fact:
force_new_ovs_download: True force_new_ovs_download: True
when: ovsdb_server_exists.stat.exists == False when: not ovsdb_server_exists.stat.exists
- debug: msg="Installing OpenVSwitch" - name: Debug out force_new_ovs_download
when: force_new_ovs_download == True debug: msg="Installing OpenVSwitch"
when: force_new_ovs_download
- debug: msg="NOT Installing OpenVSwitch, MD5 sum matches" - name: Debug out force_new_ovs_download
when: force_new_ovs_download == False debug: msg="NOT Installing OpenVSwitch, MD5 sum matches"
when: not force_new_ovs_download
- name: "Copy OVN binaries" - name: "Copy OVN binaries"
copy: copy:
@ -29,7 +33,7 @@
- libopenvswitch_2.14.0-1_amd64.deb - libopenvswitch_2.14.0-1_amd64.deb
- openvswitch-common_2.14.0-1_amd64.deb - openvswitch-common_2.14.0-1_amd64.deb
- openvswitch-switch_2.14.0-1_amd64.deb - openvswitch-switch_2.14.0-1_amd64.deb
when: force_new_ovs_download == True when: force_new_ovs_download
@ -41,7 +45,7 @@
- "/tmp/libopenvswitch_2.14.0-1_amd64.deb" - "/tmp/libopenvswitch_2.14.0-1_amd64.deb"
- "/tmp/openvswitch-common_2.14.0-1_amd64.deb" - "/tmp/openvswitch-common_2.14.0-1_amd64.deb"
- "/tmp/openvswitch-switch_2.14.0-1_amd64.deb" - "/tmp/openvswitch-switch_2.14.0-1_amd64.deb"
when: force_new_ovs_download == True when: force_new_ovs_download
@ -53,7 +57,7 @@
- name: "Set fact to true if the source file exists but the MD5 sum does not match" - name: "Set fact to true if the source file exists but the MD5 sum does not match"
set_fact: set_fact:
force_new_ovn_download: "{{ ovn_nbctl_exists.stat.checksum != ovn_nbctl_md5_value }}" force_new_ovn_download: "{{ ovn_nbctl_exists.stat.checksum != ovn_nbctl_md5_value }}"
when: ovn_nbctl_exists.stat.exists == True and use_ovn==true when: ovn_nbctl_exists.stat.exists and use_ovn
#- debug: msg={{ovn_nbctl_md5_value}} #- debug: msg={{ovn_nbctl_md5_value}}
#- debug: msg={{ovn_nbctl_exists}} #- debug: msg={{ovn_nbctl_exists}}
@ -61,13 +65,13 @@
- name: "Set fact to true if the source file does not exist" - name: "Set fact to true if the source file does not exist"
set_fact: set_fact:
force_new_ovn_download: True force_new_ovn_download: True
when: ovn_nbctl_exists.stat.exists == False and use_ovn==true when: not ovn_nbctl_exists.stat.exists and use_ovn
- debug: msg="Installing OVN" - debug: msg="Installing OVN"
when: force_new_ovn_download == True and use_ovn==true when: force_new_ovn_download and use_ovn
- debug: msg="NOT Installing OVN, MD5 sum matches" - debug: msg="NOT Installing OVN, MD5 sum matches"
when: force_new_ovn_download == False and use_ovn==true when: not force_new_ovn_download and use_ovn
- name: "Copy OVN binaries" - name: "Copy OVN binaries"
copy: copy:
@ -75,11 +79,11 @@
dest: "/tmp/{{ item }}" dest: "/tmp/{{ item }}"
with_items: with_items:
- ovn_20.06.0-1_amd64.deb - ovn_20.06.0-1_amd64.deb
when: force_new_ovn_download == True and use_ovn==true when: force_new_ovn_download and use_ovn
- name: "Install packages" - name: "Install packages"
apt: apt:
deb: "{{ item }}" deb: "{{ item }}"
with_items: with_items:
- "/tmp/ovn_20.06.0-1_amd64.deb" - "/tmp/ovn_20.06.0-1_amd64.deb"
when: force_new_ovn_download == True and use_ovn==true when: force_new_ovn_download and use_ovn