From 3d14743aa6aeb73ab5e21243792a5b8f7f982577 Mon Sep 17 00:00:00 2001 From: Emilien Kenler Date: Fri, 8 Jul 2022 23:33:30 +0900 Subject: [PATCH] Fix condition to detect recent version of ansible --- tasks/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index a248d3c..0c7e4ea 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,6 +3,7 @@ config: "{{ disk_additional_disks }}" register: __disk_config when: disk_discover_aws_nvme_ebs | default(True) | bool + tags: ['disk'] - name: setting fact if ansible version is 2.5 or older block: @@ -10,13 +11,15 @@ disk_additional_disks: "{{ __disk_config['ansible_facts']['config'] }}" when: __disk_config is defined and __disk_config | success and 'ansible_facts' in __disk_config when: ansible_version.full is version('2.5.0', '<') + tags: ['disk'] - name: setting fact if ansible version is newer than 2.5 block: - set_fact: disk_additional_disks: "{{ __disk_config['ansible_facts']['config'] }}" - when: __disk_config is defined and __disk_config is not successful and 'ansible_facts' in __disk_config + when: __disk_config is defined and __disk_config is successful and 'ansible_facts' in __disk_config when: ansible_version.full is version('2.5.0', '>=') + tags: ['disk'] - name: "Install parted" package: