-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathcreate-x509s.yml
926 lines (797 loc) · 37 KB
/
create-x509s.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
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
- hosts: all
connection: local
gather_facts: no
pre_tasks:
- set_fact: cert_config="./configs/cert_openssl.cnf"
- set_fact: src_ca_srl="./configs/ssl/ca.srl"
- set_fact: src_ext_file="./configs/extfile.cnf"
- set_fact: dst_ext_file="./ssl/extfile.cnf"
- set_fact: rabbitmq_server_key="./ssl/rabbitmq_server_key.pem"
- set_fact: redis_server_key="./ssl/redis_server_key.pem"
- set_fact: jupyter_server_key="./ssl/jupyter_server_key.pem"
- set_fact: aejupyter_server_key="./ssl/aejupyter_server_key.pem"
- set_fact: aeminio_server_key="./ssl/aeminio_server_key.pem"
- set_fact: aeceph_server_key="./ssl/aeceph_server_key.pem"
- set_fact: aeprometheus_server_key="./ssl/aeprometheus_server_key.pem"
- set_fact: ae_server_key="./ssl/ae_server_key.pem"
- set_fact: grafana_server_key="./ssl/grafana_server_key.pem"
- set_fact: jenkins_server_key="./ssl/jenkins_server_key.pem"
- set_fact: webserver_server_key="./ssl/webserver_server_key.pem"
- set_fact: restapi_server_key="./ssl/restapi_server_key.pem"
- set_fact: database_server_key="./ssl/database_server_key.pem"
- set_fact: pgadmin_server_key="./ssl/pgadmin_server_key.pem"
- set_fact: phpmyadmin_server_key="./ssl/phpmyadmin_server_key.pem"
- set_fact: kibana_server_key="./ssl/kibana_server_key.pem"
- set_fact: nginx_server_key="./ssl/nginx_server_key.pem"
- set_fact: docker_server_key="./ssl/docker_server_key.pem"
- set_fact: k8_server_key="./ssl/k8_server_key.pem"
- set_fact: splunk_server_key="./ssl/splunk_server_key.pem"
- set_fact: kafka_server_key="./ssl/kafka_server_key.pem"
- set_fact: s3_server_key="./ssl/s3_server_key.pem"
- set_fact: ceph_server_key="./ssl/ceph_server_key.pem"
- set_fact: minio_server_key="./ssl/minio_server_key.pem"
- set_fact: rabbitmq_server_csr="./ssl/rabbitmq_server.csr"
- set_fact: redis_server_csr="./ssl/redis_server.csr"
- set_fact: jupyter_server_csr="./ssl/jupyter_server.csr"
- set_fact: aejupyter_server_csr="./ssl/aejupyter_server.csr"
- set_fact: aeminio_server_csr="./ssl/aeminio_server.csr"
- set_fact: aeceph_server_csr="./ssl/aeceph_server.csr"
- set_fact: aeprometheus_server_csr="./ssl/aeprometheus_server.csr"
- set_fact: ae_server_csr="./ssl/ae_server.csr"
- set_fact: grafana_server_csr="./ssl/grafana_server.csr"
- set_fact: jenkins_server_csr="./ssl/jenkins_server.csr"
- set_fact: webserver_server_csr="./ssl/webserver_server.csr"
- set_fact: restapi_server_csr="./ssl/restapi_server.csr"
- set_fact: database_server_csr="./ssl/database_server.csr"
- set_fact: pgadmin_server_csr="./ssl/pgadmin_server.csr"
- set_fact: phpmyadmin_server_csr="./ssl/phpmyadmin_server.csr"
- set_fact: kibana_server_csr="./ssl/kibana_server.csr"
- set_fact: nginx_server_csr="./ssl/nginx_server.csr"
- set_fact: docker_server_csr="./ssl/docker_server.csr"
- set_fact: k8_server_csr="./ssl/k8_server.csr"
- set_fact: splunk_server_csr="./ssl/splunk_server.csr"
- set_fact: kafka_server_csr="./ssl/kafka_server.csr"
- set_fact: s3_server_csr="./ssl/s3_server.csr"
- set_fact: ceph_server_csr="./ssl/ceph_server.csr"
- set_fact: minio_server_csr="./ssl/minio_server.csr"
- set_fact: rabbitmq_server_cert="./ssl/rabbitmq_server_cert.pem"
- set_fact: redis_server_cert="./ssl/redis_server_cert.pem"
- set_fact: jupyter_server_cert="./ssl/jupyter_server_cert.pem"
- set_fact: aejupyter_server_cert="./ssl/aejupyter_server_cert.pem"
- set_fact: aeminio_server_cert="./ssl/aeminio_server_cert.pem"
- set_fact: aeceph_server_cert="./ssl/aeceph_server_cert.pem"
- set_fact: aeprometheus_server_cert="./ssl/aeprometheus_server_cert.pem"
- set_fact: ae_server_cert="./ssl/ae_server_cert.pem"
- set_fact: grafana_server_cert="./ssl/grafana_server_cert.pem"
- set_fact: jenkins_server_cert="./ssl/jenkins_server_cert.pem"
- set_fact: webserver_server_cert="./ssl/webserver_server_cert.pem"
- set_fact: restapi_server_cert="./ssl/restapi_server_cert.pem"
- set_fact: database_server_cert="./ssl/database_server_cert.pem"
- set_fact: pgadmin_server_cert="./ssl/pgadmin_server_cert.pem"
- set_fact: phpmyadmin_server_cert="./ssl/phpmyadmin_server_cert.pem"
- set_fact: kibana_server_cert="./ssl/kibana_server_cert.pem"
- set_fact: nginx_server_cert="./ssl/nginx_server_cert.pem"
- set_fact: docker_server_cert="./ssl/docker_server_cert.pem"
- set_fact: k8_server_cert="./ssl/k8_server_cert.pem"
- set_fact: splunk_server_cert="./ssl/splunk_server_cert.pem"
- set_fact: kafka_server_cert="./ssl/kafka_server_cert.pem"
- set_fact: s3_server_cert="./ssl/s3_server_cert.pem"
- set_fact: ceph_server_cert="./ssl/ceph_server_cert.pem"
- set_fact: minio_server_cert="./ssl/minio_server_cert.pem"
- set_fact: client_key="./ssl/client_key.pem"
- set_fact: client_csr="./ssl/client.csr"
- set_fact: client_cert="./ssl/client_cert.pem"
- set_fact: ca_private_key="./ssl/ca_private_key.pem"
- set_fact: ca_file="./ssl/ca.pem"
- set_fact: country="US"
- set_fact: state="CA"
- set_fact: location="City"
- set_fact: org="Example"
- set_fact: org_unit="Example"
- set_fact: ca_org="Example"
- set_fact: ca_org_unit="Example"
- set_fact: ca_common_name="example.com"
- set_fact: common_name="example.com"
- set_fact: fqdn="*.example.com"
- set_fact: rabbitmq_fqdn="rabbitmq.example.com"
- set_fact: redis_fqdn="redis.example.com"
- set_fact: jupyter_fqdn="jupyter.example.com"
- set_fact: aejupyter_fqdn="aejupyter.example.com"
- set_fact: aeminio_fqdn="aeminio.example.com"
- set_fact: aeceph_fqdn="aeceph.example.com"
- set_fact: aeprometheus_fqdn="aeprometheus.example.com"
- set_fact: ae_fqdn="ae.example.com"
- set_fact: grafana_fqdn="grafana.example.com"
- set_fact: jenkins_fqdn="jenkins.example.com"
- set_fact: webserver_fqdn="www.example.com"
- set_fact: restapi_fqdn="api.example.com"
- set_fact: database_fqdn="db.example.com"
- set_fact: pgadmin_fqdn="pgadmin.example.com"
- set_fact: phpmyadmin_fqdn="phpmyadmin.example.com"
- set_fact: kibana_fqdn="kibana.example.com"
- set_fact: nginx_fqdn="lb.example.com"
- set_fact: docker_fqdn="docker.example.com"
- set_fact: k8_fqdn="k8.example.com"
- set_fact: splunk_fqdn="splunk.example.com"
- set_fact: kafka_fqdn="kafka.example.com"
- set_fact: s3_fqdn="s3.example.com"
- set_fact: ceph_fqdn="ceph.example.com"
- set_fact: minio_fqdn="minio.example.com"
- set_fact: valid_days="365"
tasks:
- name: Set Default Subject
set_fact: subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}"
- name: Set CA Subject
set_fact: ca_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{ca_org}}/OU={{ca_org_unit}}/CN={{ca_common_name}}"
- name: Set RabbitMQ Subject={{rabbitmq_fqdn}}
set_fact: rabbitmq_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{rabbitmq_fqdn}}"
- name: Set Redis Subject={{redis_fqdn}}
set_fact: redis_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{redis_fqdn}}"
- name: Set Jenkins Subject={{jenkins_fqdn}}
set_fact: jenkins_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{jenkins_fqdn}}"
- name: Set Jupyter Subject={{jupyter_fqdn}}
set_fact: jupyter_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{jupyter_fqdn}}"
- name: Set AE Jupyter Subject={{aejupyter_fqdn}}
set_fact: aejupyter_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{aejupyter_fqdn}}"
- name: Set AE Minio Subject={{aeminio_fqdn}}
set_fact: aeminio_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{aeminio_fqdn}}"
- name: Set AE Ceph Subject={{aeceph_fqdn}}
set_fact: aeceph_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{aeceph_fqdn}}"
- name: Set AE Prometheus Subject={{aeprometheus_fqdn}}
set_fact: aeprometheus_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{aeprometheus_fqdn}}"
- name: Set AE Server Subject={{ae_fqdn}}
set_fact: ae_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{ae_fqdn}}"
- name: Set Grafana Subject={{grafana_fqdn}}
set_fact: grafana_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{grafana_fqdn}}"
- name: Set Webserver Subject={{webserver_fqdn}}
set_fact: webserver_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{webserver_fqdn}}"
- name: Set REST API Subject={{restapi_fqdn}}
set_fact: restapi_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{restapi_fqdn}}"
- name: Set Database Subject={{database_fqdn}}
set_fact: database_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{database_fqdn}}"
- name: Set pgAdmin Subject={{pgadmin_fqdn}}
set_fact: pgadmin_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{pgadmin_fqdn}}"
- name: Set phpMyAdmin Subject={{phpmyadmin_fqdn}}
set_fact: phpmyadmin_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{phpmyadmin_fqdn}}"
- name: Set Kibana Subject={{kibana_fqdn}}
set_fact: kibana_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{kibana_fqdn}}"
- name: Set nginx Subject={{nginx_fqdn}}
set_fact: nginx_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{nginx_fqdn}}"
- name: Set Docker Subject={{docker_fqdn}}
set_fact: docker_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{docker_fqdn}}"
- name: Set K8 Subject={{k8_fqdn}}
set_fact: k8_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{k8_fqdn}}"
- name: Set Splunk Subject={{splunk_fqdn}}
set_fact: splunk_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{splunk_fqdn}}"
- name: Set Kafka Subject={{kafka_fqdn}}
set_fact: kafka_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{kafka_fqdn}}"
- name: Set S3 Subject={{s3_fqdn}}
set_fact: s3_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{s3_fqdn}}"
- name: Set Ceph Subject={{ceph_fqdn}}
set_fact: ceph_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{ceph_fqdn}}"
- name: Set Minio Subject={{minio_fqdn}}
set_fact: minio_subject="/C={{country}}/ST={{state}}/L={{location}}/O={{org}}/OU={{org_unit}}/CN={{fqdn}}/SAN:dns={{minio_fqdn}}"
- name: Installing base OpenSSL config and Extfile
shell: cp {{src_ext_file}} {{dst_ext_file}}
- name: Create CA Private Key
command: openssl genrsa -out {{ca_private_key}} 4096
- name: Create CA
command: openssl req \
-config {{cert_config}} \
-nodes -new -x509 \
-days {{valid_days}} \
-key {{ca_private_key}} \
-sha256 \
-subj "{{ca_subject}}"
-out {{ca_file}}
- name: Create RabbitMQ Server Key
command: openssl genrsa \
-out {{rabbitmq_server_key}} 4096
- name: Create Redis Server Key
command: openssl genrsa \
-out {{redis_server_key}} 4096
- name: Create Jupyter Server Key
command: openssl genrsa \
-out {{jupyter_server_key}} 4096
- name: Create AE Jupyter Server Key
command: openssl genrsa \
-out {{aejupyter_server_key}} 4096
- name: Create AE Minio Server Key
command: openssl genrsa \
-out {{aeminio_server_key}} 4096
- name: Create AE Ceph Server Key
command: openssl genrsa \
-out {{aeceph_server_key}} 4096
- name: Create AE Prometheus Server Key
command: openssl genrsa \
-out {{aeprometheus_server_key}} 4096
- name: Create AE Server Key
command: openssl genrsa \
-out {{ae_server_key}} 4096
- name: Create Grafana Key
command: openssl genrsa \
-out {{grafana_server_key}} 4096
- name: Create Jenkins Server Key
command: openssl genrsa \
-out {{jenkins_server_key}} 4096
- name: Create Webserver Server Key
command: openssl genrsa \
-out {{webserver_server_key}} 4096
- name: Create REST API Server Key
command: openssl genrsa \
-out {{restapi_server_key}} 4096
- name: Create Database Server Key
command: openssl genrsa \
-out {{database_server_key}} 4096
- name: Create pgAdmin Server Key
command: openssl genrsa \
-out {{pgadmin_server_key}} 4096
- name: Create phpMyAdmin Server Key
command: openssl genrsa \
-out {{phpmyadmin_server_key}} 4096
- name: Create Kibana Server Key
command: openssl genrsa \
-out {{kibana_server_key}} 4096
- name: Create nginx Server Key
command: openssl genrsa \
-out {{nginx_server_key}} 4096
- name: Create Docker Server Key
command: openssl genrsa \
-out {{docker_server_key}} 4096
- name: Create K8 Server Key
command: openssl genrsa \
-out {{k8_server_key}} 4096
- name: Create Splunk Server Key
command: openssl genrsa \
-out {{splunk_server_key}} 4096
- name: Create Kafka Server Key
command: openssl genrsa \
-out {{kafka_server_key}} 4096
- name: Create S3 Server Key
command: openssl genrsa \
-out {{s3_server_key}} 4096
- name: Create Ceph Server Key
command: openssl genrsa \
-out {{ceph_server_key}} 4096
- name: Create Minio Server Key
command: openssl genrsa \
-out {{minio_server_key}} 4096
- name: Create RabbitMQ Server CSR -subj={{rabbitmq_subject}}
command: openssl req \
-subj {{rabbitmq_subject}} \
-sha256 -new \
-key {{rabbitmq_server_key}} \
-out {{rabbitmq_server_csr}}
- name: Create Redis Server CSR -subj={{redis_subject}}
command: openssl req \
-subj {{redis_subject}} \
-sha256 -new \
-key {{redis_server_key}} \
-out {{redis_server_csr}}
- name: Create Jupyter Server CSR -subj={{jupyter_subject}}
command: openssl req \
-subj {{jupyter_subject}} \
-sha256 -new \
-key {{jupyter_server_key}} \
-out {{jupyter_server_csr}}
- name: Create AE Jupyter Server CSR -subj={{aejupyter_subject}}
command: openssl req \
-subj {{aejupyter_subject}} \
-sha256 -new \
-key {{aejupyter_server_key}} \
-out {{aejupyter_server_csr}}
- name: Create AE Minio Server CSR -subj={{aeminio_subject}}
command: openssl req \
-subj {{aeminio_subject}} \
-sha256 -new \
-key {{aeminio_server_key}} \
-out {{aeminio_server_csr}}
- name: Create AE Ceph Server CSR -subj={{aeceph_subject}}
command: openssl req \
-subj {{aeceph_subject}} \
-sha256 -new \
-key {{aeceph_server_key}} \
-out {{aeceph_server_csr}}
- name: Create AE Prometheus Server CSR -subj={{aeprometheus_subject}}
command: openssl req \
-subj {{aeprometheus_subject}} \
-sha256 -new \
-key {{aeprometheus_server_key}} \
-out {{aeprometheus_server_csr}}
- name: Create AE Server CSR -subj={{ae_subject}}
command: openssl req \
-subj {{ae_subject}} \
-sha256 -new \
-key {{ae_server_key}} \
-out {{ae_server_csr}}
- name: Create Grafana CSR -subj={{grafana_subject}}
command: openssl req \
-subj {{grafana_subject}} \
-sha256 -new \
-key {{grafana_server_key}} \
-out {{grafana_server_csr}}
- name: Create Jenkins Server CSR -subj={{jenkins_subject}}
command: openssl req \
-subj {{jenkins_subject}} \
-sha256 -new \
-key {{jenkins_server_key}} \
-out {{jenkins_server_csr}}
- name: Create Webserver Server CSR -subj={{webserver_subject}}
command: openssl req \
-subj {{webserver_subject}} \
-sha256 -new \
-key {{webserver_server_key}} \
-out {{webserver_server_csr}}
- name: Create REST API Server CSR -subj={{restapi_subject}}
command: openssl req \
-subj {{restapi_subject}} \
-sha256 -new \
-key {{restapi_server_key}} \
-out {{restapi_server_csr}}
- name: Create Database Server CSR -subj={{database_subject}}
command: openssl req \
-subj {{database_subject}} \
-sha256 -new \
-key {{database_server_key}} \
-out {{database_server_csr}}
- name: Create pgAdmin Server CSR -subj={{pgadmin_subject}}
command: openssl req \
-subj {{pgadmin_subject}} \
-sha256 -new \
-key {{pgadmin_server_key}} \
-out {{pgadmin_server_csr}}
- name: Create phpMyAdmin Server CSR -subj={{phpmyadmin_subject}}
command: openssl req \
-subj {{phpmyadmin_subject}} \
-sha256 -new \
-key {{phpmyadmin_server_key}} \
-out {{phpmyadmin_server_csr}}
- name: Create Kibana Server CSR -subj={{kibana_subject}}
command: openssl req \
-subj {{kibana_subject}} \
-sha256 -new \
-key {{kibana_server_key}} \
-out {{kibana_server_csr}}
- name: Create nginx Server CSR -subj={{nginx_subject}}
command: openssl req \
-subj {{nginx_subject}} \
-sha256 -new \
-key {{nginx_server_key}} \
-out {{nginx_server_csr}}
- name: Create docker Server CSR -subj={{docker_subject}}
command: openssl req \
-subj {{docker_subject}} \
-sha256 -new \
-key {{docker_server_key}} \
-out {{docker_server_csr}}
- name: Create k8 Server CSR -subj={{k8_subject}}
command: openssl req \
-subj {{k8_subject}} \
-sha256 -new \
-key {{k8_server_key}} \
-out {{k8_server_csr}}
- name: Create Splunk Server CSR -subj={{splunk_subject}}
command: openssl req \
-subj {{splunk_subject}} \
-sha256 -new \
-key {{splunk_server_key}} \
-out {{splunk_server_csr}}
- name: Create Kafka Server CSR -subj={{kafka_subject}}
command: openssl req \
-subj {{kafka_subject}} \
-sha256 -new \
-key {{kafka_server_key}} \
-out {{kafka_server_csr}}
- name: Create S3 Server CSR -subj={{s3_subject}}
command: openssl req \
-subj {{s3_subject}} \
-sha256 -new \
-key {{s3_server_key}} \
-out {{s3_server_csr}}
- name: Create Ceph Server CSR -subj={{ceph_subject}}
command: openssl req \
-subj {{ceph_subject}} \
-sha256 -new \
-key {{ceph_server_key}} \
-out {{ceph_server_csr}}
- name: Create Minio Server CSR -subj={{minio_subject}}
command: openssl req \
-subj {{minio_subject}} \
-sha256 -new \
-key {{minio_server_key}} \
-out {{minio_server_csr}}
- name: Generate RabbitMQ Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{rabbitmq_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{rabbitmq_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Redis Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{redis_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{redis_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Jenkins Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{jenkins_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{jenkins_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Webserver Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{webserver_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{webserver_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate REST API Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{restapi_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{restapi_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Database Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{database_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{database_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate pgAdmin Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{pgadmin_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{pgadmin_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate phpMyAdmin Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{phpmyadmin_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{phpmyadmin_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Kibana Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{kibana_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{kibana_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate nginx Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{nginx_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{nginx_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Docker Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{docker_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{docker_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate K8 Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{k8_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{k8_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Splunk Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{splunk_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{splunk_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Kafka Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{kafka_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{kafka_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate S3 Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{s3_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{s3_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Ceph Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{ceph_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{ceph_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Minio Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{minio_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{minio_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Jupyter Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{jupyter_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{jupyter_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Analysis Engine Jupyter Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{aejupyter_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{aejupyter_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Analysis Engine Minio Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{aeminio_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{aeminio_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Analysis Engine Ceph Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{aeceph_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{aeceph_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Analysis Engine Prometheus Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{aeprometheus_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{aeprometheus_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Analysis Engine Server Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{ae_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{ae_server_cert}} \
-extfile {{dst_ext_file}}
- name: Generate Analysis Engine Grafana Signed Server Cert
command: openssl x509 \
-req \
-days {{valid_days}} \
-sha256 -in {{grafana_server_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{grafana_server_cert}} \
-extfile {{dst_ext_file}}
- name: Create Client Key
command: openssl genrsa \
-out {{client_key}} 4096
- name: Create Client CSR
command: openssl req \
-subj '/CN=client' \
-new -key {{client_key}} \
-out {{client_csr}}
- name: Install Client Auth to extfile
command: echo extendedKeyUsage = clientAuth >> {{dst_ext_file}}
- name: Sign the Client Cert
command: openssl x509
-req \
-days {{valid_days}} \
-sha256 \
-in {{client_csr}} \
-CA {{ca_file}} \
-CAkey {{ca_private_key}} \
-CAcreateserial -out {{client_cert}} \
-extfile {{cert_config}}
- name: Testing RabbitMQ Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{rabbitmq_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying RabbitMQ Server Cert
fail:
msg: "Please check the server cert={{rabbitmq_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing Redis Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{redis_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying Redis Server Cert
fail:
msg: "Please check the server cert={{redis_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing Jupyter Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{jupyter_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying Jupyter Server Cert
fail:
msg: "Please check the server cert={{jupyter_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing AE Jupyter Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{aejupyter_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying AE Jupyter Server Cert
fail:
msg: "Please check the server cert={{aejupyter_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing AE Minio Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{aeminio_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying AE Minio Server Cert
fail:
msg: "Please check the server cert={{aeminio_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing AE Ceph Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{aeceph_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Testing AE Prometheus Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{aeprometheus_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Testing AE Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{ae_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Testing Grafana Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{grafana_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Testing Jenkins Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{jenkins_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying Jenkins Server Cert
fail:
msg: "Please check the server cert={{jenkins_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing Webserver Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{webserver_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying Webserver Server Cert
fail:
msg: "Please check the server cert={{webserver_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing REST API Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{restapi_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying REST API Server Cert
fail:
msg: "Please check the server cert={{restapi_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing Database Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{database_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying Database Server Cert
fail:
msg: "Please check the server cert={{database_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing pgAdmin Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{pgadmin_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying pgAdmin Server Cert
fail:
msg: "Please check the server cert={{pgadmin_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing phpMyAdmin Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{phpmyadmin_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying phpMyAdmin Server Cert
fail:
msg: "Please check the server cert={{phpmyadmin_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing Kibana Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{kibana_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying Kibana Server Cert
fail:
msg: "Please check the server cert={{kibana_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing nginx Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{nginx_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying nginx Server Cert
fail:
msg: "Please check the server cert={{nginx_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing Docker Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{docker_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying Docker Server Cert
fail:
msg: "Please check the server cert={{docker_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing k8 Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{k8_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying k8 Server Cert
fail:
msg: "Please check the server cert={{k8_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing Splunk Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{splunk_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying Splunk Server Cert
fail:
msg: "Please check the server cert={{splunk_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing Kafka Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{kafka_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying Kafka Server Cert
fail:
msg: "Please check the server cert={{kafka_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing S3 Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{s3_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying S3 Server Cert
fail:
msg: "Please check the server cert={{s3_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing Ceph Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{ceph_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying Ceph Server Cert
fail:
msg: "Please check the server cert={{ceph_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing Minio Server Cert is a subdomain of fqdn={{fqdn}}
shell: openssl x509 -in {{minio_server_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_server_cert
- name: Verifying Minio Server Cert
fail:
msg: "Please check the server cert={{minio_server_cert}} was created correctly {{fqdn}} count={{test_server_cert}}"
when: test_server_cert.stdout != "2"
- name: Testing Client Cert
shell: openssl x509 -in {{client_cert}} -text -noout | grep {{fqdn}} | wc -l
register: test_client_cert
- name: Verifying Client Cert
fail:
msg: "Please check the client cert={{client_cert}} was created correctly {{fqdn}} count={{test_client_cert}}"
when: test_client_cert.stdout != "0"