This repository has been archived by the owner on Apr 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrystack.yml
99 lines (84 loc) · 1.84 KB
/
trystack.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
- hosts: localhost
tasks:
- block:
- os_keypair:
name: trystack-key
public_key_file: "{{ ansible_env.HOME }}/.ssh/id_rsa.pub"
state: present
- os_security_group:
description: All ports open
name: all
state: present
- os_security_group_rule:
direction: ingress
port_range_min: 1
port_range_max: 65535
protocol: tcp
remote_ip_prefix: 0.0.0.0/0
security_group: all
state: present
- os_network:
name: network-1
state: present
- os_subnet:
cidr: 192.168.210.0/24
dns_nameservers:
- 8.8.8.8
- 8.8.4.4
name: subnet-1
network_name: network-1
state: present
- os_router:
interfaces:
- subnet-1
name: router-1
network: public
state: present
when: create_network
- os_server:
auto_ip: yes
flavor_ram: 2048
image: CentOS7
key_name: trystack-key
meta:
groups: "test"
name: test-1
nics:
- net-name: network-1
security_groups:
- default
- all
state: present
register: instance
- os_server:
auto_ip: no
flavor_ram: 2048
image: CentOS7
key_name: trystack-key
meta:
groups: "test"
name: test-2
nics:
- net-name: network-1
security_groups:
- default
- all
- os_volume:
display_name: test-vol-{{ item }}
size: 10
state: present
with_items: [1, 2]
tags:
- storage
- os_server_volume:
state: present
server: test-{{ item }}
volume: test-vol-{{ item }}
#device: /dev/vdb
with_items: [1, 2]
tags:
- storage
- debug:
msg: "External IP: {{ instance.openstack.public_v4 }}"
vars:
- create_network: True