summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJAKUBIS Peter H50R8VA <peter.jakubis@erstegroup.com>2020-12-02 16:17:25 +0100
committerJAKUBIS Peter H50R8VA <peter.jakubis@erstegroup.com>2020-12-02 16:17:25 +0100
commita5f676c3e10d0f24ea744dcd23172accc5bb29a6 (patch)
treefe4a045b8b0a15ad3a3828f3cc03cbd8a1f407c3
parentMerge pull request #8727 from AlanCoding/mercury_drops (diff)
downloadawx-a5f676c3e10d0f24ea744dcd23172accc5bb29a6.tar.xz
awx-a5f676c3e10d0f24ea744dcd23172accc5bb29a6.zip
make preload data optional again
Signed-off-by: JAKUBIS Peter H50R8VA <peter.jakubis@erstegroup.com>
-rwxr-xr-xinstaller/roles/image_build/templates/launch_awx_task.sh.j23
-rw-r--r--installer/roles/kubernetes/templates/launch_awx.yml.j22
-rw-r--r--installer/roles/local_docker/tasks/compose.yml6
3 files changed, 6 insertions, 5 deletions
diff --git a/installer/roles/image_build/templates/launch_awx_task.sh.j2 b/installer/roles/image_build/templates/launch_awx_task.sh.j2
index 7ff8e56cf2..49806df485 100755
--- a/installer/roles/image_build/templates/launch_awx_task.sh.j2
+++ b/installer/roles/image_build/templates/launch_awx_task.sh.j2
@@ -24,9 +24,6 @@ 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
- {% if create_preload_data | bool %}
- awx-manage create_preload_data
- {% endif %}
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
diff --git a/installer/roles/kubernetes/templates/launch_awx.yml.j2 b/installer/roles/kubernetes/templates/launch_awx.yml.j2
index 66a4361372..cc6cdadaf1 100644
--- a/installer/roles/kubernetes/templates/launch_awx.yml.j2
+++ b/installer/roles/kubernetes/templates/launch_awx.yml.j2
@@ -24,10 +24,8 @@ 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
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)
diff --git a/installer/roles/local_docker/tasks/compose.yml b/installer/roles/local_docker/tasks/compose.yml
index 9a95ddabc3..e2f0fc6663 100644
--- a/installer/roles/local_docker/tasks/compose.yml
+++ b/installer/roles/local_docker/tasks/compose.yml
@@ -49,4 +49,10 @@
- name: Update CA trust in awx_task container
command: docker exec awx_task '/usr/bin/update-ca-trust'
when: awx_compose_config.changed or awx_compose_start.changed
+
+ - name: Create Preload data
+ command: docker exec awx_task bash -c "/usr/bin/awx-manage create_preload_data"
+ when: create_preload_data|bool
+ register: cdo
+ changed_when: "'added' in cdo.stdout"
when: compose_start_containers|bool