-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdevsecops-playbook.yml
59 lines (50 loc) · 1.52 KB
/
devsecops-playbook.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
---
- hosts: localhost
connection: local
vars_files:
- vars/aws.example.yml
tasks:
- import_role:
name: install-webpage
- name: Gather bastion instance facts
ec2_instance_facts:
region: "{{ aws_region }}"
filters:
instance-state-name: running
"tag:OpenShiftClusterName": "{{ cluster_name }}"
"tag:OpenShiftClusterNameVerbose": "{{ cluster_name_verbose }}"
"tag:OpenShiftBastion": "true"
register: ec2_bastion_instance
- name: Add host facts to bastion node
add_host:
name: "bastion.{{ cluster_name }}.{{ openshift_base_domain }}"
ansible_host: "{{ ec2_bastion_instance['instances'][0]['public_ip_address'] }}"
ansible_ssh_private_key_file: "{{ ec2_key_file }}"
ansible_user: ec2-user
rhsm_consumer_name: "{{ ec2_bastion_instance['instances'][0]['tags']['Name'] }}"
groups:
- openshift_role_bastion
- "openshift_cluster_{{ cluster_group_name }}"
- hosts: openshift_role_bastion:&openshift_cluster_{{ cluster_group_name }}
any_errors_fatal: yes
vars_files:
- vars/aws.example.yml
roles:
- install-oc
- install-jq
- install-pip
- install-epel
- install-passlib
- install-git
- install-oscap
- install-butterfly
- setup-users
- setup-dcmm
- setup-cicd
post_tasks:
- name: Confirmation message
debug:
msg: |
"The script has completed successfully."
"Webpage: http://{{ ec2_name_prefix }}.{{openshift_base_domain}}"
when: install_webpage