summaryrefslogtreecommitdiffstats
path: root/roles/ands_openshift/tasks
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2021-02-25 02:59:50 +0100
committerSuren A. Chilingaryan <csa@suren.me>2021-02-25 02:59:50 +0100
commitb87109ff07443670a0c9ad0ab8ddfda548fa16c5 (patch)
treedae10d9213ff974e1b17bbe927cdc712820a0ba8 /roles/ands_openshift/tasks
parent1fb49d8220cad74d7221863754c919e3195a3d37 (diff)
downloadands-b87109ff07443670a0c9ad0ab8ddfda548fa16c5.tar.gz
ands-b87109ff07443670a0c9ad0ab8ddfda548fa16c5.tar.bz2
ands-b87109ff07443670a0c9ad0ab8ddfda548fa16c5.tar.xz
ands-b87109ff07443670a0c9ad0ab8ddfda548fa16c5.zip
Some changes of syntactic sugar for Ansible 3.9 compatibility
Diffstat (limited to 'roles/ands_openshift/tasks')
-rw-r--r--roles/ands_openshift/tasks/heketi_resources.yml18
-rw-r--r--roles/ands_openshift/tasks/projects_resources.yml2
-rw-r--r--roles/ands_openshift/tasks/ssh.yml4
-rw-r--r--roles/ands_openshift/tasks/storage_resources.yml4
-rw-r--r--roles/ands_openshift/tasks/users_resources.yml2
5 files changed, 15 insertions, 15 deletions
diff --git a/roles/ands_openshift/tasks/heketi_resources.yml b/roles/ands_openshift/tasks/heketi_resources.yml
index 0b0d0d3..1cab748 100644
--- a/roles/ands_openshift/tasks/heketi_resources.yml
+++ b/roles/ands_openshift/tasks/heketi_resources.yml
@@ -6,11 +6,11 @@
command: oc -n "{{ openshift_namespace }}" get secret/heketi
register: result
failed_when: false
- changed_when: (result | failed)
+ changed_when: result is failed
- name: Create secret for dynamic volume provisioning
command: "kubectl create secret generic heketi --type=kubernetes.io/glusterfs --from-literal=key={{ ands_secrets.heketi.admin | quote }} --from-literal=user={{ ands_secrets.heketi.user | quote }} --namespace={{ openshift_namespace }}"
- when: (result | changed)
+ when: (result is changed)
- name: Copy Heketi configuration
copy: src="heketi/heketi.json" dest="{{ heketi_template_path }}/heketi.json" owner=root group=root mode="0644"
@@ -20,21 +20,21 @@
command: oc -n "{{ openshift_namespace }}" get cm/heketi
register: result2
failed_when: false
- changed_when: (result2 | failed)
+ changed_when: result2 is failed
- name: Desotry existing Heketi configuration
command: oc -n "{{ openshift_namespace }}" delete cm/heketi
- when: ( result1 | changed ) and (not (result2 | changed))
+ when: ( result1 is changed ) and (not (result2 is changed))
- name: Create heketiConfigmap
command: oc -n "{{ openshift_namespace }}" create cm heketi --from-file="{{ heketi_template_path }}/heketi.json"
- when: (result1 | changed) or (result2 | changed)
+ when: (result1 is changed) or (result2 is changed)
- name: Check if Heketi POD is running
command: oc -n "{{ openshift_namespace }}" get dc/heketi --template "{{ '{{.status.availableReplicas}}' }}"
register: result
failed_when: false
- changed_when: (result | failed) or ((result.stdout | int) < 1)
+ changed_when: (result is failed) or ((result.stdout | int) < 1)
- name: Fix GlusterFS volume permissions
include_tasks: heketi_perms.yml
@@ -42,7 +42,7 @@
apply:
run_once: true
delegate_to: "{{ groups.masters[0] }}"
- when: (result | changed)
+ when: (result is changed)
- name: Copy Heketi Template
template: src="heketi/heketi_template.json.j2" dest="{{ heketi_template_path }}/heketi_template.json" owner=root group=root mode="0644"
@@ -54,7 +54,7 @@
template: heketi_template.json
template_path: "{{ heketi_template_path }}"
project: "{{ openshift_namespace }}"
- recreate: "{{ result | changed | ternary (true, false) }}"
+ recreate: "{{ result is changed | ternary (true, false) }}"
- name: Wait until heketi service is running
wait_for: host="heketi.{{ openshift_master_default_subdomain }}" port=80 state=present
@@ -73,4 +73,4 @@
template: heketi-sc.yml
template_path: "{{ heketi_template_path }}"
project: "{{ openshift_namespace }}"
- recreate: "{{ result | changed | ternary (true, false) }}"
+ recreate: "{{ result is changed | ternary (true, false) }}"
diff --git a/roles/ands_openshift/tasks/projects_resources.yml b/roles/ands_openshift/tasks/projects_resources.yml
index 2afe9e1..d5b4580 100644
--- a/roles/ands_openshift/tasks/projects_resources.yml
+++ b/roles/ands_openshift/tasks/projects_resources.yml
@@ -5,7 +5,7 @@
- name: Find missing projects
set_fact: new_projects="{{ ands_openshift_projects.keys() | difference (results.stdout | from_json | json_query('items[*].metadata.name')) }}"
- when: (results | succeeded)
+ when: results is succeeded
- name: Create missing projects
command: "oc adm new-project --description '{{ ands_openshift_projects[item] }}' {{ item }}"
diff --git a/roles/ands_openshift/tasks/ssh.yml b/roles/ands_openshift/tasks/ssh.yml
index 97f3926..c3b35c3 100644
--- a/roles/ands_openshift/tasks/ssh.yml
+++ b/roles/ands_openshift/tasks/ssh.yml
@@ -4,7 +4,7 @@
delegate_to: "{{ groups.masters[0] }}"
command: oc -n "{{ openshift_namespace }}" get secret/ands-ssh
register: result
- changed_when: (result | failed)
+ changed_when: result is failed
failed_when: false
- include_tasks: ssh_keygen.yml
@@ -12,7 +12,7 @@
apply:
run_once: true
delegate_to: "{{ groups.masters[0] }}"
- when: (result | changed)
+ when: (result is changed)
- name: Read SSH public key
shell: cat "{{ ssh_template_path }}/id_rsa.pub"
diff --git a/roles/ands_openshift/tasks/storage_resources.yml b/roles/ands_openshift/tasks/storage_resources.yml
index c83c677..3b051d8 100644
--- a/roles/ands_openshift/tasks/storage_resources.yml
+++ b/roles/ands_openshift/tasks/storage_resources.yml
@@ -12,7 +12,7 @@
template: gfs-svc.yml
template_path: "{{ storage_template_path }}"
project: "{{ prj_item }}"
- recreate: "{{ result | changed | ternary (true, false) }}"
+ recreate: "{{ result is changed | ternary (true, false) }}"
with_items: "{{ ands_openshift_projects.keys() }}"
loop_control:
loop_var: prj_item
@@ -27,7 +27,7 @@
template: gfs-ep.yml
template_path: "{{ storage_template_path }}"
project: "{{ prj_item }}"
- recreate: "{{ result | changed | ternary (true, false) }}"
+ recreate: "{{ result is changed | ternary (true, false) }}"
with_items: "{{ ands_openshift_projects.keys() }}"
loop_control:
loop_var: prj_item
diff --git a/roles/ands_openshift/tasks/users_resources.yml b/roles/ands_openshift/tasks/users_resources.yml
index 2a73cd0..3552ce1 100644
--- a/roles/ands_openshift/tasks/users_resources.yml
+++ b/roles/ands_openshift/tasks/users_resources.yml
@@ -20,7 +20,7 @@
- name: Find removed users
set_fact: removed_users="{{ results.stdout | from_json | json_query('items[*].metadata.name') | difference(ands_openshift_users.keys()) }}"
- when: (results | succeeded)
+ when: results is succeeded
- name: Remove user authentication
command: "oc delete identity htpasswd_auth:{{ item }}"