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

Fixes #13191, #13192, #13193, #13195, #13196 - Remove pulp nodes #5750

Closed
wants to merge 0 commits into from

Conversation

johnpmitsch
Copy link
Contributor

This removes pulp nodes as they are not needed anymore in pulp 2.8

The pulp server on the capsule is now contacted directly

end

def checksum_type
nil
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jlsherrill I'm not too sure what I should do about these unprotected and checksum type methods, any suggestions?

Copy link
Member

Choose a reason for hiding this comment

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

we really need to turn unprotected into an attribute on the content view and look it up, but thats a feature we should add at some point.

as for Checksum_type, you may add a check to anything that calls checksum_type to only call it for yum repos

Copy link
Member

Choose a reason for hiding this comment

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

To clarify, leave unprotected as it is, and see if you can modify the code so it doesn't call checksum_type


def create_repo_in_pulp(capsule_content, repository)
ueber_cert = ::Katello::Cert::Ca.ueber_cert(repository)
relative_path = repository.puppet? ? nil : repository.relative_path
Copy link
Member

Choose a reason for hiding this comment

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

actually relative_path is not nil if its a content_view_puppet_environment (in which case its the install_path) if i remember correctly:

https://github.com/Katello/katello/blob/master/app/lib/actions/katello/content_view_puppet_environment/create.rb#L18

@johnpmitsch johnpmitsch force-pushed the remove_pulp_nodes branch 2 times, most recently from 57012d3 to a0bff17 Compare February 2, 2016 15:46

def self.ssl_client_key
OpenSSL::PKey::RSA.new(File.open(SETTINGS[:katello][:ssl_client_key], 'r').read)
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jlsherrill I am trying to figure out how to organize this directory. I just stuck ssl_client_cert and ssl_client_key in here for now, but I think they should go in a separate module?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should refactor the existing services/client/cert.rb to handle all of these things?

Copy link
Member

Choose a reason for hiding this comment

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

👍 There is a mixture of things in here that don't align to what I think of with 'Ca' as the module name. A bit of bikeshedding but worth it.

end

katello_repos = Katello::Repository.where(:id => katello_repo_ids)
puppet_repos = Katello::ContentViewPuppetEnvironment.where(:id => puppet_repo_ids)
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 can simplify this a bit by querying by 'pulp_id' on repository and content view puppet enviornment rather than querying once based on id and then a 2nd time based on id.

@johnpmitsch johnpmitsch changed the title [WIP] Fixes #13191, #13192, #13193, #13195 - Remove pulp nodes Fixes #13191, #13192, #13193, #13195 - Remove pulp nodes Feb 4, 2016
@bbuckingham
Copy link
Member

@johnpmitsch, Should this PR remove abstract_node_distributor_task.rb, node_metadata_generate.rb and references to NodesHttpDistributor from katello/glue/pulp/consumer.rb?

module CapsuleContent
class CreateOrUpdate < ::Actions::EntryAction
# @param capsule_content [::Katello::CapsuleContent]
# @param pulp_repo [::Katello::Glue::Pulp::Repo]
Copy link
Member

Choose a reason for hiding this comment

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

Do these @param comments represent the inputs to the 'plan' method? If so, should they be updated to remove repo and add environment and content_view?

self.set('pulp_export_destination', N_("On-disk location for exported repositories"), "/tmp/katello-repo-exports")
self.set('pulp_export_destination', N_("On-disk location for exported repositories"), "/tmp/katello-repo-exports"),
self.set('pulp_client_key', N_("Path for ssl key used for pulp server auth"), "/etc/pki/katello/key.key"),
self.set('pulp_client_cert', N_("Path for ssl cert used for pulp server auth"), "/etc/pki/katello/server.crt")
Copy link
Member

Choose a reason for hiding this comment

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

These aren't the default values that are coming down from the installer, they are currently:

/etc/pki/katello/certs/abed.usersys.redhat.com-pulp-client.crt
&
/etc/pki/katello/private/abed.usersys.redhat.com-pulp-client.key

if that makes this difficult we may want to look at modifying the installer.

Copy link
Member

Choose a reason for hiding this comment

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

after chatting with eric, lets just set these to default to "" and update the setting in the installer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I totally forgot about this 😳 If there is no reason we need a hostname in the filename, I think it would be easier and lead to less problems to modify the installer to create a fixed name for the cert and key. I can make this change

Copy link
Member

Choose a reason for hiding this comment

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

you can use something like this: https://github.com/Katello/puppet-certs/blob/master/manifests/foreman.pp#L51-L54

to set the settings as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also changed the settings to "" for default

self.set('pulp_export_destination', N_("On-disk location for exported repositories"), File.join(Rails.root, 'repo-exports'))
self.set('pulp_export_destination', N_("On-disk location for exported repositories"), File.join(Rails.root, 'repo-exports')),
self.set('pulp_client_key', N_("Path for ssl key used for pulp server auth"), "/etc/pki/katello/private/pulp-client.key"),
self.set('pulp_client_cert', N_("Path for ssl cert used for pulp server auth"), "/etc/pki/katello/certs/pulp-client.crt")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Default values can't be blank so I added the file path that the installer will create here in the default

@johnpmitsch johnpmitsch force-pushed the remove_pulp_nodes branch 4 times, most recently from d545ac4 to df4cce9 Compare February 11, 2016 18:19
@johnpmitsch johnpmitsch changed the title Fixes #13191, #13192, #13193, #13195 - Remove pulp nodes Fixes #13191, #13192, #13193, #13195, #13196 - Remove pulp nodes Feb 11, 2016
checksum_type: checksum_type,
path: relative_path,
with_importer: true,
capsule_id: capsule_content.capsule.id)
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 need to pass in docker_upstream_name in here for docker rpeos

@theforeman-bot
Copy link

@johnpmitsch, this pull request is currently not mergeable. Please rebase against the master branch and push again.

If you have a remote called 'upstream' that points to this repository, you can do this by running:

    $ git pull --rebase upstream master

This message was auto-generated by Foreman's prprocessor

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.

5 participants