Tony Kay
2020-03-02 8c2cbe14d79deffc7e22f14c2a2b2301ab24a45a
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
---
## TODO: What variables can we strip out of here to build complex variables?
## i.e. what can we add into group_vars as opposed to config_vars?
## Example: We don't really need "subdomain_base_short". If we want to use this,
## should just toss in group_vars/all.
### Also, we should probably just create a variable reference in the README.md
### For now, just tagging comments in line with configuration file.
 
### Vars that can be removed:
# use_satellite: true
# use_subscription_manager: false
# use_own_repos: false
 
###### VARIABLES YOU SHOULD CONFIGURE FOR YOUR DEPLOYEMNT
###### OR PASS as "-e" args to ansible-playbook command
 
 
 
### Common Host settings
 
repo_method: file # Other Options are: file, satellite and rhn
windows_password: 'jVMijRwLbI02gFCo2xkjlZ9lxEA7bm7zgg=='
tower_admin_password: 'r3dh4t1!'
# Do you want to run a full yum update
update_packages: false
#If using repo_method: satellite, you must set these values as well.
# satellite_url: satellite.example.com
# satellite_org: Sat_org_name
# satellite_activationkey: "rhel7basic"
 
## guid is the deployment unique identifier, it will be appended to all tags,
## files and anything that identifies this environment from another "just like it"
guid: defaultguid
 
install_bastion: true
install_common: true
install_ipa_client: false
## SB Don't set software_to_deploy from here, always use extra vars (-e) or "none" will be used
#software_to_deploy: none
 
repo_version: "3.6"
osrelease: 3.6
 
### If you want a Key Pair name created and injected into the hosts,
# set `set_env_authorized_key` to true and set the keyname in `env_authorized_key`
# you can use the key used to create the environment or use your own self generated key
# if you set "use_own_key" to false your PRIVATE key will be copied to the bastion. (This is {{key_name}})
use_own_key: true
env_authorized_key: "{{guid}}key"
ansible_ssh_private_key_file: ~/.ssh/{{key_name}}.pem
set_env_authorized_key: true
# Is this running from Red Hat Ansible Tower
tower_run: false
 
### FTL settings
 
install_ftl: false
 
 
### AWS EC2 Environment settings
 
### Route 53 Zone ID (AWS)
# This is the Route53 HostedZoneId where you will create your Public DNS entries
# This only needs to be defined if your CF template uses route53
HostedZoneId: Z3IHLWJZOU9SRT
# The region to be used, if not specified by -e in the command line
aws_region: ap-southeast-2
# The key that is used to
key_name: "default_key_name"
 
## Networking (AWS)
subdomain_base_short: "{{ guid }}"
subdomain_base_suffix: ".example.opentlc.com"
subdomain_base: "{{subdomain_base_short}}{{subdomain_base_suffix}}"
 
## Environment Sizing
 
bastion_instance_type: "t2.medium"
 
support_instance_count: 1
support_instance_type: "t2.medium"
 
activedirectory_instance_count: 1
activedirectory_instance_type: "t2.large"
 
subnets:
  - name: PublicSubnet
    cidr: "192.168.1.0/24"
    routing_table: true
 
security_groups:
  - name: BastionSG
    rules:
      - name: BasSSHPublic
        description: "SSH public"
        from_port: 22
        to_port: 22
        protocol: tcp
        cidr: "0.0.0.0/0"
        rule_type: Ingress
  - name: WINSG
    rules:
      - name: WINPortsTCP
        description: "Win tcp"
        from_port: 0
        to_port: 65535
        protocol: tcp
        cidr: "0.0.0.0/0"
        rule_type: Ingress
      - name: WINPortsUdp
        description: "Win udp"
        from_port: 0
        to_port: 65535
        protocol: udp
        cidr: "0.0.0.0/0"
        rule_type: Ingress
  - name: HostSG
    rules:
      - name: HostSSHPublic
        description: "SSH public"
        from_port: 22
        to_port: 22
        protocol: tcp
        cidr: "0.0.0.0/0"
        rule_type: Ingress
      - name: HostUDPPorts
        description: "Only from Itself udp"
        from_port: 0
        to_port: 65535
        protocol: udp
        group: HostSG
        rule_type: Ingress
      - name: HostTCPPorts
        description: "Only from Itself tcp"
        from_port: 0
        to_port: 65535
        protocol: tcp
        group: HostSG
        rule_type: Ingress
      - name: BastionUDPPorts
        description: "Only from bastion"
        from_port: 0
        to_port: 65535
        protocol: udp
        group: BastionSG
        rule_type: Ingress
      - name: BastionTCPPorts
        description: "Only from bastion"
        from_port: 0
        to_port: 65535
        protocol: tcp
        group: BastionSG
        rule_type: Ingress
 
instances:
  - name: "ad"
    count: "{{activedirectory_instance_count}}"
    public_dns: true
    security_group: "WINSG"
    flavor:
      "ec2": "{{activedirectory_instance_type}}"
    image_id: WIN2012R2AMI
    UserData: |
         UserData:
                "Fn::Base64":
                   "Fn::Join":
                     - ""
                     - - "<powershell>\n"
                       - "$admin = [adsi]('WinNT://./administrator, user')\n"
                       - "$admin.PSBase.Invoke('SetPassword', '{{windows_password}}')\n"
                       - "$scriptPath=((New-Object System.Net.Webclient).DownloadString('https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1'))\n"
                       - "Invoke-Command -ScriptBlock ([scriptblock]::Create($scriptPath)) -ArgumentList '-skipNetworkProfileCheck'\n"
                       - "</powershell>"
    tags:
      - key: "AnsibleGroup"
        value: "activedirectories,windows"
      - key: "ostype"
        value: "windows"
 
 
  - name: "support"
    count: "{{support_instance_count}}"
    public_dns: true
    security_group: "HostSG"
    flavor:
      "ec2": "{{support_instance_type}}"
    tags:
      - key: "AnsibleGroup"
        value: "support"
      - key: "ostype"
        value: "rhel"
    key_name: "{{key_name}}"
 
# - name: "frontend"
#   count: "{{frontend_instance_count}}"
#   public_dns: true
#   security_group: "HostSG"
#   dns_loadbalancer: true
#   flavor:
#     "ec2": "{{frontend_instance_type}}"
#   tags:
#     - key: "AnsibleGroup"
#       value: "frontends"
#     - key: "ostype"
#       value: "linux"
# - name: "app"
#   count: "{{app_instance_count}}"
#   public_dns: true
#   security_group: "HostSG"
#   flavor:
#     "ec2": "{{app_instance_type}}"
#   tags:
#     - key: "AnsibleGroup"
#       value: "apps"
#     - key: "ostype"
#       value: "rhel"
#   key_name: "{{key_name}}"
# - name: "appdb"
#   count: "{{appdb_instance_count}}"
#   public_dns: true
#   security_group: "HostSG"
#   flavor:
#     "ec2": "{{appdb_instance_type}}"
#   tags:
#     - key: "AnsibleGroup"
#       value: "appdbs"
#     - key: "ostype"
#       value: "rhel"
#   key_name: "{{key_name}}"
 
install_win_ssh: false
install_win_ad: false
 
###### VARIABLES YOU SHOULD ***NOT*** CONFIGURE FOR YOUR DEPLOYEMNT
###### You can, but you usually wouldn't need to.
ansible_user: ec2-user
remote_user: ec2-user
 
common_packages:
  - python
  - unzip
  - bash-completion
  - tmux
  - bind-utils
  - wget
  - git
  - vim-enhanced
  - at
  - python-pip
  - gcc
 
 
rhel_repos:
  - rhel-7-server-rpms
  - rhel-7-server-extras-rpms
  - epel-release-latest-7
 
## Currently there is no NFS created for this Environment - See ocp-workshop for clues.
# ## NFS Server settings
# nfs_vg: nfsvg
# nfs_pvs: /dev/xvdb
# nfs_export_path: /srv/nfs
#
# nfs_shares:
#   - es-storage
#   - user-vols
#   - jenkins
#   - nexus
#   - nexus2
 
project_tag: "{{ env_type }}-{{ guid }}"
 
zone_internal_dns: "{{guid}}.internal."
chomped_zone_internal_dns: "{{guid}}.internal"
 
cloudapps_dns: '*.apps.{{subdomain_base}}.'
tower_public_dns: "towerlb.{{subdomain_base}}."
 
#tower_public_dns: "tower.{{subdomain_base}}."
bastion_public_dns: "bastion.{{subdomain_base}}."
bastion_public_dns_chomped: "bastion.{{subdomain_base}}"
# we don't use this anymore <sborenst>
# activedirectory_public_dns: "ad.{{subdomain_base}}."
# activedirectory_public_dns_chomped: "ad.{{subdomain_base}}"
 
vpcid_cidr_block: "192.168.0.0/16"
vpcid_name_tag: "{{subdomain_base}}"
 
az_1_name: "{{ aws_region }}a"
az_2_name: "{{ aws_region }}b"
 
subnet_private_1_cidr_block: "192.168.2.0/24"
subnet_private_1_az: "{{ az_2_name }}"
subnet_private_1_name_tag: "{{subdomain_base}}-private"
 
subnet_private_2_cidr_block: "192.168.1.0/24"
subnet_private_2_az: "{{ az_1_name }}"
subnet_private_2_name_tag: "{{subdomain_base}}-private"
 
subnet_public_1_cidr_block: "192.168.10.0/24"
subnet_public_1_az: "{{ az_1_name }}"
subnet_public_1_name_tag: "{{subdomain_base}}-public"
 
subnet_public_2_cidr_block: "192.168.20.0/24"
subnet_public_2_az: "{{ az_2_name }}"
subnet_public_2_name_tag: "{{subdomain_base}}-public"
 
dopt_domain_name: "{{ aws_region }}.compute.internal"
 
rtb_public_name_tag: "{{subdomain_base}}-public"
rtb_private_name_tag: "{{subdomain_base}}-private"
 
 
cf_template_description: "{{ env_type }}-{{ guid }} Ansible Agnostic Deployer "
 
 
secret_dir: "~/secrets"