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

Ensure Foreman is provisioned before configuring cockpit #835

Merged
merged 1 commit into from
May 4, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion manifests/plugin/remote_execution/cockpit.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
}

foreman_config_entry { 'remote_execution_cockpit_url':
value => "${cockpit_path}/=%{host}",
value => "${cockpit_path}/=%{host}",
require => Class['foreman::database'],
Copy link
Member

Choose a reason for hiding this comment

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

Does this ensure that all of the class has executed before this will execute? e.g. db:seed

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, those resources are contained within the class (if they're managed).

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, I just loose track of puppet and how it build it's dependency cycle. Sounds like we could clean this up a bit?

https://github.com/theforeman/puppet-katello/blob/master/manifests/application.pp#L36

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that would be better. I've had a look at doing this in the type definition, but since the config part is also used within that, we can't always require the class.

}
}
5 changes: 5 additions & 0 deletions spec/classes/plugin/remote_execution_cockpit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ class {'foreman':

it { is_expected.to contain_service('foreman-cockpit').with_ensure('running').with_enable('true') }

it do
is_expected.to contain_foreman_config_entry('remote_execution_cockpit_url')
.that_requires(['Class[foreman::database]', 'Foreman::Plugin[remote_execution-cockpit]'])
end

it 'creates configs' do
is_expected.to contain_file('/etc/foreman/cockpit/cockpit.conf')
.with_ensure('file')
Expand Down