Skip to content

Commit

Permalink
Create admin user
Browse files Browse the repository at this point in the history
  • Loading branch information
sjha4 committed Apr 3, 2020
1 parent dffc81e commit 05c5f01
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
6 changes: 6 additions & 0 deletions manifests/database.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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

}
23 changes: 23 additions & 0 deletions spec/defines/admin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,29 @@
.with_unless('/usr/bin/false')
end
end

context 'default parameters' do
let(:params) do
super().merge(
command: 'reset-admin-password --random',
refreshonly: false,
unless: '/usr/bin/false',
static_root: '/var/lib/pulp/assets',
)
end

it do
is_expected.to compile.with_all_deps
is_expected.to contain_exec('python3-django-admin help')
.with_environment([
'DJANGO_SETTINGS_MODULE=pulpcore.app.settings',
'PULP_SETTINGS=/etc/pulpcore/settings.py',
'PULP_STATIC_ROOT=/var/lib/pulp/assets',
])
.with_refreshonly(false)
.with_unless('/usr/bin/false')
end
end
end

context 'with inheritance' do
Expand Down

0 comments on commit 05c5f01

Please sign in to comment.