summaryrefslogtreecommitdiffstats
path: root/roles/openshift_resource/tasks/command.yml
blob: c8e8d04b91266cb40b2671f1a60af8facbd87440 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
- block:

  - name: Lookup the specified resource
    command: "oc get -n {{project}} {{resource}}"
    register: result
    failed_when: false
    changed_when: (result | failed)

  - name: Detroy existing resources
    command: "oc delete -n {{project}} {{resource}}"
    failed_when: false
    when: (recreate|default(false)) 

  - name: Executing command
    command: "oc -n {{ project }} {{ command }}"
    when: (recreate|default(false)) or (result | changed)
  run_once: true