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

Refs #32037: Add flag to enable katello_agent infrastructure and disable it by default #329

Merged
merged 1 commit into from Apr 21, 2021

Conversation

ehelms
Copy link
Member

@ehelms ehelms commented Feb 19, 2021

No description provided.

@ehelms
Copy link
Member Author

ehelms commented Feb 19, 2021

See theforeman/puppet-katello#387 for more details

@@ -146,7 +147,7 @@

include foreman_proxy_content::pub_dir

if $qpid_router {
if $enable_katello_agent {
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if we should implement an else for this where we ensure it's stopped.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will we need to add some additional parameters to puppet-qpid to be able to ensure things are stopped? Given https://github.com/theforeman/puppet-qpid/blob/master/manifests/router/service.pp#L6

@ehelms ehelms marked this pull request as ready for review March 8, 2021 19:09
@ehelms
Copy link
Member Author

ehelms commented Mar 8, 2021

Relies on theforeman/puppet-qpid#148

@ehelms ehelms changed the title Add flag to enable katello_agent infrastructure and disable it by def… Fixes #32037: Add flag to enable katello_agent infrastructure and disable it by default Mar 8, 2021
Comment on lines 150 to 169
class { 'foreman_proxy_content::dispatch_router':
agent_addr => $qpid_router_agent_addr,
agent_port => $qpid_router_agent_port,
ssl_ciphers => $qpid_router_ssl_ciphers,
ssl_protocols => $qpid_router_ssl_protocols,
logging_level => $qpid_router_logging_level,
logging => $qpid_router_logging,
logging_path => $qpid_router_logging_path,
service_ensure => $enable_katello_agent,
service_enable => $enable_katello_agent,
}
contain foreman_proxy_content::dispatch_router
Copy link
Member

Choose a reason for hiding this comment

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

The only concern I have here is that this now always installs the router packages, even if the service is then disabled. Previously it didn't even install the packages.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we actually gain anything by having

class { 'foreman_proxy_content::dispatch_router':
  ...
}
contain foreman_proxy_content::dispatch_router

Declared outside of the

if $enable_katello_agent {
  ...
}

block?

It's not clear to me why you are moving it here.

Copy link
Member Author

Choose a reason for hiding this comment

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

It exists outside of the enable_katello_agent block because we don't know the previous state, and therefore we want to ensure the service isn't running if it previously was running. If we were to always put it within the enable_katello_agent block you could enable it and then disable it while leaving the services running.

The question I posed in a different forum, which @ekohl asks here (#329 (comment)) is whether it is sufficient to just disable the services when disabling katello-agent support (or when freshly setting things up to have no presence of) or if we need to propagate this effect to all entities: services, packages, config files. The same question applies here: https://github.com/theforeman/puppet-katello/pull/387/files#diff-4d995f8e71429e47718f73b6c9d8cad415c63a67017803143f5fa1a929d0f730R19

@wbclark
Copy link
Contributor

wbclark commented Mar 30, 2021

This needs a puppet-qpid release ( theforeman/puppet-qpid#151 ) to properly test it

Once that happens it also needs the dependency bumped to get the version which added that feature

@ekohl
Copy link
Member

ekohl commented Mar 31, 2021

This needs a puppet-qpid release ( theforeman/puppet-qpid#151 ) to properly test it

In the past I've changed .fixtures.yml to point to my branch just so CI would run. Obviously you need to update it prior to merging with a dependency on actual change but it's a good trick to remember.

@ehelms ehelms force-pushed the katello-agent-off branch 2 times, most recently from d4d75a5 to 91c3954 Compare March 31, 2021 19:29
@ehelms
Copy link
Member Author

ehelms commented Mar 31, 2021

Updated the metadata for the qpid 7.1.0 release and fixed up some failing tests

manifests/dispatch_router.pp Outdated Show resolved Hide resolved
manifests/init.pp Show resolved Hide resolved
@ehelms ehelms force-pushed the katello-agent-off branch 2 times, most recently from 30281b0 to aa84128 Compare April 7, 2021 19:20
Copy link
Contributor

@wbclark wbclark left a comment

Choose a reason for hiding this comment

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

The failure on bundle exec rake validate is happening because of a typo'd filename for the dispatch router acceptance test

I confirmed that was resolved with git mv spec/acceptance/dispatch_router_spec.{pp,rb}

@ehelms
Copy link
Member Author

ehelms commented Apr 8, 2021

The failure on bundle exec rake validate is happening because of a typo'd filename for the dispatch router acceptance test

I confirmed that was resolved with git mv spec/acceptance/dispatch_router_spec.{pp,rb}

Thanks. Things were not failing locally as it didnt seem to care about the extension and I could not see the forest for the trees.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Both this and theforeman/puppet-katello#387 use Fixes #32037. To me it's a bit confusing to have 2 PRs both close a Redmine issue. Since we'll likely need an installer migration to really finish it, should all of them be Refs and only the migration would use Fixes?

) {

class { 'qpid::router':
ensure => $ensure,
}
contain qpid::router

include certs::qpid_router::server
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps this should be inside if $ensure == 'present' {}. However, that also implies the ssl_profile should be hidden. That also makes me wonder if all router statements (listener and log) should be hidden.

manifests/init.pp Show resolved Hide resolved
metadata.json Outdated
@@ -26,7 +26,7 @@
},
{
"name": "katello/qpid",
"version_requirement": ">= 4.5.0 < 8.0.0"
"version_requirement": ">= 7.1.0 < 8.0.0"
Copy link
Member

Choose a reason for hiding this comment

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

Same note here as Katello: 7.1.0 doesn't contain the required patches.

@ehelms
Copy link
Member Author

ehelms commented Apr 8, 2021

Both this and theforeman/puppet-katello#387 use Fixes #32037. To me it's a bit confusing to have 2 PRs both close a Redmine issue. Since we'll likely need an installer migration to really finish it, should all of them be Refs and only the migration would use Fixes?

Will do.

@ehelms ehelms force-pushed the katello-agent-off branch 2 times, most recently from 83527a2 to cd7857b Compare April 8, 2021 19:41
@ehelms ehelms changed the title Fixes #32037: Add flag to enable katello_agent infrastructure and disable it by default Refs #32037: Add flag to enable katello_agent infrastructure and disable it by default Apr 15, 2021
logging_level => $qpid_router_logging_level,
logging => $qpid_router_logging,
logging_path => $qpid_router_logging_path,
ensure => bool2str($enable_katello_agent, 'present', 'absent'),
Copy link
Member

Choose a reason for hiding this comment

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

Odd: I thought there was a linting rule that preferred ensure to be the first line if given.

@@ -30,43 +34,50 @@
String $logging_level = 'info+',
Enum['file', 'syslog'] $logging = 'syslog',
Stdlib::Absolutepath $logging_path = '/var/log/qdrouterd',

Enum['present', 'absent'] $ensure = 'present',
Copy link
Member

Choose a reason for hiding this comment

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

It is common to have $ensure as the first

@ehelms ehelms merged commit f26e941 into theforeman:master Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants