mirror of
https://github.com/ansible/awx.git
synced 2026-02-17 03:00:04 -03:30
Merge pull request #8967 from shanemcd/less-config
Remove launch scripts from configmaps Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -114,8 +114,8 @@
|
|||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
|
||||||
- name: Stage launch_awx_task
|
- name: Stage launch_awx_task
|
||||||
template:
|
copy:
|
||||||
src: launch_awx_task.sh.j2
|
src: launch_awx_task.sh
|
||||||
dest: "{{ docker_base_path }}/launch_awx_task.sh"
|
dest: "{{ docker_base_path }}/launch_awx_task.sh"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
|||||||
@@ -237,7 +237,6 @@
|
|||||||
- 'secret'
|
- 'secret'
|
||||||
- 'deployment'
|
- 'deployment'
|
||||||
- 'supervisor'
|
- 'supervisor'
|
||||||
- 'launch_awx'
|
|
||||||
no_log: true
|
no_log: true
|
||||||
|
|
||||||
- name: Apply Deployment
|
- name: Apply Deployment
|
||||||
@@ -248,7 +247,6 @@
|
|||||||
- "{{ secret }}"
|
- "{{ secret }}"
|
||||||
- "{{ deployment }}"
|
- "{{ deployment }}"
|
||||||
- "{{ supervisor }}"
|
- "{{ supervisor }}"
|
||||||
- "{{ launch_awx }}"
|
|
||||||
no_log: true
|
no_log: true
|
||||||
|
|
||||||
- name: Delete any existing management pod
|
- name: Delete any existing management pod
|
||||||
|
|||||||
@@ -221,16 +221,6 @@ spec:
|
|||||||
mountPath: "/etc/tower/conf.d/"
|
mountPath: "/etc/tower/conf.d/"
|
||||||
readOnly: true
|
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
|
- name: {{ kubernetes_deployment_name }}-supervisor-web-config
|
||||||
mountPath: "/etc/supervisord.conf"
|
mountPath: "/etc/supervisord.conf"
|
||||||
subPath: supervisor.conf
|
subPath: supervisor.conf
|
||||||
@@ -304,16 +294,6 @@ spec:
|
|||||||
mountPath: "/etc/tower/conf.d/"
|
mountPath: "/etc/tower/conf.d/"
|
||||||
readOnly: true
|
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
|
- name: {{ kubernetes_deployment_name }}-supervisor-web-config
|
||||||
mountPath: "/etc/supervisord.conf"
|
mountPath: "/etc/supervisord.conf"
|
||||||
subPath: supervisor.conf
|
subPath: supervisor.conf
|
||||||
|
|||||||
@@ -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
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user