diff options
Diffstat (limited to 'roles/openshift_resource/tasks/patch.yml')
-rw-r--r-- | roles/openshift_resource/tasks/patch.yml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/roles/openshift_resource/tasks/patch.yml b/roles/openshift_resource/tasks/patch.yml index e2bbcfa..501f692 100644 --- a/roles/openshift_resource/tasks/patch.yml +++ b/roles/openshift_resource/tasks/patch.yml @@ -1,10 +1,10 @@ --- -- name: Lookup the specified resource +- name: "Lookup {{resource}} in {{project}}" command: "oc get -n '{{project}}' '{{resource}}' -o json" register: orig_result changed_when: 0 -- name: Lookup API version of the specified resource +- name: "Lookup API version of {{resource}} in {{project}}" command: "oc get -n '{{project}}' '{{resource}}' --template {{'{{' + '.apiVersion' + '}}'}}" register: api_version changed_when: 0 @@ -13,14 +13,14 @@ - name: Escaping patch set_fact: xpatch='{{patch | to_json | regex_replace(" ","") | regex_replace("^", " ")}}' -- name: Generate dummy patch {{resource}} in {{project}} +- name: "Generate dummy patch for {{resource}} in {{project}}" command: "oc patch -n '{{project}}' --patch ' {\"apiVersion\": \"{{api_version.stdout}}\"}' --local=true -f - -o json" args: stdin: " {{ orig_result.stdout_lines | join('') }}" register: dummy_result changed_when: 0 -- name: Generate test patch {{resource}} in {{project}} +- name: "Generate test patch {{resource}} in {{project}}" command: "oc patch -n '{{project}}' --patch '{{xpatch}}' --local=true -f - -o json" args: stdin: " {{ orig_result.stdout_lines | join('') }}" @@ -33,7 +33,7 @@ #- debug: msg="{{ patch_result.stdout }}" # when: dummy_result.stdout != patch_result.stdout -- name: Patch {{resource}} in {{project}} +- name: "Patch {{resource}} in {{project}}" command: "oc patch -n '{{project}}' '{{resource}}' --patch '{{xpatch}}'" register: result changed_when: (result | succeeded) |