2017-06-30 22:25:10 +03:00
#!/usr/bin/env bash
2017-10-13 21:27:30 +03:00
if [ ` id -u` -ge 500 ] ; then
2017-06-30 22:25:10 +03:00
echo "awx:x:`id -u`:`id -g`:,,,:/var/lib/awx:/bin/bash" >> /tmp/passwd
cat /tmp/passwd > /etc/passwd
rm /tmp/passwd
fi
2017-10-06 17:47:02 +03:00
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
2018-02-08 23:08:26 +03:00
ANSIBLE_REMOTE_TEMP = /tmp ANSIBLE_LOCAL_TEMP = /tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a " host= $MEMCACHED_HOST port=11211 " all
ANSIBLE_REMOTE_TEMP = /tmp ANSIBLE_LOCAL_TEMP = /tmp ansible -i "127.0.0.1," -c local -v -m wait_for -a " host= $RABBITMQ_HOST port=5672 " all
2017-12-04 19:08:40 +03:00
ANSIBLE_REMOTE_TEMP = /tmp ANSIBLE_LOCAL_TEMP = /tmp ansible -i "127.0.0.1," -c local -v -m postgresql_db -U $DATABASE_USER -a " name= $DATABASE_NAME owner= $DATABASE_USER login_user= $DATABASE_USER login_host= $DATABASE_HOST login_password= $DATABASE_PASSWORD port= $DATABASE_PORT " all
2017-10-06 17:47:02 +03:00
2017-08-03 17:39:04 +03:00
awx-manage migrate --noinput --fake-initial
2017-09-22 04:31:26 +03:00
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
awx-manage create_preload_data
else
echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'root@localhost', 'password')" | awx-manage shell
awx-manage create_preload_data
fi
2018-02-27 00:35:36 +03:00
echo 'from django.conf import settings; x = settings.AWX_TASK_ENV; x["HOME"] = "/var/lib/awx"; settings.AWX_TASK_ENV = x' | awx-manage shell
2017-08-08 22:18:07 +03:00
awx-manage provision_instance --hostname= $( hostname)
2017-11-16 22:55:17 +03:00
awx-manage register_queue --queuename= tower --instance_percent= 100
2017-06-30 22:25:10 +03:00
supervisord -c /supervisor_task.conf