-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSample-Store-Ansible.yml
155 lines (155 loc) · 4.14 KB
/
Sample-Store-Ansible.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
---
- name: Gather Info
hosts: all
connection: ansible.builtin.local
gather_facts: false
vars_prompt:
#variables
- name: username
prompt: Enter authentication username
private: false
- name: password
prompt: Enter authenticaion password
private: yes
- name: server
prompt: Enter store number
private: false
tasks:
#Configure_DNS
- name: DNS
scale_computing.hypercore.dns_config:
cluster_instance:
host: "https://{{ inventory_hostname }}"
username: "{{ scale_user }}"
password: "{{ scale_pass }}"
search_domains:
- royalfarms.com
dns_servers:
- 10.2.{{Server}}.1
- 10.7.{{Server}}.4
state: set
register: dns
with_items: [1,2]
- debug:
var: dns
#Import Site Controller
- name: Site Controller Import
scale_computing.hypercore.vm_import:
cluster_instance:
host: "https://{{ inventory_hostname }}"
username: "{{ scale_user }}"
password: "{{ scale_pass }}"
vm_name: "RF{{ server }}Site-Controller"
smb:
server: smb.server.address.local
path: '/Templates/RF-Site-Controller-Template'
file_name: RF-Site-Controller-Template.xml
username: "{{ username }}"
password: "{{ password }}"
register: site-controller
- name: Site-Controller Results
ansible.builtin.debug:
msg: "{{ site-controller.msg }}"
#Configure Cluster Name
- name: Configure Cluster Name
scale_computing.hypercore.cluster_name:
cluster_instance:
host: "https://{{ inventory_hostname }}"
username: "{{ scale_user }}"
password: "{{ scale_pass }}"
name_new: Store {{ server }} Cluster
register: cluster
- name: Cluster Name Results
ansible.builtin.debug:
msg: "{{ cluster.record.name }}"
#Configure Snapshot Schedule
- name: Configure Site Controller Snapshot Schedule
scale_computing.hypercore.snapshot_schedule:
cluster_instance:
host: "https://{{ inventory_hostname }}"
username: "{{ scale_user }}"
password: "{{ scale_pass }}"
name: Site-controller Backup
state: present
recurrences:
- name: Site-Controller Backup
frequency: "FREQ=DAILY;INTERVAL=1" #once per day
start: "2010-01-01 04:00:00" #start time
local_retention: "{{ 2 * 24*60*60 }}" #2 days
remote_retention: "0"
register: SC-Snapshot
- name: Snapshot Result
ansible.builtin.debug:
msg: "{{ SC-Snapshot.record }}"
#SMTP Configuration
- name: Configure SMTP
scale_computing.hypercore.smtp:
cluster_instance:
host: "https://{{ inventory_hostname }}"
username: "{{ scale_user }}"
password: "{{ scale_pass }}"
from_address: "{{ server }}_Cluster@royalfarms.com"
port: 25
server: smtp.royalfarms.com
use_ssl: false
register: SMTP
- name: SMTP Results
ansible.builtin.debug:
msg: "{{ SMTP.record }}"
#Set Site Controller Snapshot Schedule
- name: Set Site-Controller Snapshot Schedule
scale_computing.hypercore.vm_params:
cluster_instance:
host: "https://{{ inventory_hostname }}"
username: "{{ scale_user }}"
password: "{{ scale_pass }}"
vm_name: ST{{ server }}Site-Controller
snapshot_schedule: "Site-Controller Backup"
#Time Zone Configuration
- name: Configure Timezone
scale_computing.hypercore.time_zone:
cluster_instance:
host: "https://{{ inventory_hostname }}"
username: "{{ scale_user }}"
password: "{{ scale_pass }}"
zone: "America/New York"
register: timezone
- name: Timezone Result
ansible.builtin.debug:
msg: "{{ timezone.record }}"
#Time Server Configuration
- name: Configure Time Server
scale_computing.hypercore.time_server:
cluster_instance:
host: "https://{{ inventory_hostname }}"
username: "{{ scale_user }}"
password: "{{ scale_pass }}"
source: pool.ntp.org
register: timeserver
- name: Time Server Result
ansible.builtin.debug:
msg: "{{ timeserver.record }}"