mirror of
https://github.com/ansible/awx.git
synced 2026-04-13 22:19:27 -02:30
Merge pull request #12753 from shanemcd/custom-dev-env-admin-pw
Allow for setting custom admin password in dev environment
This commit is contained in:
3
Makefile
3
Makefile
@@ -469,7 +469,8 @@ docker-compose-sources: .git/hooks/pre-commit
|
|||||||
-e enable_ldap=$(LDAP) \
|
-e enable_ldap=$(LDAP) \
|
||||||
-e enable_splunk=$(SPLUNK) \
|
-e enable_splunk=$(SPLUNK) \
|
||||||
-e enable_prometheus=$(PROMETHEUS) \
|
-e enable_prometheus=$(PROMETHEUS) \
|
||||||
-e enable_grafana=$(GRAFANA)
|
-e enable_grafana=$(GRAFANA) \
|
||||||
|
-e admin_password=$(ADMIN_PASSWORD)
|
||||||
|
|
||||||
|
|
||||||
docker-compose: awx/projects docker-compose-sources
|
docker-compose: awx/projects docker-compose-sources
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
- pg_password
|
- pg_password
|
||||||
- secret_key
|
- secret_key
|
||||||
- broadcast_websocket_secret
|
- broadcast_websocket_secret
|
||||||
|
- admin_password
|
||||||
|
|
||||||
- name: Generate secrets if needed
|
- name: Generate secrets if needed
|
||||||
template:
|
template:
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ services:
|
|||||||
CONTROL_PLANE_NODE_COUNT: {{ control_plane_node_count|int }}
|
CONTROL_PLANE_NODE_COUNT: {{ control_plane_node_count|int }}
|
||||||
EXECUTION_NODE_COUNT: {{ execution_node_count|int }}
|
EXECUTION_NODE_COUNT: {{ execution_node_count|int }}
|
||||||
AWX_LOGGING_MODE: stdout
|
AWX_LOGGING_MODE: stdout
|
||||||
|
DJANGO_SUPERUSER_PASSWORD: {{ admin_password }}
|
||||||
{% if loop.index == 1 %}
|
{% if loop.index == 1 %}
|
||||||
RUN_MIGRATIONS: 1
|
RUN_MIGRATIONS: 1
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -21,10 +21,9 @@ fi
|
|||||||
|
|
||||||
if output=$(awx-manage createsuperuser --noinput --username=admin --email=admin@localhost 2> /dev/null); then
|
if output=$(awx-manage createsuperuser --noinput --username=admin --email=admin@localhost 2> /dev/null); then
|
||||||
echo $output
|
echo $output
|
||||||
admin_password=$(openssl rand -base64 12)
|
|
||||||
echo "Admin password: ${admin_password}"
|
|
||||||
awx-manage update_password --username=admin --password=${admin_password}
|
|
||||||
fi
|
fi
|
||||||
|
echo "Admin password: ${DJANGO_SUPERUSER_PASSWORD}"
|
||||||
|
|
||||||
awx-manage create_preload_data
|
awx-manage create_preload_data
|
||||||
awx-manage register_default_execution_environments
|
awx-manage register_default_execution_environments
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user