-
Notifications
You must be signed in to change notification settings - Fork 1
/
CLC_RHEL7x_Create-Servers-In-Control-playbook.yml
40 lines (33 loc) · 1.61 KB
/
CLC_RHEL7x_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
---
################################################################################
# description: Ensure a specific server group exists in Control in CenturyLink Cloud
# usage: ansible-playbook CLC_RHEL7x_Create-Servers-In-Control-playbook.yml --extra-vars 'DC=VA1 Password=SomePassword! Name=rh7t Description=RHEL7x Count=2 Group=RHEL7'
# 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 ('RHEL-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