From b87109ff07443670a0c9ad0ab8ddfda548fa16c5 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 25 Feb 2021 02:59:50 +0100 Subject: Some changes of syntactic sugar for Ansible 3.9 compatibility --- roles/ands_kaas/tasks/project.yml | 4 ++-- roles/ands_kaas/tasks/sync.yml | 2 +- roles/ands_kaas/tasks/template.yml | 4 ++-- roles/ands_kaas/tasks/volume.yml | 14 +++++++------- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'roles/ands_kaas') diff --git a/roles/ands_kaas/tasks/project.yml b/roles/ands_kaas/tasks/project.yml index 5a83dff..744a20a 100644 --- a/roles/ands_kaas/tasks/project.yml +++ b/roles/ands_kaas/tasks/project.yml @@ -1,13 +1,13 @@ --- - name: Load global variables include_vars: "{{kaas_project_path}}/vars/globals.yml" - when: path | is_file + when: path is file vars: path: "{{ kaas_project_path }}/vars/globals.yml" - name: Load variables include_vars: dir="{{kaas_project_path}}/vars" name="var_{{kaas_project}}_config" - when: path | is_dir + when: path is directory vars: path: "{{ kaas_project_path }}/vars" diff --git a/roles/ands_kaas/tasks/sync.yml b/roles/ands_kaas/tasks/sync.yml index 8caefe9..bfc1a03 100644 --- a/roles/ands_kaas/tasks/sync.yml +++ b/roles/ands_kaas/tasks/sync.yml @@ -21,6 +21,6 @@ group: "{{ gid }}" register: chmod when: - - sync | changed + - sync is changed - kaas_openshift_gid_ranges[kaas_project] is defined - kaas_project_config.sync_set_gid | default(false) diff --git a/roles/ands_kaas/tasks/template.yml b/roles/ands_kaas/tasks/template.yml index a12b192..6255123 100644 --- a/roles/ands_kaas/tasks/template.yml +++ b/roles/ands_kaas/tasks/template.yml @@ -19,8 +19,8 @@ template: "{{ dest_name }}" template_path: "{{ kaas_template_path }}" project: "{{ kaas_namespace | default(kaas_project) }}" - recreate: "{{ result | changed | ternary (delete | default(true) | ternary(true, false), false) }}" - replace: "{{ result | changed | ternary (delete | default(true) | ternary(false, true), false) }}" + recreate: "{{ result is changed | ternary (delete | default(true) | ternary(true, false), false) }}" + replace: "{{ result is changed | ternary (delete | default(true) | ternary(false, true), false) }}" # alternatively load template # TODO diff --git a/roles/ands_kaas/tasks/volume.yml b/roles/ands_kaas/tasks/volume.yml index 2c695f2..d6e99e7 100644 --- a/roles/ands_kaas/tasks/volume.yml +++ b/roles/ands_kaas/tasks/volume.yml @@ -24,7 +24,7 @@ group: "{{ volume.group | default(kaas_project_config.file_group) | default(default_group) }}" register: chmod when: - - mkdir | changed + - mkdir is changed - kaas_openshift_gid_ranges[kaas_project] is defined - osvpath[:1] != "/" @@ -41,19 +41,19 @@ owner: "{{ volume.owner | default(kaas_project_config.file_owner) | default(kaas_default_file_owner) }}" group: "{{ volume.group | default(kaas_project_config.file_group) | default(kaas_default_file_group) }}" when: - - mkdir | changed - - chmod | skipped + - mkdir is changed + - chmod is skipped - name: "Setting SELinux context for non standard locations" sefcontext: target="{{ hostpath }}" setype="svirt_sandbox_file_t" state="present" reload="yes" when: - - mkdir | changed - - chmod | skipped + - mkdir is changed + - chmod is skipped - voltype[0] == "host" - name: "Apply SELinux context for non standard locations" shell: restorecon "{{ hostpath }}" when: - - mkdir | changed - - chmod | skipped + - mkdir is changed + - chmod is skipped - voltype[0] == "host" -- cgit v1.2.3