summaryrefslogtreecommitdiffstats
path: root/installer
diff options
context:
space:
mode:
authorShane McDonald <shanemcd@redhat.com>2020-12-22 15:12:03 +0100
committerShane McDonald <shanemcd@redhat.com>2020-12-22 15:12:03 +0100
commit106d90aeb38c9b76b2667d0a31c7266b5a8f768b (patch)
tree9dec4d8b074a0de42837ccc16a84b32b8395a9f5 /installer
parentRevert: Force containers in k8s to run under root group (diff)
downloadawx-106d90aeb38c9b76b2667d0a31c7266b5a8f768b.tar.xz
awx-106d90aeb38c9b76b2667d0a31c7266b5a8f768b.zip
Remove launch scripts from configmaps
The duplication of these scripts has been bothering me for a while. They dont get enough usage to justify their existence.
Diffstat (limited to 'installer')
-rwxr-xr-xinstaller/roles/image_build/files/launch_awx_task.sh (renamed from installer/roles/image_build/templates/launch_awx_task.sh.j2)0
-rw-r--r--installer/roles/image_build/tasks/main.yml4
-rw-r--r--installer/roles/kubernetes/tasks/main.yml2
-rw-r--r--installer/roles/kubernetes/templates/deployment.yml.j220
-rw-r--r--installer/roles/kubernetes/templates/launch_awx.yml.j256
5 files changed, 2 insertions, 80 deletions
diff --git a/installer/roles/image_build/templates/launch_awx_task.sh.j2 b/installer/roles/image_build/files/launch_awx_task.sh
index 49806df485..49806df485 100755
--- a/installer/roles/image_build/templates/launch_awx_task.sh.j2
+++ b/installer/roles/image_build/files/launch_awx_task.sh
diff --git a/installer/roles/image_build/tasks/main.yml b/installer/roles/image_build/tasks/main.yml
index f69c8a5816..d3d49ed087 100644
--- a/installer/roles/image_build/tasks/main.yml
+++ b/installer/roles/image_build/tasks/main.yml
@@ -114,8 +114,8 @@
delegate_to: localhost
- name: Stage launch_awx_task
- template:
- src: launch_awx_task.sh.j2
+ copy:
+ src: launch_awx_task.sh
dest: "{{ docker_base_path }}/launch_awx_task.sh"
mode: '0755'
delegate_to: localhost
diff --git a/installer/roles/kubernetes/tasks/main.yml b/installer/roles/kubernetes/tasks/main.yml
index 840e3a8a36..7c23e1bcaf 100644
--- a/installer/roles/kubernetes/tasks/main.yml
+++ b/installer/roles/kubernetes/tasks/main.yml
@@ -237,7 +237,6 @@
- 'secret'
- 'deployment'
- 'supervisor'
- - 'launch_awx'
no_log: true
- name: Apply Deployment
@@ -248,7 +247,6 @@
- "{{ secret }}"
- "{{ deployment }}"
- "{{ supervisor }}"
- - "{{ launch_awx }}"
no_log: true
- name: Delete any existing management pod
diff --git a/installer/roles/kubernetes/templates/deployment.yml.j2 b/installer/roles/kubernetes/templates/deployment.yml.j2
index 03b09c0d3b..b82c30b069 100644
--- a/installer/roles/kubernetes/templates/deployment.yml.j2
+++ b/installer/roles/kubernetes/templates/deployment.yml.j2
@@ -221,16 +221,6 @@ spec:
mountPath: "/etc/tower/conf.d/"
readOnly: true
- - name: {{ kubernetes_deployment_name }}-launch-awx-web
- mountPath: "/usr/bin/launch_awx.sh"
- subPath: "launch_awx.sh"
- readOnly: true
-
- - name: {{ kubernetes_deployment_name }}-launch-awx-task
- mountPath: "/usr/bin/launch_awx_task.sh"
- subPath: "launch_awx_task.sh"
- readOnly: true
-
- name: {{ kubernetes_deployment_name }}-supervisor-web-config
mountPath: "/etc/supervisord.conf"
subPath: supervisor.conf
@@ -304,16 +294,6 @@ spec:
mountPath: "/etc/tower/conf.d/"
readOnly: true
- - name: {{ kubernetes_deployment_name }}-launch-awx-web
- mountPath: "/usr/bin/launch_awx.sh"
- subPath: "launch_awx.sh"
- readOnly: true
-
- - name: {{ kubernetes_deployment_name }}-launch-awx-task
- mountPath: "/usr/bin/launch_awx_task.sh"
- subPath: "launch_awx_task.sh"
- readOnly: true
-
- name: {{ kubernetes_deployment_name }}-supervisor-web-config
mountPath: "/etc/supervisord.conf"
subPath: supervisor.conf
diff --git a/installer/roles/kubernetes/templates/launch_awx.yml.j2 b/installer/roles/kubernetes/templates/launch_awx.yml.j2
deleted file mode 100644
index cc6cdadaf1..0000000000
--- a/installer/roles/kubernetes/templates/launch_awx.yml.j2
+++ /dev/null
@@ -1,56 +0,0 @@
-apiVersion: v1
-kind: ConfigMap
-metadata:
- name: {{ kubernetes_deployment_name }}-launch-awx
- namespace: {{ kubernetes_namespace }}
-data:
- launch-awx-task: |
- #!/usr/bin/env bash
- if [ `id -u` -ge 500 ]; then
- echo "awx:x:`id -u`:`id -g`:,,,:/var/lib/awx:/bin/bash" >> /tmp/passwd
- cat /tmp/passwd > /etc/passwd
- rm /tmp/passwd
- fi
-
- source /etc/tower/conf.d/environment.sh
-
- ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=$DATABASE_HOST port=$DATABASE_PORT" all
- ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "path=/var/run/redis/redis.sock" all
-
-
- if [ -z "$AWX_SKIP_MIGRATIONS" ]; then
- awx-manage migrate --noinput
- fi
-
- if [ ! -z "$AWX_ADMIN_USER" ]&&[ ! -z "$AWX_ADMIN_PASSWORD" ]; then
- echo "from django.contrib.auth.models import User; User.objects.create_superuser('$AWX_ADMIN_USER', 'root@localhost', '$AWX_ADMIN_PASSWORD')" | awx-manage shell
- else
- echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'root@localhost', 'password')" | awx-manage shell
- fi
- echo 'from django.conf import settings; x = settings.AWX_TASK_ENV; x["HOME"] = "/var/lib/awx"; settings.AWX_TASK_ENV = x' | awx-manage shell
- awx-manage provision_instance --hostname=$(hostname)
- awx-manage register_queue --queuename=tower --instance_percent=100
-
- unset $(cut -d = -f -1 /etc/tower/conf.d/environment.sh)
-
- supervisord -c /etc/supervisord_task.conf
-
- launch-awx-web: |
- #!/usr/bin/env bash
- if [ `id -u` -ge 500 ]; then
- echo "awx:x:`id -u`:`id -g`:,,,:/var/lib/awx:/bin/bash" >> /tmp/passwd
- cat /tmp/passwd > /etc/passwd
- rm /tmp/passwd
- fi
-
- source /etc/tower/conf.d/environment.sh
-
- ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=$DATABASE_HOST port=$DATABASE_PORT" all
- ANSIBLE_REMOTE_TEMP=/tmp ANSIBLE_LOCAL_TEMP=/tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a "path=/var/run/redis/redis.sock" all
-
- awx-manage collectstatic --noinput --clear
-
- unset $(cut -d = -f -1 /etc/tower/conf.d/environment.sh)
-
- supervisord -c /etc/supervisord.conf
-