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 #5967 - initial updates to support default capsule #4214
Conversation
# 3. puppet classes | ||
content_view.repos(env).each { |repo| Medium.update_media(repo) } | ||
|
||
unless content_view.default? | ||
foreman_environment = Environment.find_or_create_by_katello_id(org, env, content_view) | ||
|
||
# Retrieve the list of capsules associated with the target org+env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about using CapsuleContent.with_environment(env)
Haven't tested it yet, but the code looks good, just some minor comments. |
@iNecas, thanks for the comments! PR updated. |
ACK |
@@ -133,6 +134,11 @@ def create_redhat_provider | |||
self.providers << Katello::Provider.new(:name => "Red Hat", :provider_type => Katello::Provider::REDHAT) | |||
end | |||
|
|||
def associate_default_capsule | |||
capsule_content = CapsuleContent.default_capsule | |||
capsule_content.capsule.organizations << self if capsule_content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the capsule object here actually get saved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it would due to the relationship?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, relationships with << save automatically, thank you Rails for the consistency :sarcasmface:
This commit contains several changes to support a 'default' capsule. With each fortello installation, there will be a capsule installed. That capsule will not provide pulp node functionality, since pulp functionality is provided by the pulp server running on the fortello server; however, it can provide other features such as puppet, dhcp...etc. With these changes, the 'default' capsule will be automatically associated with the following resources: - all organizations configured on the fortello server - the default location - all lifecycle environments In addition, it will not be allowed for a user to perform CLI commands which would alter the 'default' capsule. For example, the following commands would generate an error: - capsule content add-lifecycle-environment - capsule content remove-lifecycle-environment - capsule content synchronize That said, a user could still look to see details on the 'default' capsule using the other supported CLI commands such as: - capsule list - capsule content info - capsule content lifecycle-environments With the above, this 'default' capsule can then be used to help support things like: - When a puppet environment is created as part of publishing or promoting a content view, associate that puppet environment with the appropriate locations. This would be achieved by retrieving the list of locations that are associated with capsules that are currently syncing content for the target lifecycle environment.
@bbuckingham I'm assuming this does not handle changing the puppet environments's locations if the user add or removes locations from the capsule? Can we open an issue on that if not? |
@jlsherrill, good point. Created the following redmine issue to add that functionality: http://projects.theforeman.org/issues/6074 |
ACK fro me |
fixes #5967 - initial updates to support default capsule
This commit contains several changes to support a 'default' capsule.
With each fortello installation, there will be a capsule installed.
That capsule will not provide pulp node functionality, since pulp
functionality is provided by the pulp server running on the fortello
server; however, it can provide other features such as puppet, dhcp...etc.
With these changes, the 'default' capsule will be automatically associated
with the following resources:
In addition, it will not be allowed for a user to perform CLI commands
which would alter the 'default' capsule. For example, the following commands
would generate an error:
That said, a user could still look to see details on the 'default'
capsule using the other supported CLI commands such as:
With the above, this 'default' capsule can then be used to help
support things like:
or promoting a content view, associate that puppet environment
with the appropriate locations. This would be achieved by
retrieving the list of locations that are associated with
capsules that are currently syncing content for the
target lifecycle environment.