Skip to content

Commit 5c2e2ac

Browse files
committed
add conditional deployments
1 parent 2e6d097 commit 5c2e2ac

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

ocne2/create_instance.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@
261261
ansible.builtin.include_tasks: "build.yml"
262262
loop: "{{ lookup('dict', compute_instances, wantlist=True) }}"
263263

264+
- name: Set file system storage
265+
ansible.builtin.include_tasks: "create_fss.yml"
266+
when: use_fss
267+
264268
- name: Configure new instances
265269
hosts: all
266270
gather_facts: false
@@ -344,6 +348,10 @@
344348

345349
tasks:
346350

351+
- name: Delete file system storage
352+
ansible.builtin.include_tasks: "delete_fss.yml"
353+
when: use_fss
354+
347355
- name: Terminate the instances
348356
oracle.oci.oci_compute_instance:
349357
id: "{{ hostvars[item]['instance_ocid'] }}"
@@ -380,4 +388,5 @@
380388
state: absent
381389
path: "{{ item }}"
382390
loop:
391+
- fss_vars.yml
383392
- oci_vars.yml

ocne2/fss_deployments.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,20 @@
1515
mode: "0644"
1616
become: true
1717
become_user: "{{ username }}"
18-
delegate_to: "{{ item }}"
19-
loop: "{{ groups['controlplane'] }}"
20-
18+
2119
- name: Create file fss-pvc.yaml
2220
ansible.builtin.template:
2321
src: fss_pvc.j2
2422
dest: ~/fss-pvc.yaml
2523
mode: "0644"
2624
become: true
2725
become_user: "{{ username }}"
28-
delegate_to: "{{ item }}"
29-
loop: "{{ groups['controlplane'] }}"
30-
26+
3127
- name: Create file fss-pod.yaml
3228
ansible.builtin.template:
3329
src: fss_pod.j2
3430
dest: ~/fss-pod.yaml
3531
mode: "0644"
3632
become: true
3733
become_user: "{{ username }}"
38-
delegate_to: "{{ item }}"
39-
loop: "{{ groups['controlplane'] }}"
34+

0 commit comments

Comments
 (0)