-
Notifications
You must be signed in to change notification settings - Fork 1
/
CLC_Create-Servers-In-Control-playbook.yml
41 lines (34 loc) · 1.67 KB
/
CLC_Create-Servers-In-Control-playbook.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
---
################################################################################
# description: Ensure a specific server group exists in Control in CenturyLink Cloud
# usage: ansible-playbook CLC_Create-Servers-In-Control-playbook.yml'
# example: ansible-playbook CLC_Create-Servers-In-Control-playbook.yml --extra-vars 'DC=VA1 Password=P@$$W0rd! Name=DCKR Description=Docker Count=6 Group=Docker'
# author: Ernest G. Wilson II <ErnestGWilsonII@gmail.com> (https://github.com/ernestgwilsonii)
# license: MIT
################################################################################
# Ansible Playbook options
# REF: http://docs.ansible.com/ansible/playbooks.html
#####################################################
- name: Ensure servers exist in Control
hosts: localhost
gather_facts: False
connection: local
tasks:
# clc_server - Create, Delete, Start and Stop servers in CenturyLink Cloud
# REF: http://docs.ansible.com/ansible/clc_server_module.html
#############################################################
- name: Create servers
ignore_errors: yes
clc_server:
location: "{{ DC|default ('VA1') }}"
password: "{{ Password|default ('P@$$W0rd!') }}"
name: "{{ Name|default ('DCKRT') }}"
description: "{{ Description|default ('Server') }}"
template: "{{ Template|default ('CENTOS-7-64-TEMPLATE') }}"
count: "{{ Count|default ('1') }}"
group: "{{ Group|default ('Default Group') }}"
cpu: "{{ CPU|default ('4') }}"
memory: "{{ Memory|default ('4') }}"
primary_dns: "{{ DNS1|default ('172.17.1.26') }}"
secondary_dns: "{{ DNS2|default ('172.17.1.27') }}"
wait: True