-
Notifications
You must be signed in to change notification settings - Fork 0
/
site-osp-instances.yml
42 lines (37 loc) · 1.04 KB
/
site-osp-instances.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
- hosts: workstation
become: yes
tasks:
- name: Fetch Instance Info
os_server_facts:
cloud: ospcloud
region_name: RegionOne
register: result
- set_fact:
instances: "{{ result.ansible_facts.openstack_servers | json_query('[*].name') }}"
- debug:
var: instances
# os_server module not idempotent (errors out when deploying an instance with the same name)
## Create Frontend Instance
- name: Create frontend instance
include_role:
name: osp-instances
vars_from: frontend.yml
when: "'frontend' not in instances"
## Create App1 server
- name: Create app1 instance
include_role:
name: osp-instances
vars_from: app1.yml
when: "'app1' not in instances"
## Create App2 server
- name: Create app2 instance
include_role:
name: osp-instances
vars_from: app2.yml
when: "'app2' not in instances"
## Create DB server
- name: Create db instance
include_role:
name: osp-instances
vars_from: db.yml
when: "'db' not in instances"