From 390401edeec1b3ab64112e7847a73ea223fc1779 Mon Sep 17 00:00:00 2001 From: Samir Jha Date: Thu, 2 Apr 2020 16:30:29 -0400 Subject: [PATCH] Create admin user --- manifests/database.pp | 6 ++++++ spec/acceptance/basic_spec.rb | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/manifests/database.pp b/manifests/database.pp index f7f4a26c..9c92956e 100644 --- a/manifests/database.pp +++ b/manifests/database.pp @@ -16,6 +16,12 @@ refreshonly => false, } + pulpcore::admin { 'reset-admin-password --random': + unless => 'python3-django-admin dumpdata | grep "auth.user"', + refreshonly => false, + require => Pulpcore::Admin['migrate --noinput'], + } + include redis } diff --git a/spec/acceptance/basic_spec.rb b/spec/acceptance/basic_spec.rb index 7d734b6f..e273c037 100644 --- a/spec/acceptance/basic_spec.rb +++ b/spec/acceptance/basic_spec.rb @@ -54,4 +54,8 @@ class { 'redis::globals': its(:exit_status) { is_expected.to eq 0 } end + describe command("DJANGO_SETTINGS_MODULE=pulpcore.app.settings PULP_SETTINGS=/etc/pulp/settings.py python3-django-admin dumpdata | grep 'auth.user'") do + its(:exit_status) { is_expected.to eq 0 } + end + end