mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Allow pre-populating the default AWX superuser account
This commit is contained in:
parent
7a052e6f0c
commit
73a37a281d
@ -6,8 +6,13 @@ if [ `id -u` -ge 10000 ]; then
|
||||
fi
|
||||
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" all
|
||||
awx-manage migrate --noinput --fake-initial
|
||||
echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'root@localhost', 'password')" | awx-manage shell
|
||||
awx-manage create_preload_data
|
||||
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
|
||||
awx-manage provision_instance --hostname=$(hostname)
|
||||
awx-manage register_queue --queuename=tower --hostnames=$(hostname)
|
||||
supervisord -c /supervisor_task.conf
|
||||
|
||||
@ -2,6 +2,11 @@ localhost ansible_connection=local ansible_python_interpreter="/usr/bin/env pyth
|
||||
|
||||
[all:vars]
|
||||
|
||||
# This will create or update a default admin (superuser) account in AWX, if not provided
|
||||
# then these default values are used
|
||||
# default_admin_user=admin
|
||||
# default_admin_password=password
|
||||
|
||||
# Use a local distribution build container image for building the AWX package
|
||||
# This is helpful if you don't want to bother installing the build-time dependencies as
|
||||
# it is taken care of already.
|
||||
|
||||
@ -189,6 +189,8 @@
|
||||
RABBITMQ_VHOST: "awx"
|
||||
MEMCACHED_HOST: "memcached"
|
||||
MEMCACHED_PORT: "11211"
|
||||
AWX_ADMIN_USER: "{{ default_admin_user|default('admin') }}"
|
||||
AWX_ADMIN_PASSWORD: "{{ default_admin_password|default('password') }}"
|
||||
|
||||
- name: Activate AWX Task Container
|
||||
docker_container:
|
||||
@ -212,4 +214,6 @@
|
||||
RABBITMQ_VHOST: "awx"
|
||||
MEMCACHED_HOST: "memcached"
|
||||
MEMCACHED_PORT: "11211"
|
||||
SECRET_KEY: "{{ awx_secret_key }}"
|
||||
AWX_ADMIN_USER: "{{ default_admin_user|default('admin') }}"
|
||||
AWX_ADMIN_PASSWORD: "{{ default_admin_password|default('password') }}"
|
||||
|
||||
|
||||
@ -34,6 +34,10 @@ spec:
|
||||
value: {{ pg_hostname|default('postgresql') }}
|
||||
- name: DATABASE_PASSWORD
|
||||
value: {{ pg_password }}
|
||||
- name: AWX_ADMIN_USER
|
||||
value: {{ default_admin_user|default('admin') }}
|
||||
- name: AWX_ADMIN_PASSWORD
|
||||
value: {{ default_admin_password|default('password') }}
|
||||
- name: awx-rabbit
|
||||
image: rabbitmq:3
|
||||
env:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user