Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use provides, not the python package name for plugins #233

Merged
merged 3 commits into from Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -14,6 +14,8 @@ Supported operating systems are listed in `metadata.json` but individual release

Only supported version.

At lest pulpcore 3.14.8-2 (and matching plugins) should be used, as this version introduced virtual package names that are used in this module.

## Installation layout

Pulpcore doesn't mandate a specific layout so this module creates and manages this. There are some constraints, mostly due to SELinux support.
Expand Down
2 changes: 1 addition & 1 deletion manifests/install.pp
Expand Up @@ -3,7 +3,7 @@
# @api private
class pulpcore::install {

package { 'python3-pulpcore':
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekohl or should this "Provides: pulpcore"?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you still want to explicitly install the package in case there is no plugin. I'd be happy with a Provides: pulpcore and then install pulpcore.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no plugin, pulpcore won't start up 🤷‍♀️

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I backed these out for now, as tests fail without 🤷‍♀️

package { 'pulpcore':
ensure => present,
}

Expand Down
2 changes: 1 addition & 1 deletion manifests/plugin.pp
Expand Up @@ -12,7 +12,7 @@
# @param https_content
# Optional fragment for the Apache HTTPS vhost
define pulpcore::plugin(
String $package_name = "python3-pulp-${title}",
String $package_name = "pulpcore-plugin(${title})",
Optional[String] $config = undef,
Optional[String] $http_content = undef,
Optional[String] $https_content = undef,
Expand Down
2 changes: 1 addition & 1 deletion manifests/plugin/migration.pp
Expand Up @@ -43,7 +43,7 @@
Stdlib::Absolutepath $mongo_db_ca_path = '/etc/pki/tls/certs/ca-bundle.crt',
) {
pulpcore::plugin { 'migration':
package_name => 'python3-pulp-2to3-migration',
package_name => 'pulpcore-plugin(2to3-migration)',
config => template('pulpcore/migration-settings.py.erb'),
}
}
2 changes: 1 addition & 1 deletion spec/classes/plugin_ansible_spec.rb
Expand Up @@ -14,7 +14,7 @@
end

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package('python3-pulp-ansible') }
it { is_expected.to contain_package('pulpcore-plugin(ansible)') }
it { is_expected.to contain_pulpcore__plugin('ansible') }
it do
is_expected.to compile.with_all_deps
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/plugin_certguard_spec.rb
Expand Up @@ -7,7 +7,7 @@

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package('python3-subscription-manager-rhsm').with_ensure('present') }
it { is_expected.to contain_package('python3-pulp-certguard') }
it { is_expected.to contain_package('pulpcore-plugin(certguard)') }
it { is_expected.to contain_pulpcore__plugin('certguard') }

context 'with pulpcore' do
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/plugin_container_spec.rb
Expand Up @@ -11,7 +11,7 @@
is_expected.to contain_pulpcore__plugin('container')
.that_subscribes_to('Class[Pulpcore::Install]')
.that_notifies(['Class[Pulpcore::Database]', 'Class[Pulpcore::Service]'])
is_expected.to contain_package('python3-pulp-container')
is_expected.to contain_package('pulpcore-plugin(container)')
is_expected.to contain_concat__fragment('plugin-container').with_content("\n# container plugin settings\nTOKEN_AUTH_DISABLED=True")
is_expected.to contain_pulpcore__apache__fragment('plugin-container')
is_expected.not_to contain_apache__vhost__fragment('pulpcore-http-plugin-container')
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/plugin_deb_spec.rb
Expand Up @@ -7,7 +7,7 @@

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_pulpcore__plugin('deb') }
it { is_expected.to contain_package('python3-pulp-deb') }
it { is_expected.to contain_package('pulpcore-plugin(deb)') }
it { is_expected.not_to contain_apache__vhost__fragment('pulpcore-http-plugin-deb') }
it { is_expected.not_to contain_apache__vhost__fragment('pulpcore-https-plugin-deb') }

Expand Down
2 changes: 1 addition & 1 deletion spec/classes/plugin_file_spec.rb
Expand Up @@ -6,7 +6,7 @@
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package('python3-pulp-file') }
it { is_expected.to contain_package('pulpcore-plugin(file)') }
it { is_expected.to contain_pulpcore__plugin('file') }

context 'with pulpcore' do
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/plugin_migration_spec.rb
Expand Up @@ -17,7 +17,7 @@

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_pulpcore__plugin('migration') }
it { is_expected.to contain_package('python3-pulp-2to3-migration') }
it { is_expected.to contain_package('pulpcore-plugin(2to3-migration)') }
it { is_expected.to contain_concat__fragment('plugin-migration').with_content("\n# migration plugin settings\n#{migration_config}") }

context 'with pulpcore' do
Expand All @@ -26,7 +26,7 @@
it do
is_expected.to compile.with_all_deps
is_expected.to contain_pulpcore__plugin('migration')
.with_package_name('python3-pulp-2to3-migration')
.with_package_name('pulpcore-plugin(2to3-migration)')
.with_config(migration_config)
.that_subscribes_to('Class[Pulpcore::Install]')
.that_notifies(['Class[Pulpcore::Database]', 'Class[Pulpcore::Service]'])
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/plugin_rpm_spec.rb
Expand Up @@ -6,7 +6,7 @@
let(:facts) { os_facts }

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_package('python3-pulp-rpm') }
it { is_expected.to contain_package('pulpcore-plugin(rpm)') }
it { is_expected.to contain_pulpcore__plugin('rpm') }
it { is_expected.not_to contain_apache__vhost__fragment('pulpcore-http-plugin-rpm') }
it { is_expected.not_to contain_apache__vhost__fragment('pulpcore-https-plugin-rpm') }
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/pulpcore_spec.rb
Expand Up @@ -10,7 +10,7 @@

it 'installs' do
is_expected.to contain_class('pulpcore::install')
is_expected.to contain_package('python3-pulpcore')
is_expected.to contain_package('pulpcore')
is_expected.to contain_package('pulpcore-selinux')
is_expected.to contain_user('pulp').with_gid('pulp').with_home('/var/lib/pulp')
is_expected.to contain_group('pulp')
Expand Down Expand Up @@ -335,7 +335,7 @@
is_expected.to contain_pulpcore__plugin('myplugin')
.that_subscribes_to('Class[Pulpcore::Install]')
.that_notifies(['Class[Pulpcore::Database]', 'Class[Pulpcore::Service]'])
is_expected.to contain_package('python3-pulp-myplugin')
is_expected.to contain_package('pulpcore-plugin(myplugin)')
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/defines/plugin_spec.rb
Expand Up @@ -8,14 +8,14 @@

context 'without parameters' do
it { is_expected.to compile.with_all_deps }
it { is_expected.to create_package('python3-pulp-myplugin').with_ensure('present') }
it { is_expected.to create_package('pulpcore-plugin(myplugin)').with_ensure('present') }
end

context 'with package name' do
let(:params) { { package_name: 'breaking-conventions' } }

it { is_expected.to compile.with_all_deps }
it { is_expected.not_to contain_package('python3-pulp-myplugin') }
it { is_expected.not_to contain_package('pulpcore-plugin(myplugin)') }
it { is_expected.to create_package('breaking-conventions').with_ensure('present') }
end
end
Expand Down