6
6
# https://github.com/ansible/awx/blob/devel/tools/docker-compose/README.md
7
7
# https://github.com/ansible/awx
8
8
# https://blog.palark.com/ready-to-use-commands-and-tips-for-kubectl/
9
+ # https://techfrontier.me.uk/post/finally-my-own-awx-server/
9
10
10
11
echo -e ' \e[38;5;198m' " ++++ "
11
12
echo -e ' \e[38;5;198m' " ++++ Add ~/.local/bin to PATH"
@@ -40,6 +41,14 @@ sudo --preserve-env=PATH -u vagrant python -m pip install molecule --quiet
40
41
sudo --preserve-env=PATH -u vagrant python -m pip install junit_xml --quiet
41
42
sudo --preserve-env=PATH -u vagrant python -m pip install awxkit --quiet
42
43
44
+ # BUG: https://techfrontier.me.uk/post/finally-my-own-awx-server/
45
+ # Back-off pulling image "quay.io/ansible/awx-ee:latest"
46
+ # This looks to relate image "quay.io/ansible/awx-ee:latest" being large and not pulling quick enough, so we manually intervene and get it into our docker library by hand.
47
+ echo -e ' \e[38;5;198m' " ++++ "
48
+ echo -e ' \e[38;5;198m' " ++++ Pull quay.io/ansible/awx-ee:latest to avoid Back-off pulling image later"
49
+ echo -e ' \e[38;5;198m' " ++++ "
50
+ sudo --preserve-env=PATH -u vagrant minikube ssh docker pull quay.io/ansible/awx-ee:latest
51
+
43
52
# https://github.com/ansible/awx-operator#basic-install
44
53
echo -e ' \e[38;5;198m' " ++++ "
45
54
echo -e ' \e[38;5;198m' " ++++ Create kustomization.yaml"
@@ -49,17 +58,16 @@ apiVersion: kustomize.config.k8s.io/v1beta1
49
58
kind: Kustomization
50
59
resources:
51
60
# Find the latest tag here: https://github.com/ansible/awx-operator/releases
52
- - github.com/ansible/awx-operator/config/default?ref=0.30.0
61
+ - github.com/ansible/awx-operator/config/default?ref=1.1.4
53
62
54
63
# Set the image tags to match the git version from above
55
64
images:
56
65
- name: quay.io/ansible/awx-operator
57
- newTag: 0.30.0
66
+ newTag: 1.1.4
58
67
59
68
# Specify a custom namespace in which to install AWX
60
69
namespace: awx
61
70
EOF
62
- cat ./kustomization.yaml
63
71
64
72
echo -e ' \e[38;5;198m' " ++++ "
65
73
echo -e ' \e[38;5;198m' " ++++ Create awx.yaml with kubectl kustomize > awx.yaml"
@@ -74,7 +82,7 @@ sudo --preserve-env=PATH -u vagrant kubectl apply -f awx.yaml
74
82
75
83
# https://github.com/ansible/awx/blob/17.0.1/INSTALL.md#post-install-1
76
84
attempts=0
77
- max_attempts=15
85
+ max_attempts=20
78
86
while ! ( sudo --preserve-env=PATH -u vagrant kubectl get pods --namespace awx | grep controller | tr -s " " | cut -d " " -f3 | grep Running ) && (( $attempts < $max_attempts )) ; do
79
87
attempts=$(( attempts+ 1 ))
80
88
sleep 60;
@@ -95,15 +103,13 @@ kind: AWX
95
103
metadata:
96
104
name: awx-demo
97
105
spec:
106
+ ee_images:
107
+ - name: quay.io/ansible/awx-ee:latest
108
+ image: quay.io/ansible/awx-ee:latest
98
109
service_type: nodeport
99
110
# default nodeport_port is 30080
100
111
nodeport_port: 30080
101
- # Set the image tags to 0.6.0 because latest tag is 632.1 mb (heavy to pull) from above
102
- images:
103
- - name: quay.io/ansible/awx-ee
104
- newTag: 0.6.0
105
112
EOF
106
- cat ./awx-demo.yaml
107
113
108
114
echo -e ' \e[38;5;198m' " ++++ "
109
115
echo -e ' \e[38;5;198m' " ++++ Add awx-demo.yaml to kustomization.yaml"
@@ -113,18 +119,17 @@ apiVersion: kustomize.config.k8s.io/v1beta1
113
119
kind: Kustomization
114
120
resources:
115
121
# Find the latest tag here: https://github.com/ansible/awx-operator/releases
116
- - github.com/ansible/awx-operator/config/default?ref=0.30.0
122
+ - github.com/ansible/awx-operator/config/default?ref=1.1.4
117
123
- awx-demo.yaml
118
124
119
125
# Set the image tags to match the git version from above
120
126
images:
121
127
- name: quay.io/ansible/awx-operator
122
- newTag: 0.30.0
128
+ newTag: 1.1.4
123
129
124
130
# Specify a custom namespace in which to install AWX
125
131
namespace: awx
126
132
EOF
127
- cat ./kustomization.yaml
128
133
129
134
echo -e ' \e[38;5;198m' " ++++ "
130
135
echo -e ' \e[38;5;198m' " ++++ Create awx.yaml with kubectl kustomize > awx.yaml"
@@ -137,7 +142,7 @@ echo -e '\e[38;5;198m'"++++ "
137
142
sudo --preserve-env=PATH -u vagrant kubectl apply -f awx.yaml
138
143
139
144
attempts=0
140
- max_attempts=15
145
+ max_attempts=20
141
146
while ! ( sudo --preserve-env=PATH -u vagrant kubectl get pods --namespace awx | grep demo | grep -v postgres | tr -s " " | cut -d " " -f3 | grep Running ) && (( $attempts < $max_attempts )) ; do
142
147
attempts=$(( attempts+ 1 ))
143
148
sleep 60;
@@ -158,7 +163,7 @@ echo -e '\e[38;5;198m'"++++ "
158
163
echo -e ' \e[38;5;198m' " ++++ Check that AWX Ansible Tower web interface is available"
159
164
echo -e ' \e[38;5;198m' " ++++ "
160
165
attempts=0
161
- max_attempts=15
166
+ max_attempts=20
162
167
while ! ( kubectl exec $( kubectl get po -n awx | grep -v operator | grep -v postgres | grep awx | tr -s " " | cut -d " " -f1) --container=" redis" -n awx -- /bin/bash -c " apt-get -qqq update && apt-get -qqq install -y procps curl net-tools && netstat -nlp | grep 8052" ) && (( $attempts < $max_attempts )) ; do
163
168
attempts=$(( attempts+ 1 ))
164
169
sleep 60;
@@ -167,7 +172,7 @@ while ! ( kubectl exec $(kubectl get po -n awx | grep -v operator | grep -v post
167
172
done
168
173
169
174
attempts=0
170
- max_attempts=15
175
+ max_attempts=20
171
176
while ! ( sudo netstat -nlp | grep 8043 ) && (( $attempts < $max_attempts )) ; do
172
177
attempts=$(( attempts+ 1 ))
173
178
sleep 60;
@@ -244,36 +249,36 @@ echo -e '\e[38;5;198m'"++++ Add credentials ansible"
244
249
echo -e ' \e[38;5;198m' " ++++ "
245
250
sudo --preserve-env=PATH -u vagrant /home/vagrant/.local/bin/awx credentials create --credential_type ' Machine' --organization ' Default' --name ' ansible' --inputs ' {"username": "vagrant", "password": "vagrant"}' $AWX_COMMON
246
251
247
- # https://docs.ansible.com/ansible-tower/latest/html/towercli/reference.html#awx-job-templates
248
- echo -e ' \e[38;5;198m' " ++++ "
249
- echo -e ' \e[38;5;198m' " ++++ Associate credential with job_templates Demo Job Template"
250
- echo -e ' \e[38;5;198m' " ++++ "
251
- sudo --preserve-env=PATH -u vagrant /home/vagrant/.local/bin/awx job_templates disassociate --credential " Demo Credential" --name " Demo Job Template" --wait $AWX_COMMON || true
252
- sudo --preserve-env=PATH -u vagrant /home/vagrant/.local/bin/awx job_templates associate --credential " ansible" --name " Demo Job Template" --wait $AWX_COMMON || true
252
+ # # https://docs.ansible.com/ansible-tower/latest/html/towercli/reference.html#awx-job-templates
253
+ # echo -e '\e[38;5;198m'"++++ "
254
+ # echo -e '\e[38;5;198m'"++++ Associate credential with job_templates Demo Job Template"
255
+ # echo -e '\e[38;5;198m'"++++ "
256
+ # sudo --preserve-env=PATH -u vagrant /home/vagrant/.local/bin/awx job_templates disassociate --credential "Demo Credential" --name "Demo Job Template" --wait $AWX_COMMON || true
257
+ # sudo --preserve-env=PATH -u vagrant /home/vagrant/.local/bin/awx job_templates associate --credential "ansible" --name "Demo Job Template" --wait $AWX_COMMON || true
253
258
254
259
# https://docs.ansible.com/ansible-tower/latest/html/towercli/reference.html#awx-job-templates
255
260
echo -e ' \e[38;5;198m' " ++++ "
256
261
echo -e ' \e[38;5;198m' " ++++ Associate credential with job_templates ansible-role-example-role"
257
262
echo -e ' \e[38;5;198m' " ++++ "
258
263
sudo --preserve-env=PATH -u vagrant /home/vagrant/.local/bin/awx job_templates associate --credential " ansible" --name " ansible-role-example-role" $AWX_COMMON
259
264
260
- # https://docs.ansible.com/ansible-tower/latest/html/towercli/reference.html#awx-projects-update
261
- echo -e ' \e[38;5;198m' " ++++ "
262
- echo -e ' \e[38;5;198m' " ++++ Update the project"
263
- echo -e ' \e[38;5;198m' " ++++ "
264
- sudo --preserve-env=PATH -u vagrant /home/vagrant/.local/bin/awx projects update " Demo Project" --wait $AWX_COMMON
265
+ # # https://docs.ansible.com/ansible-tower/latest/html/towercli/reference.html#awx-projects-update
266
+ # echo -e '\e[38;5;198m'"++++ "
267
+ # echo -e '\e[38;5;198m'"++++ Update the project"
268
+ # echo -e '\e[38;5;198m'"++++ "
269
+ # sudo --preserve-env=PATH -u vagrant /home/vagrant/.local/bin/awx projects update "Demo Project" --wait $AWX_COMMON
265
270
266
- # https://docs.ansible.com/ansible-tower/latest/html/towercli/reference.html#awx-projects-modify
267
- echo -e ' \e[38;5;198m' " ++++ "
268
- echo -e ' \e[38;5;198m' " ++++ Disable project update"
269
- echo -e ' \e[38;5;198m' " ++++ "
270
- sudo --preserve-env=PATH -u vagrant /home/vagrant/.local/bin/awx projects modify ' Demo Project' --scm_update_on_launch false --wait $AWX_COMMON
271
+ # # https://docs.ansible.com/ansible-tower/latest/html/towercli/reference.html#awx-projects-modify
272
+ # echo -e '\e[38;5;198m'"++++ "
273
+ # echo -e '\e[38;5;198m'"++++ Disable project update"
274
+ # echo -e '\e[38;5;198m'"++++ "
275
+ # sudo --preserve-env=PATH -u vagrant /home/vagrant/.local/bin/awx projects modify 'Demo Project' --scm_update_on_launch false --wait $AWX_COMMON
271
276
272
277
# https://docs.ansible.com/ansible-tower/latest/html/towercli/reference.html#awx-workflow-job-templates-modify
273
- echo -e ' \e[38;5;198m' " ++++ "
274
- echo -e ' \e[38;5;198m' " ++++ Modify job_templates Demo Job Template"
275
- echo -e ' \e[38;5;198m' " ++++ "
276
- sudo --preserve-env=PATH -u vagrant /home/vagrant/.local/bin/awx job_templates modify " Demo Job Template" --name " Demo Job Template" --ask_limit_on_launch true --ask_tags_on_launch true $AWX_COMMON
278
+ # echo -e '\e[38;5;198m'"++++ "
279
+ # echo -e '\e[38;5;198m'"++++ Modify job_templates Demo Job Template"
280
+ # echo -e '\e[38;5;198m'"++++ "
281
+ # sudo --preserve-env=PATH -u vagrant /home/vagrant/.local/bin/awx job_templates modify "Demo Job Template" --name "Demo Job Template" --ask_limit_on_launch true --ask_tags_on_launch true $AWX_COMMON
277
282
278
283
echo -e ' \e[38;5;198m' " ++++ "
279
284
echo -e ' \e[38;5;198m' " ++++ Configure SSH to allow login with password"
0 commit comments