Skip to content

Commit

Permalink
Merge pull request #30 from avinetworks/AV-87454
Browse files Browse the repository at this point in the history
Version comparison fixed for Ansible SE CSP
  • Loading branch information
sabandi authored Aug 4, 2020
2 parents 584d15b + 2ab07fd commit 636ffb2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tasks/metafile_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
- debug: msg="Metafile {{ se_avi_metafile_exists_json.output.name }} already exists."
vars:
se_avi_metafile_exists_json: "{{ se_avi_metafile_exists.content|from_json }}"
when: se_avi_metafile_exists.status == 200 and se_csp_resource_info['resource:resource'].csp_version < "02.04"
when: se_avi_metafile_exists.status == 200 and se_csp_resource_info['resource:resource'].csp_version is version_compare("02.04", "<")

- debug: msg="Metafile {{ se_avi_metafile_exists_json['question_xml:output']['name'] }} already exists."
vars:
se_avi_metafile_exists_json: "{{ se_avi_metafile_exists.content|from_json }}"
when: se_avi_metafile_exists.status == 200 and se_csp_resource_info['resource:resource'].csp_version >= "02.04"
when: se_avi_metafile_exists.status == 200 and se_csp_resource_info['resource:resource'].csp_version is version_compare("02.04", ">=")

- block:
- name: Avi SE | CSP | Metafile deploy | Autoregistration
Expand Down
8 changes: 4 additions & 4 deletions tasks/qcow_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@
- set_fact:
se_image_exists_json: "{{ se_image_exists.content|from_json }}"
- debug: msg="Image {{ se_image_exists_json.output.name }} already exists."
when: se_image_exists.status == 200 and se_csp_resource_info['resource:resource'].csp_version < "02.04"
when: se_image_exists.status == 200 and se_csp_resource_info['resource:resource'].csp_version is version_compare("02.04", "<")

- block:
- set_fact:
se_image_exists_json: "{{ se_image_exists.content|from_json }}"
- debug: msg="Image {{ se_image_exists_json['question_xml:output']['name'] }} already exists."
when: se_image_exists.status == 200 and se_csp_resource_info['resource:resource'].csp_version >= "02.04"
when: se_image_exists.status == 200 and se_csp_resource_info['resource:resource'].csp_version is version_compare("02.04", ">=")

- block:
- name: Avi SE | CSP | Image deploy | Set SE image path for controller version < 18.2.6
set_fact:
se_image_path: "/opt/avi/se_ova"
when: se_master_ctl_version < "18.2.6"
when: se_master_ctl_version is version_compare("18.2.6", "<")

- block:
- name: Avi SE | CSP | Image deploy | Get controller tag
Expand All @@ -69,7 +69,7 @@
set_fact:
se_image_path: "/host/pkgs/{{ data_res.obj.version.Tag }}"

when: se_master_ctl_version >= "18.2.6"
when: se_master_ctl_version is version_compare("18.2.6", ">=")

- name: Avi SE | CSP | Image deploy | Verify qcow exists on controller
stat:
Expand Down
2 changes: 1 addition & 1 deletion tasks/service_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
set_fact:
se_csp_service_info: "{{se_csp_service_info | combine({'disk-resize': true})}}"
when:
- se_csp_resource_info['resource:resource'].csp_version >= "02.02.04.00"
- se_csp_resource_info['resource:resource'].csp_version is version_compare("02.02.04.00", ">=")

- name: Avi SE | CSP | Service deploy | Using service info
debug: msg="{{se_csp_service_info}}"
Expand Down
2 changes: 1 addition & 1 deletion templates/avi_meta_se.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% for key,value in se_csp_meta_options.iteritems() %}
{% for key,value in se_csp_meta_options.items() %}
{% if value != '' %}
{% set myvalue = se_csp_meta_config.update({ key: value }) %}
{% endif %}
Expand Down

0 comments on commit 636ffb2

Please sign in to comment.