File tree Expand file tree Collapse file tree 5 files changed +81
-3
lines changed
Expand file tree Collapse file tree 5 files changed +81
-3
lines changed Original file line number Diff line number Diff line change 55 gather_facts : no
66 vars :
77 gcp_project : ceenter
8- scopes :
9- - https://www.googleapis.com/auth/compute
108 zone : " europe-west3-a"
119 region : " europe-west3"
1210
1715 name : " {{ vm_name | default('ansible-tower-test', true) }}"
1816 zone : " {{ zone }}"
1917 project : " {{ gcp_project }}"
18+ - name : delete an address
19+ gcp_compute_address :
20+ name : " {{ vm_address_name | default('ansible-tower-test-address', true) }}"
21+ region : " {{ region }}"
22+ project : " {{ gcp_project }}"
23+ state : absent
Original file line number Diff line number Diff line change @@ -51,7 +51,9 @@ Download [GCP credentials](https://docs.ansible.com/ansible/latest/scenario_guid
5151ansible-playbook GCP_VM_Create.yml
5252```
5353
54- ## Ansible Tower Setup
54+ ## Ansible Tower
55+
56+ ### Tower setup
5557
5658Create Credential:
5759- GCP connection
@@ -68,3 +70,32 @@ Create Job Templates:
6870Authenticate Ansible Tower to Automation-hub:
6971- Retrieve token at https://cloud.redhat.com/ansible/automation-hub/token
7072- Update token in Ansible Tower: https://www.ansible.com/blog/installing-and-using-collections-on-ansible-tower
73+
74+ ### OpenShift setup
75+
76+ Additional Container Group on OpenShift
77+ - ` oc create -n tower -f ocp-setup/role-pod-manager.yml `
78+ - ` oc create -n tower -f ocp-setup/sa-tower-container-group.yml `
79+ - ` oc create -n tower -f ocp-setup/rb-tower-container-group.yml `
80+
81+ Download serviceaccount credentials, e.g. from ui download serviceaccount kubeconfig.
82+
83+ Customize Pod Spec on Instance Group
84+ ``` yaml
85+ ---
86+ apiVersion : v1
87+ kind : Pod
88+ metadata :
89+ namespace : tower
90+ spec :
91+ containers :
92+ - image : quay.io/ceenter/ansible-runner-google:1.4.6
93+ tty : true
94+ stdin : true
95+ imagePullPolicy : Always
96+ args :
97+ - sleep
98+ - infinity
99+ ` ` `
100+
101+ Container image is build in [ansible-runner-images repository](https://github.com/ceenter/ansible-runner-images).
Original file line number Diff line number Diff line change 1+ ---
2+ kind : RoleBinding
3+ apiVersion : rbac.authorization.k8s.io/v1
4+ metadata :
5+ name : tower-container-group
6+ subjects :
7+ - kind : ServiceAccount
8+ name : tower-container-group
9+ namespace : tower
10+ roleRef :
11+ apiGroup : rbac.authorization.k8s.io
12+ kind : Role
13+ name : pod-manager
Original file line number Diff line number Diff line change 1+ ---
2+ # Role for managing Pods, presumably by Ansible Tower
3+ apiVersion : rbac.authorization.k8s.io/v1
4+ kind : Role
5+ metadata :
6+ name : pod-manager
7+ rules :
8+ - verbs :
9+ - get
10+ - list
11+ - watch
12+ - create
13+ - update
14+ - patch
15+ - delete
16+ apiGroups :
17+ - ' '
18+ resources :
19+ - pods
20+ - verbs :
21+ - create
22+ apiGroups :
23+ - ' '
24+ resources :
25+ - pods/exec
Original file line number Diff line number Diff line change 1+ ---
2+ apiVersion : v1
3+ kind : ServiceAccount
4+ metadata :
5+ name : tower-container-group
You can’t perform that action at this time.
0 commit comments