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

Remove Pulp 2 functionality #271

Closed
wants to merge 4 commits into from
Closed

Conversation

ekohl
Copy link
Member

@ekohl ekohl commented Jul 2, 2020

Includes #268

Various TODOs in the code that should be looked at.

additional_includes => ["${apache::confd_dir}/pulp-vhosts80/*.conf"],
custom_fragment => template('foreman_proxy_content/httpd_pub.erb'),
}
}
Copy link
Member

Choose a reason for hiding this comment

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

With Pulp 2 removed, we still need the pub dir (but not necessarily this implementation of it). This is responsible for some non-Pulp related things:

  • serving katello-consumer-rpm
  • serving CA cert
  • serving katello-client-bootstrap

Copy link
Member

Choose a reason for hiding this comment

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

Ohh, I see you moved that up into init

@ehelms
Copy link
Member

ehelms commented Jul 6, 2020

I am seeing the following testing this with the pulpcore change:

Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Selboolean[httpd_can_network_connect] is already declared at (file: /usr/share/foreman-installer/modules/foreman/manifests/config/apache.pp, line: 226); cannot redeclare (file: /usr/share/foreman-installer/modules/selinux/manifests/boolean.pp, line: 41) (file: /usr/share/foreman-installer/modules/selinux/manifests/boolean.pp, line: 41, column: 5) (file: /usr/share/foreman-installer/modules/pulpcore/manifests/apache.pp, line: 120) on node pipeline-katello-server-nightly-centos8.woodford.example.com

@ehelms
Copy link
Member

ehelms commented Jul 6, 2020

There is also a failure in creating the vhost fragments for Pulpcore, looks like the vhost priority needs to be passed in if attaching to another vhost.

[ WARN 2020-07-06T18:31:47 main]  /Stage[main]/Pulpcore::Apache/Pulpcore::Apache::Fragment[pulpcore]/Apache::Vhost::Fragment[pulpcore-http-pulpcore]/Concat::Fragment[foreman-pulpcore-http-pulpcore]/Concat_fragment[foreman-pulpcore-http-pulpcore]: Target Concat_file with path or title '10-foreman.conf' or tag '10-foreman.conf not found in the catalog
[ WARN 2020-07-06T18:31:47 main]  /Stage[main]/Pulpcore::Apache/Pulpcore::Apache::Fragment[pulpcore]/Apache::Vhost::Fragment[pulpcore-https-pulpcore]/Concat::Fragment[foreman-ssl-pulpcore-https-pulpcore]/Concat_fragment[foreman-ssl-pulpcore-https-pulpcore]: Target Concat_file with path or title '10-foreman-ssl.conf' or tag '10-foreman-ssl.conf not found in the catalog
[ WARN 2020-07-06T18:31:47 main]  /Stage[main]/Foreman_proxy_content/Pulpcore::Apache::Fragment[pub_dir]/Apache::Vhost::Fragment[pulpcore-http-pub_dir]/Concat::Fragment[foreman-pulpcore-http-pub_dir]/Concat_fragment[foreman-pulpcore-http-pub_dir]: Target Concat_file with path or title '10-foreman.conf' or tag '10-foreman.conf not found in the catalog
[ WARN 2020-07-06T18:31:47 main]  /Stage[main]/Foreman_proxy_content/Pulpcore::Apache::Fragment[pub_dir]/Apache::Vhost::Fragment[pulpcore-https-pub_dir]/Concat::Fragment[foreman-ssl-pulpcore-https-pub_dir]/Concat_fragment[foreman-ssl-pulpcore-https-pub_dir]: Target Concat_file with path or title '10-foreman-ssl.conf' or tag '10-foreman-ssl.conf not found in the catalog
[ WARN 2020-07-06T18:31:47 main]  /Stage[main]/Foreman_proxy_content/Pulpcore::Apache::Fragment[gpg_key_proxy]/Apache::Vhost::Fragment[pulpcore-https-gpg_key_proxy]/Concat::Fragment[foreman-ssl-pulpcore-https-gpg_key_proxy]/Concat_fragment[foreman-ssl-pulpcore-https-gpg_key_proxy]: Target Concat_file with path or title '10-foreman-ssl.conf' or tag '10-foreman-ssl.conf not found in the catalog
[ WARN 2020-07-06T18:31:47 main]  /Stage[main]/Pulpcore::Plugin::Container/Pulpcore::Plugin[container]/Pulpcore::Apache::Fragment[plugin-container]/Apache::Vhost::Fragment[pulpcore-https-plugin-container]/Concat::Fragment[foreman-ssl-pulpcore-https-plugin-container]/Concat_fragment[foreman-ssl-pulpcore-https-plugin-container]: Target Concat_file with path or title '10-foreman-ssl.conf' or tag '10-foreman-ssl.conf not found in the catalog
[ WARN 2020-07-06T18:31:47 main]  /Stage[main]/Pulpcore::Plugin::File/Pulpcore::Plugin[file]/Pulpcore::Apache::Fragment[plugin-file]/Apache::Vhost::Fragment[pulpcore-http-plugin-file]/Concat::Fragment[foreman-pulpcore-http-plugin-file]/Concat_fragment[foreman-pulpcore-http-plugin-file]: Target Concat_file with path or title '10-foreman.conf' or tag '10-foreman.conf not found in the catalog
[ WARN 2020-07-06T18:31:47 main]  /Stage[main]/Pulpcore::Plugin::File/Pulpcore::Plugin[file]/Pulpcore::Apache::Fragment[plugin-file]/Apache::Vhost::Fragment[pulpcore-https-plugin-file]/Concat::Fragment[foreman-ssl-pulpcore-https-plugin-file]/Concat_fragment[foreman-ssl-pulpcore-https-plugin-file]: Target Concat_file with path or title '10-foreman-ssl.conf' or tag '10-foreman-ssl.conf not found in the catalog
[ WARN 2020-07-06T18:31:47 main]  /Stage[main]/Pulpcore::Plugin::Rpm/Pulpcore::Plugin[rpm]/Pulpcore::Apache::Fragment[plugin-rpm]/Apache::Vhost::Fragment[pulpcore-http-plugin-rpm]/Concat::Fragment[foreman-pulpcore-http-plugin-rpm]/Concat_fragment[foreman-pulpcore-http-plugin-rpm]: Target Concat_file with path or title '10-foreman.conf' or tag '10-foreman.conf not found in the catalog
[ WARN 2020-07-06T18:31:47 main]  /Stage[main]/Pulpcore::Plugin::Rpm/Pulpcore::Plugin[rpm]/Pulpcore::Apache::Fragment[plugin-rpm]/Apache::Vhost::Fragment[pulpcore-https-plugin-rpm]/Concat::Fragment[foreman-ssl-pulpcore-https-plugin-rpm]/Concat_fragment[foreman-ssl-pulpcore-https-plugin-rpm]: Target Concat_file with path or title '10-foreman-ssl.conf' or tag '10-foreman-ssl.conf not found in the catalog

@ekohl
Copy link
Member Author

ekohl commented Jul 6, 2020

I have not even tried to run it myself. It was only me quickly going over the code and see what would roughly be the steps and things that should remain.

I am seeing the following testing this with the pulpcore change:

Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Selboolean[httpd_can_network_connect] is already declared at (file: /usr/share/foreman-installer/modules/foreman/manifests/config/apache.pp, line: 226); cannot redeclare (file: /usr/share/foreman-installer/modules/selinux/manifests/boolean.pp, line: 41) (file: /usr/share/foreman-installer/modules/selinux/manifests/boolean.pp, line: 41, column: 5) (file: /usr/share/foreman-installer/modules/pulpcore/manifests/apache.pp, line: 120) on node pipeline-katello-server-nightly-centos8.woodford.example.com

I suspected as much, see the TODO there. Perhaps it's better to make it part of the SELinux policy. Same for Foreman itself. theforeman/puppet-foreman#849 is another example of someone who ran into this.

There is also a failure in creating the vhost fragments for Pulpcore, looks like the vhost priority needs to be passed in if attaching to another vhost.

Looks like Foreman uses the 05 priority. Perhaps we do need to expose it as a top level parameter. Now you can set it via Hiera.

@ehelms
Copy link
Member

ehelms commented Jul 6, 2020

I don't expect this to fully work yet :) But there is enough work that needs this that I am helpin speed up the testing.

Looks like Foreman uses the 05 priority. Perhaps we do need to expose it as a top level parameter. Now you can set it via Hiera.

From testing this, it's available to be retrieved. We should need to pass it in here -- https://github.com/theforeman/puppet-foreman_proxy_content/pull/271/files#diff-60ae41fd0a31977447947f59940ee9a4R125 as something like apache_vhost_priority => $foreman::config::apache::priority, to a parameter on puppet-pulpcore. That worked for me locally.

Stdlib::Port $reverse_proxy_port = 8443,

Optional[String] $rhsm_hostname = undef,
String $rhsm_url = '/rhsm', # TODO: Not really a URL
Copy link
Member

Choose a reason for hiding this comment

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

Probably shouldn't be configurable to be honest, the API is the API.

Copy link
Member Author

Choose a reason for hiding this comment

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

Having it live in a variable is generally a good thing and I think this still has some room to split functionality in smaller classes. Then you can make it a parameter on the private class API but not expose it in the public class API.

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 good with it being a variable, I meant the perceived intent that a user can and should change the value is wrong. This is a hard-coded API in the Katello plugin so having this be changeable by someone using the public interface of this module can result in incorrect behavior.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, but I'm first going to focus on the Pulp parts. It should probably be done as part of #272 since that does introduce the private API I was thinking about.

manifests/init.pp Outdated Show resolved Hide resolved
@ekohl
Copy link
Member Author

ekohl commented Jul 7, 2020

Updated:

  • Initial version which allows deploying without Foreman via $attach_to_foreman_vhost
  • Pass the vhost priority
  • Remove $parent_fqdn

@ehelms
Copy link
Member

ehelms commented Jul 9, 2020

Could you update this next time around to point to https://projects.theforeman.org/issues/30359

This is handled in the spec helper and only leads to a duplicate report.
When Pulp 2 parameters are set, Pulp 3 parameters should also be set.
This disabled Pulp 3 in many cases leading to faster spec tests.
With RSpec contexts can be nested and they'll inherit the parent let
blocks. The descriptions will be included as well.
@ekohl
Copy link
Member Author

ekohl commented Dec 2, 2020

Rebased just to see how it would look. This still assumes Pulp 2 and qpid are removed at the same time.

@ekohl
Copy link
Member Author

ekohl commented Dec 14, 2020

Closing in favor of #306

@ekohl ekohl closed this Dec 14, 2020
@ekohl ekohl deleted the remove-pulp2 branch December 14, 2020 14:08
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

3 participants