Wolfgang Kulhanek
2018-04-20 097d643c9a73c79b9a8b8affc2f1cf41539277ae
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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
## 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.
###### VARIABLES YOU SHOULD CONFIGURE FOR YOUR DEPLOYEMNT
###### OR PASS as "-e" args to ansible-playbook command
# #
# # env_groups:
# #   limit: "tag_Project_opentlc_shared_{{guid}}"
# #   bastions: "tag_AnsibleGroup_bastions"
# #   masters: "tag_AnsibleGroup_masters"
# #   nodes: "tag_AnsibleGroup_nodes"
# #   infranodes: "tag_AnsibleGroup_infranodes"
# #   nfs: "tag_AnsibleGroup_nfs"
#
# # This doesn't work
# all: "tag_Project_opentlc_shared_{{guid}}"
 
reverse_proxy: true
# # but maybe this is silly enough to work
# #all: "tag_Project_opentlc_shared_{{guid}}:&tag_Project_opentlc_shared_{{guid}}"
#rhn_pool_id_string: OpenShift Container Platform
# bastions: "{{env_groups['limit']}}:&{{env_groups['bastions']}}"
# masters: "{{env_groups['limit']}}:&{{env_groups['masters']}}"
# nodes: "{{env_groups['limit']}}:&{{env_groups['nodes']}}"
# infranodes: "{{env_groups['limit']}}:&{{env_groups['infranodes']}}"
# nfs: "{{env_groups['limit']}}:&{{env_groups['nfs']}}"
install_ipa_client: false
repo_method: file
ocp_pvs:
  # - es-storage
  # - nexus
  # - nexus2
  # - nexus3
config_nfs_uservols: "true"
user_vols: 200
user_vols_size: 4Gi
master_api_port: 443
osrelease: 3.7.42
openshift_master_overwrite_named_certificates: true
deploy_openshift: true
deploy_openshift_post: true
deploy_env_post: true
install_metrics: true
install_logging: true
ovs_plugin: "subnet" # This can also be set to: "multitenant"
multi_tenant_setting: "os_sdn_network_plugin_name='redhat/openshift-ovs-{{ovs_plugin}}'"
master_lb_dns: "loadbalancer1.{{subdomain_base}}"
cloudapps_suffix: 'apps.{{subdomain_base}}'
openshift_master_ldap_ca_file: 'openshift_master_ldap_ca_file=/root/ca.crt'
# htpasswd / ldap / allow_all
install_idm: htpasswd
 
 ## If you are not part of GPTE you don't need this.
opentlc_integration: true
 
################################################################################
#### GENERIC EXAMPLE
################################################################################
 
install_common: true
install_nfs: true
install_bastion: false
env_authorized_key: "{{guid}}key"
set_env_authorized_key: true
software_to_deploy: "openshift"
################################################################################
#### OCP IMPLEMENATATION LAB
################################################################################
 
repo_version: '3.7'
cloudapps_dns: '*.apps.{{subdomain_base}}.'
master_public_dns: "loadbalancer.{{subdomain_base}}."
 
################################################################################
#### Common host variables
################################################################################
 
update_packages: false
common_packages:
  - python
  - unzip
  - bash-completion
  - tmux
  - bind-utils
  - wget
  - git
  - vim-enhanced
  - ansible
 
rhel_repos:
  - rhel-7-server-rpms
  - rhel-7-server-extras-rpms
  - rhel-7-server-ose-{{repo_version}}-rpms
 
use_subscription_manager: false
use_own_repos: true
#rhn_pool_id_string: "Red Hat Enterprise Linux Server"
rhn_pool_id_string: OpenShift Container Platform
 
################################################################################
#### nfs host settings
################################################################################
 
nfs_vg: nfsvg
nfs_pvs: /dev/xvdb
nfs_export_path: /srv/nfs
nfs_size: 50
 
nfs_shares:
  # - jenkins
  # - nexus
 
################################################################################
#### CLOUD PROVIDER: AWS SPECIFIC VARIABLES
################################################################################
 
#### Route 53 Zone ID (AWS)
HostedZoneId: ''
key_name: ''
aws_region: us-east-1
 
admin_user: ''
admin_user_password: ''
 
#### Connection Settings
ansible_ssh_user: ec2-user
remote_user: ec2-user
 
#### Networking (AWS)
guid: defaultguid
subdomain_base_short: "{{ guid }}"
subdomain_base_suffix: ".example.opentlc.com"
subdomain_base: "{{subdomain_base_short}}{{subdomain_base_suffix}}"
tower_run: false
 
#### Environment Sizing
 
#bastion_instance_type: "t2.micro"
bastion_instance_type: "t2.large"
 
isolated_instance_type: "t2.medium"
isolated_instance_count: 1
 
support_instance_type: "t2.medium"
support_instance_count: 1
 
node_instance_type: "t2.large"
node_instance_count: 3
 
infranode_instance_type: "t2.large"
infranode_instance_count: 2
 
master_instance_type: "t2.large"
master_instance_count: 3
 
loadbalancer_instance_count: 1
loadbalancer_instance_type: "t2.small"
 
# scaleup
new_node_instance_count: 0
 
ansible_ssh_private_key_file: ~/.ssh/{{key_name}}.pem
 
 
#### VARIABLES YOU SHOULD ***NOT*** CONFIGURE FOR YOUR DEPLOYEMNT
#### You can, but you usually wouldn't need to.
 
#### CLOUDFORMATIONS vars
 
project_tag: "{{ env_type }}-{{ guid }}"
 
docker_version: "{{ '1.12.6' if repo_version | version_compare('3.9', '<')  else '1.13.1' }}"
docker_device: /dev/xvdb
 
create_internal_dns_entries: true
zone_internal_dns: "{{guid}}.internal."
chomped_zone_internal_dns: "{{guid}}.internal"
zone_public_dns: "{{subdomain_base}}."
 
bastion_public_dns: "bastion.{{subdomain_base}}."
bastion_public_dns_chomped: "bastion.{{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 }} template"
 
rootfs_size_node: 50
rootfs_size_infranode: 50
rootfs_size_master: 50
rootfs_size_bastion: 20
rootfs_size_isolated: 20
rootfs_size_support: 20
rootfs_size_loadbalancer: 20
 
 
security_groups:
  - name: LBSG
    rules:
      - name: LBHTTP
        description: "HTTP for public"
        from_port: 80
        to_port: 80
        protocol: tcp
        cidr: "0.0.0.0/0"
        rule_type: Ingress
      - name: LBHTTPS
        description: "HTTPS for public"
        from_port: 443
        to_port: 443
        protocol: tcp
        cidr: "0.0.0.0/0"
        rule_type: Ingress
      - name: LBHTTPSALT
        description: "Alt HTTPS for public"
        from_port: 8443
        to_port: 8443
        protocol: tcp
        cidr: "0.0.0.0/0"
        rule_type: Ingress
      - name: LBSSH
        description: "SSH from Bastion"
        from_port: 22
        to_port: 22
        protocol: tcp
        from_group: BastionSG
        rule_type: Ingress
      - name: LBEGRESStoAll
        description: "Egress to Private"
        from_port: 0
        to_port: 65535
        protocol: tcp
        cidr: "192.168.2.0/24"
        rule_type: Egress
      - name: LBEGRESSIsolatedHTTP
        description: "HTTP Egress Isolated"
        from_port: 80
        to_port: 80
        protocol: tcp
        from_group: ISOLATEDSG
        rule_type: Egress
  - name: BastionSG
    rules:
      - name: MoshPublic
        description: "Public Mosh Access for bastions"
        from_port: 60000
        to_port: 60001
        protocol: udp
        cidr: "0.0.0.0/0"
        rule_type: Ingress
      - name: SSHPublic
        description: "Public Access for bastions"
        from_port: 22
        to_port: 22
        protocol: tcp
        cidr: "0.0.0.0/0"
        rule_type: Ingress
  - name: MasterSG
    rules:
      - name: HTTPS
        description: "HTTPS from LB"
        from_port: 443
        to_port: 443
        protocol: tcp
        from_group: LBSG
        rule_type: Ingress
      - name: HTTPSALT
        description: "HTTPS 8443 LB"
        from_port: 8443
        to_port: 8443
        protocol: tcp
        from_group: LBSG
        rule_type: Ingress
      - name: MasterSSH
        description: "SSH from Bastion"
        from_port: 22
        to_port: 22
        protocol: tcp
        from_group: BastionSG
        rule_type: Ingress
      - name: MasterIngressPrivate
        description: "Ingress Private"
        from_port: 0
        to_port: 65535
        protocol: -1
        cidr: "192.168.2.0/24"
        rule_type: Ingress
      - name: MasterEGRESSPrivate
        description: "Egress Private"
        from_port: 0
        to_port: 65535
        protocol: -1
        cidr: "192.168.2.0/24"
        rule_type: Egress
      - name: MasterEGRESSIsolatedHTTPproxy
        description: "HTTP Proxy Egress Isolated"
        from_port: 8080
        to_port: 8080
        protocol: tcp
        from_group: ISOLATEDSG
        rule_type: Egress
      - name: MasterEGRESSIsolatedHTTP
        description: "HTTP Egress Isolated"
        from_port: 80
        to_port: 80
        protocol: tcp
        from_group: ISOLATEDSG
        rule_type: Egress
      - name: MasterEGRESSIsolatedREGISTRY
        description: "Registry Egress Isolated"
        from_port: 5000
        to_port: 5000
        protocol: tcp
        from_group: ISOLATEDSG
        rule_type: Egress
      - name: MasterEGRESSLBHTTP
        description: "HTTP Egress To LB"
        from_port: 80
        to_port: 80
        protocol: tcp
        from_group: LBSG
        rule_type: Egress
      - name: MasterEGRESSLBHTTPS
        description: "HTTPSEgress To LB"
        from_port: 443
        to_port: 443
        protocol: tcp
        from_group: LBSG
        rule_type: Egress
  - name: InfraNodeSG
    rules:
      - name: InfraEGRESSIsolatedHTTP
        description: "HTTP Egress Isolated"
        from_port: 80
        to_port: 80
        protocol: tcp
        from_group: ISOLATEDSG
        rule_type: Egress
      - name: InfraEGRESSIsolatedHTTPproxy
        description: "HTTP Proxy Egress Isolated"
        from_port: 8080
        to_port: 8080
        protocol: tcp
        from_group: ISOLATEDSG
        rule_type: Egress
      - name: InfraEGRESSIsolatedREGISTRY
        description: "HTTP Egress Isolated"
        from_port: 5000
        to_port: 5000
        protocol: tcp
        from_group: ISOLATEDSG
        rule_type: Egress
      - name: INFRASSH
        description: "SSH from Bastion"
        from_port: 22
        to_port: 22
        protocol: tcp
        from_group: BastionSG
        rule_type: Ingress
      - name: InfraHTTPS
        description: "HTTPS from LB"
        from_port: 443
        to_port: 443
        protocol: tcp
        from_group: LBSG
        rule_type: Ingress
      - name: InfraHTTP
        description: "HTTP from LB"
        from_port: 80
        to_port: 80
        protocol: tcp
        from_group: LBSG
        rule_type: Ingress
      - name: INFRAIngressPrivate
        description: "Ingress Private"
        from_port: 0
        to_port: 65535
        protocol: -1
        cidr: "192.168.2.0/24"
        rule_type: Ingress
      - name: INFRAEGRESSPrivate
        description: "Egress Private"
        from_port: 0
        to_port: 65535
        protocol: -1
        cidr: "192.168.2.0/24"
        rule_type: Egress
      - name: InfraEGRESSLBHTTP
        description: "HTTP Egress To LB"
        from_port: 80
        to_port: 80
        protocol: tcp
        from_group: LBSG
        rule_type: Egress
      - name: InfraEGRESSLBHTTPSalt
        description: "HTTPS8Egress To LB"
        from_port: 8443
        to_port: 8443
        protocol: tcp
        from_group: LBSG
        rule_type: Egress
      - name: InfraEGRESSLBHTTPS
        description: "HTTPSEgress To LB"
        from_port: 443
        to_port: 443
        protocol: tcp
        from_group: LBSG
        rule_type: Egress
  - name: ISOLATEDSG
    rules:
      # - name: ISOLATEDSSH
      #   description: "SSH from Bastion"
      #   from_port: 22
      #   to_port: 22
      #   protocol: tcp
      #   from_group: BastionSG
      #   rule_type: Ingress
      - name: ISOBASIngress
        description: "Ingress Bastion"
        from_port: 0
        to_port: 65535
        protocol: tcp
        from_group: BastionSG
        rule_type: Ingress
      - name: ISOINFRAIngress
        description: "Ingress from Infra"
        from_port: 0
        to_port: 65535
        protocol: tcp
        from_group: InfraNodeSG
        rule_type: Ingress
      - name: ISONODIngress
        description: "Ingress from Node"
        from_port: 0
        to_port: 65535
        protocol: tcp
        from_group: NodeSG
        rule_type: Ingress
      - name: ISOLBIngress
        description: "Ingress from loadbalancer"
        from_port: 0
        to_port: 65535
        protocol: tcp
        from_group: LBSG
        rule_type: Ingress
      - name: ISOMasterIngress
        description: "Ingress from master"
        from_port: 0
        to_port: 65535
        protocol: tcp
        from_group: MasterSG
        rule_type: Ingress
      - name: ISOSupportIngress
        description: "Ingress from support"
        from_port: 0
        to_port: 65535
        protocol: tcp
        from_group: SUPPORTSG
        rule_type: Ingress
      - name: ISOBASIngressUDP
        description: "Ingress UDP Bastion"
        from_port: 0
        to_port: 65535
        protocol: udp
        from_group: BastionSG
        rule_type: Ingress
      - name: ISOINFRAIngressUDP
        description: "Ingress UDP from Infra"
        from_port: 0
        to_port: 65535
        protocol: udp
        from_group: InfraNodeSG
        rule_type: Ingress
      - name: ISONODIngressUDP
        description: "Ingress UDP from Node"
        from_port: 0
        to_port: 65535
        protocol: udp
        from_group: NodeSG
        rule_type: Ingress
      - name: ISOLBIngressUDP
        description: "Ingress UDP from loadbalancer"
        from_port: 0
        to_port: 65535
        protocol: udp
        from_group: LBSG
        rule_type: Ingress
      - name: ISOMasterIngressUDP
        description: "Ingress UDP from master"
        from_port: 0
        to_port: 65535
        protocol: udp
        from_group: MasterSG
        rule_type: Ingress
      - name: ISOSupportIngressUDP
        description: "Ingress UDP from support"
        from_port: 0
        to_port: 65535
        protocol: udp
        from_group: SUPPORTSG
        rule_type: Ingress
  - name: SUPPORTSG
    rules:
      - name: SUPPORTSSH
        description: "SSH from Bastion"
        from_port: 22
        to_port: 22
        protocol: tcp
        from_group: BastionSG
        rule_type: Ingress
      - name: SUPPPORTIngress
        description: "Support Private Ingress"
        from_port: 0
        to_port: 65535
        protocol: -1
        cidr: "192.168.2.0/24"
        rule_type: Ingress
      - name: SUPPPORTEGRESS
        description: "Support Private Egress"
        from_port: 0
        to_port: 65535
        protocol: -1
        cidr: "192.168.2.0/24"
        rule_type: Egress
      - name: SupportEGRESSIsolatedHTTP
        description: "HTTP Egress Isolated"
        from_port: 80
        to_port: 80
        protocol: tcp
        from_group: ISOLATEDSG
        rule_type: Egress
  - name: NodeSG
    rules:
      - name: NodeEGRESSIsolatedHTTP
        description: "HTTP Egress Isolated"
        from_port: 80
        to_port: 80
        protocol: tcp
        from_group: ISOLATEDSG
        rule_type: Egress
      - name: NodeEGRESSIsolatedHTTPproxy
        description: "HTTP Proxy Egress Isolated"
        from_port: 8080
        to_port: 8080
        protocol: tcp
        from_group: ISOLATEDSG
        rule_type: Egress
      - name: NodeEGRESSIsolatedREGISTRY
        description: "HTTP Egress Isolated"
        from_port: 5000
        to_port: 5000
        protocol: tcp
        from_group: ISOLATEDSG
        rule_type: Egress
      - name: NODESSH
        description: "SSH from Bastion"
        from_port: 22
        to_port: 22
        protocol: tcp
        from_group: BastionSG
        rule_type: Ingress
      - name: NodeIngressPrivate
        description: "Ingress Private"
        from_port: 0
        to_port: 65535
        protocol: -1
        cidr: "192.168.2.0/24"
        rule_type: Ingress
      - name: NodeEGRESSPrivate
        description: "Egress Private"
        from_port: 0
        to_port: 65535
        protocol: -1
        cidr: "192.168.2.0/24"
        rule_type: Egress
      - name: NodeEGRESSLBHTTP
        description: "HTTP Egress To LB"
        from_port: 80
        to_port: 80
        protocol: tcp
        from_group: LBSG
        rule_type: Egress
      - name: NodeEGRESSLBHTTPS
        description: "HTTPSEgress To LB"
        from_port: 443
        to_port: 443
        protocol: tcp
        from_group: LBSG
        rule_type: Egress
      - name: NodeEGRESSLBHTTPSAtl
        description: "HTTPSAltEgress To LB"
        from_port: 8443
        to_port: 8443
        protocol: tcp
        from_group: LBSG
        rule_type: Egress
 
 
 
 
 
 
 
# security_groups:
#   - name: PublicSG
#     rules:
#       - name: HTTP
#         description: "Public Access for Infranode"
#         from_port: 80
#         to_port: 80
#         protocol: tcp
#         cidr: "0.0.0.0/0"
#         rule_type: Ingress
#       - name: HTTPS
#         description: "Public Access for Infranode"
#         from_port: 443
#         to_port: 443
#         protocol: tcp
#         cidr: "0.0.0.0/0"
#         rule_type: Ingress
#       - name: SSHPublic
#         description: "Public Access for Infranode"
#         from_port: 22
#         to_port: 22
#         protocol: tcp
#         cidr: "0.0.0.0/0"
#         rule_type: Ingress
#   - name: MasterSG
#     rules:
#       - name: DNSTCP
#         description: "TCP Ports for DNS"
#         from_port: 53
#         to_port: 53
#         protocol: tcp
#         from_group: NodeSG
#         rule_type: Ingress
#       - name: DNSUDP
#         description: "UDP Ports for DNS"
#         protocol: udp
#         from_port: 53
#         to_port: 53
#         from_group: NodeSG
#         rule_type: Ingress
#       - name:  SDN
#         description: "SDN Communication"
#         from_port: 4789
#         to_port: 4789
#         protocol: udp
#         from_group: NodeSG
#         rule_type: Ingress
#       - name: HTTPSAccess
#         description: "HTTPS Access"
#         protocol: tcp
#         from_port: 443
#         to_port: 443
#         cidr: "0.0.0.0/0"
#         rule_type: Ingress
#       - name: SSHPublic
#         description: "Public Access for Infranode"
#         from_port: 22
#         to_port: 22
#         protocol: tcp
#         cidr: "0.0.0.0/0"
#         rule_type: Ingress
#   - name: NodeSG
#     rules:
#       - name: Kubelet
#         description: "Kubelet for OC"
#         from_port: 10250
#         to_port: 10250
#         protocol: tcp
#         from_group: MasterSG
#         rule_type: Ingress
#       - name:  SDN
#         description: "SDN Communication"
#         from_port: 4789
#         to_port: 4789
#         from_group: MasterSG
#         protocol: udp
#         rule_type: Ingress
#       - name: SSHPublic
#         description: "Public Access for Infranode"
#         from_port: 22
#         to_port: 22
#         protocol: tcp
#         cidr: "0.0.0.0/0"
#         rule_type: Ingress
 
subnets:
  - name: PublicSubnet
    cidr: "192.168.1.0/24"
    routing_table: true
  - name: PrivateSubnet
    cidr: "192.168.2.0/24"
    routing_table: false # this could be wrong [sborenst]
 
 
instances:
  - name: "bastion"
    count: 1
    unique: true
    public_dns: true
    dns_loadbalancer: true
    flavor:
      "ec2": "{{bastion_instance_type}}"
    tags:
      - key: "AnsibleGroup"
        value: "bastions"
      - key: "ostype"
        value: "linux"
    rootfs_size: "{{ rootfs_size_bastion }}"
    security_group: "BastionSG"
    subnet: "PublicSubnet"
 
  - name: "loadbalancer"
    count: "{{loadbalancer_instance_count}}"
    public_dns: true
    dns_loadbalancer: true
    flavor:
      "ec2": "{{loadbalancer_instance_type}}"
    tags:
      - key: "AnsibleGroup"
        value: "loadbalancers"
      - key: "ostype"
        value: "linux"
    rootfs_size: "{{ rootfs_size_loadbalancer }}"
    security_group: "LBSG"
    subnet: "PublicSubnet"
 
  - name: "master"
    count: "{{master_instance_count}}"
    public_dns: false
    dns_loadbalancer: false
    flavor:
      "ec2": "{{master_instance_type}}"
    tags:
      - key: "AnsibleGroup"
        value: "masters"
      - key: "ostype"
        value: "linux"
    rootfs_size: "{{ rootfs_size_master }}"
    volumes:
      - device_name: "{{docker_device}}"
        volume_size: 20
        volume_type: gp2
    security_group: "MasterSG"
    subnet: "PrivateSubnet"
 
  - name: "node"
    count: "{{node_instance_count}}"
    public_dns: false
    dns_loadbalancer: false
    flavor:
      "ec2": "{{node_instance_type}}"
    tags:
      - key: "AnsibleGroup"
        value: "nodes"
      - key: "ostype"
        value: "linux"
    rootfs_size: "{{ rootfs_size_node }}"
    volumes:
      - device_name: "{{docker_device}}"
        volume_size: 100
        volume_type: gp2
    security_group: "NodeSG"
    subnet: "PrivateSubnet"
 
  - name: "infranode"
    count: "{{infranode_instance_count}}"
    public_dns: true
    dns_loadbalancer: true
    flavor:
      "ec2": "{{infranode_instance_type}}"
    tags:
      - key: "AnsibleGroup"
        value: "infranodes"
      - key: "ostype"
        value: "linux"
    rootfs_size: "{{ rootfs_size_infranode }}"
    volumes:
      - device_name: "{{docker_device}}"
        volume_size: 50
        volume_type: gp2
    security_group: "InfraNodeSG"
    subnet: "PrivateSubnet"
 
  - name: "support"
    count: "{{support_instance_count}}"
    public_dns: false
    dns_loadbalancer: false
    flavor:
      "ec2": "{{support_instance_type}}"
    tags:
      - key: "AnsibleGroup"
        value: "support"
      - key: "ostype"
        value: "linux"
    rootfs_size: "{{ rootfs_size_support }}"
    volumes:
      - device_name: "{{nfs_pvs}}"
        volume_size: "{{nfs_size}}"
        volume_type: gp2
    security_group: "SUPPORTSG"
    subnet: "PrivateSubnet"
 
  - name: "isolated"
    count: "{{isolated_instance_count}}"
    public_dns: false
    dns_loadbalancer: false
    flavor:
      "ec2": "{{isolated_instance_type}}"
    tags:
      - key: "AnsibleGroup"
        value: "isolated"
      - key: "ostype"
        value: "linux"
    rootfs_size: "{{ rootfs_size_isolated }}"
    volumes:
      - device_name: "{{nfs_pvs}}"
        volume_size: "{{nfs_size}}"
        volume_type: gp2
    security_group: "ISOLATEDSG"
    subnet: "PublicSubnet"