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 b4939a2
Show file tree
Hide file tree
Showing 3 changed files with 12 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 auth.User | grep "auth.user"',
refreshonly => false,
require => Pulpcore::Admin['migrate --noinput'],
}

include redis

}
5 changes: 5 additions & 0 deletions spec/acceptance/basic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,9 @@ 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 auth.User") do
its(:stdout) { is_expected.to match(/auth\.user/) }
its(:exit_status) { is_expected.to eq 0 }
end

end
1 change: 1 addition & 0 deletions spec/classes/pulpcore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
is_expected.to contain_postgresql__server__db('pulpcore')
is_expected.to contain_apache__vhost('pulp')
is_expected.to contain_selinux__boolean('httpd_can_network_connect')
is_expected.to contain_pulpcore__admin('reset-admin-password --random')
end
end

Expand Down

0 comments on commit b4939a2

Please sign in to comment.