-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconstruct.yml
38 lines (33 loc) · 1.04 KB
/
construct.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
---
- hosts: localhost
connection: local
gather_facts: false
pre_tasks:
- include_vars: group_vars/project.yml
tasks:
- name: upload ssh keypair
os_keypair:
cloud: '{{ cloud_project.cloud_name }}'
state: present
name: '{{ project_user.ssh_key_name }}'
public_key_file: '{{ project_user.ssh_key }}'
- name: create networks
os_network:
cloud: '{{ cloud_project.cloud_name }}'
state: present
name: '{{ item.net_name }}'
external: false
shared: false
with_items: '{{ project_networks }}'
- name: create subnets
os_subnet:
cloud: '{{ cloud_project.cloud_name }}'
state: present
name: '{{ item.net_subnet }}'
cidr: '{{ item.net_cidr }}'
network_name: '{{ item.net_name }}'
enable_dhcp: true
with_items: '{{ project_networks }}'
- name: obtain subnet details
os_subnets_facts:
cloud: '{{ cloud_project.cloud_name }}'