Open matihost opened 6 years ago
Hi @matihost thanks for submitting this request (and info). With issue https://github.com/redhat-cop/openshift-applier/issues/39, we are looking to move to k8s_raw
(instead of using the oc
command), so I'd like to link this change to that one to ensure the request/needs are met as part of that work.
https://github.com/redhat-cop/openshift-applier/blob/master/roles/openshift-applier/tasks/process-template.yml#L43 always shows as "changed" in Ansible output
Since oc 3.9 the "oc apply" returns information whether is perfoma any change the server or not. So "changed_when" option can be used by comparing oc_apply stdout.
Actually oc command works via computing patch so it know whether it performs a change on the server - since oc 3.11 (or later) oc apply will be actually happening on the server completely.
References: https://docs.ansible.com/ansible/2.6/user_guide/playbooks_error_handling.html#overriding-the-changed-result https://ansibledaily.com/idempotent-shell-command-in-ansible/