summaryrefslogtreecommitdiffstats
path: root/roles/openshift_resource/tasks/template.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_resource/tasks/template.yml')
-rw-r--r--roles/openshift_resource/tasks/template.yml8
1 files changed, 8 insertions, 0 deletions
diff --git a/roles/openshift_resource/tasks/template.yml b/roles/openshift_resource/tasks/template.yml
index f43b0f2..f593544 100644
--- a/roles/openshift_resource/tasks/template.yml
+++ b/roles/openshift_resource/tasks/template.yml
@@ -30,4 +30,12 @@
- (recreate | default(false)) or (replace | default(false)) or (results | changed)
- resources | length > 0
+# Replace will not create missing resources. We need to create here.
+ - name: "{{ template }}: Populate missing resources to {{project}} ({{ replace | default(false) | ternary('replace', 'create') }})"
+ shell: "oc process -n {{project}} -f '{{ template_path }}/{{template}}' {{ template_args | default('') }} | oc create -n {{project}} -f - {{ create_args | default('') }}"
+ when:
+ - (replace | default(false)) and (results | changed)
+ - resources | length > 0
+
+
run_once: true