-
Notifications
You must be signed in to change notification settings - Fork 3
/
TAP.yaml.j2
1258 lines (1161 loc) · 38.1 KB
/
TAP.yaml.j2
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
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
heat_template_version: 2015-04-30
description: |
#### Basic Trusted Analytics Platform
Trusted Analytics Platform (TAP)
parameter_groups:
- label: OpenStack Tenant Settings
parameters:
- tenant_name
- tenant_user
- tenant_pass
- os_api
- label: Network Settings
parameters:
- external_network
- dns
- ntp
- proxy_http
- proxy_https
- proxy_ftp
- proxy_no
- public_ip
- tap_domain
- label: OpenStack Settings
parameters:
- key_pair
- ubuntu_image
{% if (type == 'fullvm') %}
- centos_image
{% endif %}
- label: Cloud Foundry Settings
parameters:
- cloudfoundry_flavor
- cloudfoundry_runners_count
- label: Cloudera Settings
parameters:
{% if (type == 'fullvm') %}
- cloudera_flavor
- cloudera_workers_count
{% elif (type == 'hybrid') %}
- cloudera_cidr
- cloudera_masters
- cloudera_workers
- cloudera_storage_paths
{% endif %}
- label: Logsearch Settings
parameters:
- install_logsearch
- logsearch_deployment_size
- label: SMTP Settings
parameters:
- smtp_host
- smtp_user
- smtp_pass
- smtp_port
- smtp_sender_email
- smtp_sender_name
- label: Quay Settings
parameters:
- quay_io_username
- quay_io_password
parameters:
########################################
# OpenStack Tenant Settings
#
tenant_name:
type: string
label: OpenStack Tenant Name
description: OpenStack Tenant(Project) Name
tenant_user:
type: string
label: OpenStack Tenant User Name
description: OpenStack User Name
tenant_pass:
type: string
label: OpenStack Tenant Password
description: OpenStack Password
hidden: True
os_api:
type: string
label: OpenStack identity API URL
description: OpenStack identity API URL
########################################
#TAP release settings
#
ansible_repo:
type: string
default: https://github.com/trustedanalytics/ansible-playbooks
ansible_branch:
type: string
default: master
########################################
# Network Settings
#
external_network:
type: string
label: External network name
description: External network with floating IP addresses
default: net04_ext
dns:
type: comma_delimited_list
label: DNS Server
description: DNS Server IP
ntp:
type: comma_delimited_list
label: NTP Server
description: NTP Server IP
proxy_http:
type: string
label: HTTP Proxy
description: HTTP Proxy for Internet access
default: ""
proxy_https:
type: string
label: HTTPS Proxy
description: HTTPS Proxy for Internet access
default: ""
proxy_ftp:
type: string
label: FTP Proxy
description: FTP Proxy for Internet access
default: ""
proxy_no:
type: comma_delimited_list
label: No Proxy
description: List of comma separated IPs or domains that should by accessed without proxy server
default: ""
public_ip:
type: string
label: Public IP
description: Public IP for TAP installation
tap_domain:
type: string
label: TAP Domain
description: Domain from TAP installation
########################################
# OpenStack Settings
#
{% if (type == 'fullvm') %}
centos_image:
type: string
label: CentOS VM Image
constraints:
- custom_constraint: glance.image
{% endif %}
ubuntu_image:
type: string
label: Ubuntu VM Image
constraints:
- custom_constraint: glance.image
key_pair:
type: string
label: SSH Key Pair Name
description: SSH Key Pair Name to deploy on JumpHost VM
constraints:
- custom_constraint: nova.keypair
########################################
# CF settings
#
cloudfoundry_flavor:
label: CF Server Size
type: string
description: Server size for Cloud Foundry servers. Recommended 16GB RAM or more.
default: m1.xlarge
constraints:
- allowed_values:
- m1.xlarge
- m1.large
- m1.medium
cloudfoundry_runners_count:
label: CF Runners Count
type: number
default: 2
description: Numbers of Clound Foundry Runners
constraints:
- range: { min: 1, max: 10 }
########################################
# Cloudera settings
#
{% if (type == 'fullvm') %}
cloudera_flavor:
label: Cloudera Servers Size
type: string
description: Server size for the Hadoop Cluster server
constraints:
- custom_constraint: nova.flavor
cloudera_workers_count:
label: CDH Workers count
type: number
default: 3
description: Numbers of CDH Workers servers
constraints:
- range: { min: 3, max: 12 }
{% elif (type == 'hybrid') %}
cloudera_cidr:
label: Cloudera Servers CIDR
type: string
description: Cloudera servers subnet in CIDR format
cloudera_masters:
label: Cloudera Masters
type: comma_delimited_list
description: List of Cloudera Masters IPs separated by commas, last server will by also the Manager
cloudera_workers:
label: Cloudera Workers
type: comma_delimited_list
description: List of Cloudera Workers IPs separated by commas
cloudera_storage_paths:
label: Cloudera Storage Path
type: comma_delimited_list
description: List of data mountpoints on bare metal servers separated by commas. DO NOT ADD LEADING SLASH
{% endif %}
########################################
# Logsearch settings
#
install_logsearch:
label: Install Logsearch
type: string
default: 'false'
description: Enable/Disable Logsearch deployment
constraints:
- allowed_values:
- 'true'
- 'false'
logsearch_deployment_size:
label: Logsearch Deployment Size
type: string
default: small
description: Number of instances Logsearch
constraints:
- allowed_values:
- small
- medium
########################################
# SMTP settings
#
smtp_host:
label: SMTP Host
type: string
description: SMTP Server hostname or IP address
smtp_user:
label: SMTP Username
type: string
default: ""
description: User name for login to SMTP Server
smtp_pass:
label: SMTP Password
type: string
default: ""
description: Password for login to SMTP Server
smtp_port:
label: SMTP Port
type: string
description: SMTP Server port
smtp_sender_email:
label: SMTP sender E-mail
type: string
description: SMTP sender E-Mail address (from address)
smtp_sender_name:
label: SMTP sender name
type: string
description: SMTP sender name (from name)
########################################
# Quay settings
#
quay_io_username:
label: Quay.io username
type: string
description: Quay.io username
default: ""
quay_io_password:
label: Quay.io password
type: string
description: Quay.io password
default: ""
########################################
resources:
########################################
# Private networks
#
router:
type: OS::Neutron::Router
properties:
external_gateway_info:
network: { get_param: external_network }
public_network:
type: OS::Neutron::Net
public_subnet:
type: OS::Neutron::Subnet
properties:
name: PublicSubnet
network_id: { get_resource: public_network }
cidr: 10.0.0.0/24
dns_nameservers:
{ get_param: dns }
router_interface_public:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: router }
subnet: { get_resource: public_subnet }
bosh_network:
type: OS::Neutron::Net
bosh_subnet:
type: OS::Neutron::Subnet
properties:
name: BOSHSubnet
network_id: { get_resource: bosh_network }
cidr: 10.0.1.0/24
dns_nameservers:
{ get_param: dns }
router_interface_bosh:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: router }
subnet: { get_resource: bosh_subnet }
cf_network:
type: OS::Neutron::Net
cf_subnet:
type: OS::Neutron::Subnet
properties:
name: cfSubnet
network_id: { get_resource: cf_network }
cidr: 10.0.2.0/24
dns_nameservers:
{ get_param: dns }
router_interface_cf:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: router }
subnet: { get_resource: cf_subnet }
docker_network:
type: OS::Neutron::Net
docker_subnet:
type: OS::Neutron::Subnet
properties:
name: dockerSubnet
network_id: { get_resource: docker_network }
cidr: 10.0.4.0/24
dns_nameservers:
{ get_param: dns }
router_interface_docker:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: router }
subnet: { get_resource: docker_subnet }
logsearch_network:
type: OS::Neutron::Net
logsearch_subnet:
type: OS::Neutron::Subnet
properties:
name: logsearchSubnet
network_id: { get_resource: logsearch_network }
cidr: 10.0.7.0/24
dns_nameservers:
{ get_param: dns }
router_interface_logsearch:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: router }
subnet: { get_resource: logsearch_subnet }
{% if (type == 'fullvm') %}
cdh_network:
type: OS::Neutron::Net
cloudera_subnet:
type: OS::Neutron::Subnet
properties:
name: ClouderaSubnet
network_id: { get_resource: cdh_network }
cidr: 10.0.5.0/24
dns_nameservers:
{ get_param: dns }
router_interface_cloudera:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: router }
subnet: { get_resource: cloudera_subnet }
{% endif %}
########################################
# Security groups
#
secgroup_jumpbox_ssh:
type: OS::Neutron::SecurityGroup
properties:
name:
list_join: [' ', [ {get_param: 'OS::stack_name' }, 'Bastion SSH' ]]
description: Bastion Security Group
rules:
- protocol: icmp
direction: egress
- protocol: tcp
direction: egress
- protocol: udp
direction: egress
- protocol: tcp
port_range_min: 22
port_range_max: 22
direction: ingress
secgroup_BOSH:
type: OS::Neutron::SecurityGroup
properties:
name:
list_join: [' ', [ {get_param: 'OS::stack_name' }, 'BOSH' ]]
description: BOSH deployed VMs
rules:
- protocol: icmp
direction: egress
- protocol: tcp
direction: egress
- protocol: udp
direction: egress
- protocol: tcp
port_range_min: 22
port_range_max: 22
remote_group_id: { get_resource: secgroup_jumpbox_ssh }
remote_mode: remote_group_id
direction: ingress
- protocol: tcp
port_range_min: 6868
port_range_max: 6868
remote_group_id: { get_resource: secgroup_jumpbox_ssh }
remote_mode: remote_group_id
direction: ingress
- protocol: tcp
port_range_min: 25555
port_range_max: 25555
remote_group_id: { get_resource: secgroup_jumpbox_ssh }
remote_mode: remote_group_id
direction: ingress
- protocol: tcp
remote_group_id: { get_resource: secgroup_cfPublic }
remote_mode: remote_group_id
direction: ingress
port_range_min: 80
port_range_max: 80
- protocol: icmp
remote_ip_prefix: 10.0.1.0/24
remote_mode: remote_ip_prefix
direction: ingress
- protocol: tcp
remote_ip_prefix: 10.0.1.0/24
remote_mode: remote_ip_prefix
direction: ingress
- protocol: udp
remote_ip_prefix: 10.0.1.0/24
remote_mode: remote_ip_prefix
direction: ingress
- protocol: icmp
remote_ip_prefix: 10.0.2.0/24
remote_mode: remote_ip_prefix
direction: ingress
- protocol: tcp
remote_ip_prefix: 10.0.2.0/24
remote_mode: remote_ip_prefix
direction: ingress
- protocol: udp
remote_ip_prefix: 10.0.2.0/24
remote_mode: remote_ip_prefix
direction: ingress
- protocol: icmp
remote_ip_prefix: 10.0.4.0/24
remote_mode: remote_ip_prefix
direction: ingress
- protocol: tcp
remote_ip_prefix: 10.0.4.0/24
remote_mode: remote_ip_prefix
direction: ingress
- protocol: udp
remote_ip_prefix: 10.0.4.0/24
remote_mode: remote_ip_prefix
direction: ingress
- protocol: icmp
remote_ip_prefix: 10.0.7.0/24
remote_mode: remote_ip_prefix
direction: ingress
- protocol: tcp
remote_ip_prefix: 10.0.7.0/24
remote_mode: remote_ip_prefix
direction: ingress
- protocol: udp
remote_ip_prefix: 10.0.7.0/24
remote_mode: remote_ip_prefix
direction: ingress
- protocol: tcp
port_range_min: 9200
port_range_max: 9200
remote_group_id: { get_resource: secgroup_jumpbox_ssh }
remote_mode: remote_group_id
direction: ingress
{% if (type == 'hybrid') %}
- protocol: icmp
remote_ip_prefix: { get_param: cloudera_cidr }
remote_mode: remote_ip_prefix
direction: ingress
- protocol: tcp
remote_ip_prefix: { get_param: cloudera_cidr }
remote_mode: remote_ip_prefix
direction: ingress
- protocol: udp
remote_ip_prefix: { get_param: cloudera_cidr }
remote_mode: remote_ip_prefix
direction: ingress
{% endif %}
secgroup_cfPublic:
type: OS::Neutron::SecurityGroup
properties:
name:
list_join: [' ', [ {get_param: 'OS::stack_name' }, 'cfPublic' ]]
description: Cloud Foundry Public Group
rules:
- protocol: icmp
direction: egress
- protocol: tcp
direction: egress
- protocol: udp
direction: egress
- protocol: tcp
port_range_min: 22
port_range_max: 22
remote_group_id: { get_resource: secgroup_jumpbox_ssh }
remote_mode: remote_group_id
direction: ingress
- protocol: tcp
port_range_min: 80
port_range_max: 80
direction: ingress
- protocol: tcp
port_range_min: 443
port_range_max: 443
direction: ingress
- protocol: tcp
port_range_min: 4443
port_range_max: 4443
direction: ingress
secgroup_docker:
type: OS::Neutron::SecurityGroup
properties:
name:
list_join: [' ', [ {get_param: 'OS::stack_name' }, 'Docker' ]]
description: Docker Broker Security Group
rules:
- protocol: icmp
direction: egress
- protocol: tcp
direction: egress
- protocol: udp
direction: egress
- protocol: tcp
port_range_min: 4243
port_range_max: 4243
remote_group_id: { get_resource: secgroup_jumpbox_ssh }
remote_mode: remote_group_id
direction: ingress
- protocol: tcp
port_range_min: 5000
port_range_max: 5000
direction: ingress
- protocol: tcp
port_range_min: 32768
port_range_max: 61000
direction: ingress
- protocol: udp
port_range_min: 32768
port_range_max: 61000
direction: ingress
{% if (type == 'hybrid') %}
- protocol: icmp
remote_ip_prefix: { get_param: cloudera_cidr }
remote_mode: remote_ip_prefix
direction: ingress
- protocol: tcp
remote_ip_prefix: { get_param: cloudera_cidr }
remote_mode: remote_ip_prefix
direction: ingress
- protocol: udp
remote_ip_prefix: { get_param: cloudera_cidr }
remote_mode: remote_ip_prefix
direction: ingress
{% endif %}
{% if (type == 'fullvm') %}
secgroup_consul:
type: OS::Neutron::SecurityGroup
properties:
name:
list_join: [' ', [ {get_param: 'OS::stack_name' }, 'Consul' ]]
description: Consul Security Group
rules:
- protocol: icmp
direction: egress
- protocol: tcp
direction: egress
- protocol: udp
direction: egress
- protocol: tcp
port_range_min: 8300
port_range_max: 8302
direction: ingress
- protocol: tcp
port_range_min: 53
port_range_max: 53
direction: ingress
- protocol: udp
port_range_min: 53
port_range_max: 53
direction: ingress
secgroup_cloudera:
type: OS::Neutron::SecurityGroup
properties:
name:
list_join: [' ', [ {get_param: 'OS::stack_name' }, 'Cloudera' ]]
description: Cloudera Security Group
rules:
- protocol: icmp
direction: egress
- protocol: tcp
direction: egress
- protocol: udp
direction: egress
- protocol: tcp
remote_group_id: { get_resource: secgroup_jumpbox_ssh }
remote_mode: remote_group_id
direction: ingress
- protocol: udp
remote_group_id: { get_resource: secgroup_jumpbox_ssh }
remote_mode: remote_group_id
direction: ingress
- protocol: icmp
remote_group_id: { get_resource: secgroup_jumpbox_ssh }
remote_mode: remote_group_id
direction: ingress
- protocol: tcp
remote_group_id: { get_resource: secgroup_BOSH }
remote_mode: remote_group_id
direction: ingress
- protocol: udp
remote_group_id: { get_resource: secgroup_BOSH }
remote_mode: remote_group_id
direction: ingress
- protocol: icmp
remote_group_id: { get_resource: secgroup_BOSH }
remote_mode: remote_group_id
direction: ingress
- protocol: icmp
remote_ip_prefix: 10.0.5.0/24
remote_mode: remote_ip_prefix
direction: ingress
- protocol: tcp
remote_ip_prefix: 10.0.5.0/24
remote_mode: remote_ip_prefix
direction: ingress
- protocol: udp
remote_ip_prefix: 10.0.5.0/24
remote_mode: remote_ip_prefix
direction: ingress
{% endif %}
########################################
# Floating IPs
#
jumpbox_floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network: { get_param: external_network }
{% if (type == 'hybrid') %}
docker_floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network: { get_param: external_network }
{% endif %}
########################################
# SSH Keys
#
ssh_key_internal:
type: "OS::Nova::KeyPair"
properties:
name:
list_join: [ '-', [ { get_param: "OS::stack_name" }, 'internal' ]]
save_private_key: True
password:
type: "OS::Heat::RandomString"
properties:
length: 16
sequence: lettersdigits
########################################
# Wait conditions
#
cf_wait_condition:
type: OS::Heat::WaitCondition
properties:
handle: { get_resource: cf_wait_condition_handle }
timeout: 36000
cf_wait_condition_handle:
type: OS::Heat::WaitConditionHandle
nginx_wait_condition:
type: OS::Heat::WaitCondition
properties:
handle: { get_resource: nginx_wait_condition_handle }
timeout: 36000
nginx_wait_condition_handle:
type: OS::Heat::WaitConditionHandle
docker_broker_wait_condition:
type: OS::Heat::WaitCondition
properties:
handle: { get_resource: docker_broker_wait_condition_handle }
timeout: 36000
docker_broker_wait_condition_handle:
type: OS::Heat::WaitConditionHandle
bosh_director_wait_condition:
type: OS::Heat::WaitCondition
properties:
handle: { get_resource: bosh_director_wait_condition_handle }
timeout: 36000
bosh_director_wait_condition_handle:
type: OS::Heat::WaitConditionHandle
########################################
# Servers / jumpbox
#
jumpbox_server:
type: "OS::Nova::Server"
properties:
key_name: { get_param: key_pair }
flavor: m1.medium
name: Jump Box
image: { get_param: ubuntu_image }
metadata:
stack_id: { get_param: "OS::stack_id" }
stack_name: { get_param: "OS::stack_name" }
config_drive: true
networks:
- port: { get_resource: jumpbox_port }
user_data_format: RAW
user_data:
str_replace:
template: |
#cloud-config
#https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/1433761
bootcmd:
- http_proxy=$http_proxy https_proxy=$https_proxy add-apt-repository -y ppa:ansible/ansible
package_update: true
package_upgrade: true
apt_http_proxy: $http_proxy
apt_https_proxy: $https_proxy
apt_ftp_proxy: $ftp_proxy
manage_etc_hosts: true
packages:
- ansible
- git
- python-pip
- autoconf
- build-essential
- python-dev
write_files:
- path: /etc/sudoers.d/root
permissions: '0440'
content: |
Defaults:root !requiretty
- path: /etc/vim/vimrc.local
permissions: '0640'
content: |
colorscheme desert
- path: /etc/openstack/clouds.yaml
permissions: '0440'
content: |
clouds:
TAP:
auth:
auth_url: $os_api
project_name: $tenant_name
username: $tenant_user
password: $tenant_pass
- path: /tmp/cloudfoundry.sh
permissions: '0544'
content: |
#!/bin/bash
sed -i -e 's/KEY----- /KEY-----\n/' -e 's/ -----END/\n-----END/' /root/.ssh/id_rsa
sed -i -e '2,2 s/ /\n/g' /root/.ssh/id_rsa
cp /root/.ssh/id_rsa /root/key.pem
export http_proxy=$http_proxy
export https_proxy=$https_proxy
export no_proxy=$no_proxy
export HOME=/root
pip install --proxy $https_proxy pbr pytz
pip install --proxy $https_proxy shade
pip install --proxy $https_proxy six --upgrade
ansible-pull -U $ansible_repo -C $ansible_branch -f
- path: /root/.ssh/id_rsa
permissions: '0400'
content: "$private_key_pem"
- path: /root/.ssh/id_rsa.pub
permissions: '0400'
content: "$public_key_pem"
- path: /etc/ansible/ansible.cfg
content: |
[defaults]
log_path=/var/log/ansible.log
- path: /etc/ansible/hosts
content: |
[jump-boxes]
localhost ansible_connection=local
[jump-boxes:vars]
http_proxy=$http_proxy
https_proxy=$http_proxy
ftp_proxy=$ftp_proxy
no_proxy=$no_proxy
ntp_server=['$ntp_server']
key_name=$key_name
cf_wait_condition_handle=$cf_wait_condition_handle
docker_broker_wait_condition_handle=$docker_broker_wait_condition_handle
bosh_director_wait_condition_handle=$bosh_director_wait_condition_handle
bosh_subnet_id=$bosh_subnet_id
bosh_dns=['$bosh_dns']
bosh_default_security_groups=['$bosh_default_security_groups']
cf_private_subnet_id=$cf_private_subnet_id
cf_private_security_group=$cf_private_security_group
cf_public_subnet_id=$cf_public_subnet_id
cf_public_security_group=$cf_public_security_group
cf_password=$cf_password
cf_system_domain=$cf_system_domain
cf_runner_z1_instances=$cf_runner_z1_instances
cf_elastic_ip=$cf_elastic_ip
cf_runner_z1_instance_type=$cf_runner_z1_instance_type
cf_smtp_host=$smtp_host
cf_smtp_sender_user=$smtp_user
cf_smtp_password=$smtp_pass
cf_smtp_port=$smtp_port
cf_smtp_sender_email=$smtp_sender_email
cf_smtp_sender_name=$smtp_sender_name
docker_subnet_id=$docker_subnet_id
docker_broker_security_group=$docker_broker_security_group
install_logsearch=$install_logsearch
logsearch_deployment_size=$logsearch_deployment_size
logsearch_subnet_id=$logsearch_subnet_id
provider=openstack
stack=$stack_name
stack_id=$stack_id
region=RegionOne
availability_zone=nova
quay_io_username=$quay_io_username
quay_io_password=$quay_io_password
router_id=$router_id
{% if (type == 'hybrid') %}
docker_fp=$docker_fp
cloudera_cidr=$cloudera_cidr
cloudera_masters=$cloudera_masters
cloudera_workers=$cloudera_workers
cloudera_storage_paths=['$cloudera_storage_paths']
{% endif %}
runcmd:
- /tmp/cloudfoundry.sh
params:
{% if (type == 'hybrid') %}
$docker_fp: { get_attr: [ docker_floating_ip, floating_ip_address ] }
$cloudera_cidr: { get_param: cloudera_cidr }
$cloudera_masters:
list_join: [",", { get_param: cloudera_masters } ]
$cloudera_workers:
list_join: [",", { get_param: cloudera_workers } ]
$cloudera_storage_paths:
list_join: ["','", { get_param: cloudera_storage_paths } ]
{% endif %}
$router_id: { get_resource: router }
$private_key_pem: { get_attr: [ssh_key_internal, private_key] }
$public_key_pem: { get_attr: [ssh_key_internal, public_key] }
$tenant_name: { get_param: tenant_name }
$tenant_user: { get_param: tenant_user }
$tenant_pass: { get_param: tenant_pass }
$os_api: { get_param: os_api }
$http_proxy: { get_param: proxy_http }
$https_proxy: { get_param: proxy_https }
$ftp_proxy: { get_param: proxy_ftp }
$no_proxy:
list_join: [",", { get_param: proxy_no } ]
$ansible_repo: { get_param: ansible_repo }
$ansible_branch: { get_param: ansible_branch }
$cf_wait_condition_handle: { get_attr: ['cf_wait_condition_handle', 'curl_cli'] }
$docker_broker_wait_condition_handle: { get_attr: ['docker_broker_wait_condition_handle', 'curl_cli'] }
$bosh_director_wait_condition_handle: { get_attr: ['bosh_director_wait_condition_handle', 'curl_cli'] }
$key_name: { get_resource: ssh_key_internal }
$bosh_subnet_id: { get_resource: bosh_network }
$bosh_default_security_groups:
list_join: [' ', [ {get_param: 'OS::stack_name' }, 'BOSH' ]]
$bosh_dns:
list_join: ["','", { get_param: dns } ]
$cf_private_subnet_id: { get_resource: cf_network }
$cf_public_subnet_id: { get_resource: public_network }
$cf_public_security_group:
list_join: [' ', [ {get_param: 'OS::stack_name' }, 'cfPublic' ]]
$cf_private_security_group:
list_join: [' ', [ {get_param: 'OS::stack_name' }, 'cfPrivate' ]]
$cf_password: { get_attr: [ password, value ] }
$cf_system_domain: { get_param: tap_domain }
$cf_runner_z1_instances: { get_param: cloudfoundry_runners_count }
$cf_elastic_ip: { get_param: public_ip }
$cf_runner_z1_instance_type: { get_param: cloudfoundry_flavor }
$smtp_host: { get_param: smtp_host }
$smtp_user: { get_param: smtp_user }
$smtp_pass: { get_param: smtp_pass }
$smtp_port: { get_param: smtp_port }
$smtp_sender_email: { get_param: smtp_sender_email }
$smtp_sender_name: { get_param: smtp_sender_name }
$docker_subnet_id: { get_resource: docker_network }
$docker_broker_security_group:
list_join: [' ', [ {get_param: 'OS::stack_name' }, 'Docker' ]]
$install_logsearch: { get_param: install_logsearch }
$logsearch_deployment_size: { get_param: logsearch_deployment_size }
$logsearch_subnet_id: { get_resource: logsearch_network }
$stack_name: { get_param: "OS::stack_name" }
$stack_id: { get_param: "OS::stack_id" }