-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Together with that add some additional playbooks and roles to further automate infra provisioning
- Loading branch information
Showing
18 changed files
with
224 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
image: Standard_Debian_10_latest | ||
flavor: s2.medium.2 | ||
volume_size: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
inventory/service/host_vars/watcher-eu-nl-01.apimon.eco.tsi-dev.otc-service.com.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
security_groups: ["watcher-sg"] | ||
nics: | ||
- address: "192.168.204.2" | ||
network: "vpc_a_csm_net" | ||
|
||
|
6 changes: 6 additions & 0 deletions
6
inventory/service/host_vars/watcher-eu-nl-02.apimon.eco.tsi-dev.otc-service.com.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
security_groups: ["watcher-sg"] | ||
nics: | ||
- address: "192.168.204.3" | ||
network: "vpc_a_csm_net" | ||
|
||
|
7 changes: 7 additions & 0 deletions
7
inventory/service/host_vars/watcher-eu-nl-03.apimon.eco.tsi-dev.otc-service.com.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
volume_size: 10 | ||
security_groups: ["watcher-sg"] | ||
nics: | ||
- fixed_ip: "192.168.204.4" | ||
net-name: "vpc_a_csm_net" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
- hosts: cloud-launcher:!disabled | ||
name: "Manage cloud hosts" | ||
tasks: | ||
- name: Manage OpenStack hosts | ||
include_role: | ||
name: cloud_host | ||
loop: "{{ group['all'] }}" | ||
loop_control: | ||
loop_var: host | ||
when: | ||
- "hostvars[host].location is defined" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
state: present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- name: Destroy instance | ||
openstack.cloud.server: | ||
state: "absent" | ||
cloud: "{{ hostvars[host].location.cloud }}" | ||
name: "{{ hostvars[host].inventory_hostname }}" | ||
delete_fip: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
- include: "provision.yaml" | ||
when: "state != 'absent'" | ||
|
||
- include: "destroy.yaml" | ||
when: "state == 'absent'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
- name: Ensure keypair exists | ||
openstack.cloud.keypair: | ||
state: "present" | ||
cloud: "{{ hostvars[host].location.cloud }}" | ||
name: "otcinfra-bridge" | ||
public_key: "{{ bastion_public_key }}" | ||
|
||
- name: Create a new instance | ||
openstack.cloud.server: | ||
state: "present" | ||
cloud: "{{ hostvars[host].location.cloud }}" | ||
name: "{{ hostvars[host].inventory_hostname }}" | ||
flavor: "{{ hostvars[host].flavor }}" | ||
key_name: "otcinfra-bridge" | ||
availability_zone: "{{ hostvars[host].location.az }}" | ||
region: "{{ hostvars[host].location.region | default(omit) }}" | ||
security_groups: "{{ hostvars[host].security_groups }}" | ||
timeout: 600 | ||
nics: "{{ hostvars[host].nics }}" | ||
boot_from_volume: true | ||
volume_size: "{{ hostvars[host].volume_size | default(omit) }}" | ||
image: "{{ hostvars[host].image }}" | ||
terminate_volume: true | ||
delete_fip: true | ||
auto_ip: "{{ hostvars[host].auto_ip | default(omit) }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
state: present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- name: Destroy security group | ||
openstack.cloud.security_group: | ||
name: "{{ sg.name }}" | ||
state: "{{ state }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
- include: "provision.yaml" | ||
when: "state != 'absent'" | ||
|
||
- include: "destroy.yaml" | ||
when: "state == 'absent'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
- name: Create security group | ||
openstack.cloud.security_group: | ||
name: "{{ sg.name }}" | ||
description: "{{ sg.description | default(omit) }}" | ||
register: secur_group | ||
|
||
- name: Add rules | ||
openstack.cloud.security_group_rule: | ||
security_group: "{{ secur_group.secgroup.id }}" | ||
description: "{{ sg.description | default(omit) }}" | ||
protocol: "{{ item.protocol }}" | ||
port_range_min: "{{ item.port_range_min | default(omit) }}" | ||
port_range_max: "{{ item.port_range_max | default(omit) }}" | ||
remote_ip_prefix: "{{ item.remote_ip_prefix | default(omit) }}" | ||
remote_group: "{{ item.remote_group | default(omit) }}" | ||
direction: "{{ item.direction | default(omit) }}" | ||
|
||
loop: "{{ sg.rules }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters