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 #10533 - initial changes to support decoupling puppet-foreman_proxy from puppet-capsule #64

Merged
merged 1 commit into from
Jan 23, 2016

Conversation

bbuckingham
Copy link
Member

MODIFIED description:

decouple puppet-foreman_proxy from puppet-capsule

The changes in this PR are an initial step towards enabling katello and the capsule to be deployed as a kafo 'scenario' using the foreman-installer. It will also contain the configs to support installing using katello-installer and capsule-installer, for the near-term.

The following is an example of using the scenario-based installer to install a capsule using this module:

foreman-installer --scenario capsule \
                  --capsule-parent-fqdn                 "katello.example.com"\
                  --foreman-proxy-register-in-foreman   "true"\
                  --foreman-proxy-registered-proxy-url  "https://capsule.example.com:9090"\
                  --foreman-proxy-oauth-consumer-key    "QSJ2qCGV3zWyohCJfKxQBDCCjceBiTMy"\
                  --foreman-proxy-oauth-consumer-secret "DGKBJjXWfkyroiyDHNhYAFn9uTnUcJxa"\
                  --foreman-proxy-foreman-base-url      "https://katello.example.com"\
                  --foreman-proxy-trusted-hosts         "katello.example.com"\
                  --foreman-proxy-trusted-hosts         "capsule.example.com"\
                  --capsule-pulp-oauth-secret           "bQ5zUPVd2qVDY987D4VtD6Va9pDj4Y7J"\
                  --capsule-certs-tar                   "~/capsule.example.com-certs.tar"\
                  --capsule-puppet                      "true"\
                  --capsule-puppetca                    "true"\
                  --capsule-pulp                        "true"

The following is an example of using the existing capsule-installer to install a capsule using this module:

capsule-installer --register-in-foreman         "true"\
                  --registered-proxy-url        "https://capsule.example.com:9090"\
                  --oauth-consumer-key          "pvUutwvPU3Rni5RWqisL6Tx4fAF5yDSa"\
                  --oauth-consumer-secret       "JTGnd3fx6GB4uki5LtNPFU6cCSq9NrFk"\
                  --foreman-base-url            "https://katello.example.com"\
                  --trusted-hosts               "katello.example.com"\
                  --trusted-hosts               "capsule.example.com"\
                  --parent-fqdn                 "katello.example.com"\
                  --pulp-oauth-secret           "3HNmounKP6mbQYthkvkw2GXV5toxeFsu"\
                  --certs-tar                   "~/capsule.example.com-certs.tar"\
                  --puppet                      "true"\
                  --puppetca                    "true"\
                  --enable-foreman-proxy-plugin-pulp\
                  --enabled                     "false"\
                  --pulpnode-enabled            "true"

The following is an example of using the existing katello-installer to install using this module:

katello-installer

Note: In order to enable pulp and leverage parameters provided by the puppet-foreman_proxy,
the following arguments are now used : --enable-foreman-proxy-plugin-pulp (to enable the pulp plugin),
--enabled (do not configure as a pulp master), --pulpnode-enabled (configure as a pulp node)

@bbuckingham
Copy link
Member Author

Note: this PR is dependent on the changes to kafo included with theforeman/kafo#117.

@stbenjam
Copy link
Member

stbenjam commented Nov 9, 2015

Can't these be moved to foreman-proxy as well?

--capsule-parent-fqdn "katello.example.com"\
--capsule-puppet "true"\
--capsule-puppetca "true"\
--capsule-pulp "true"

@bbuckingham
Copy link
Member Author

Updated the PR to remove the need for --capsule-puppetca and --capsule-pulp.

I need to look a bit more on how to best remove --capsule-parent-fqdn and --capsule-puppet.

Ideally, we could remove --capsule-parent-fqdn and use information (i.e. the fqdn) from --foreman-proxy-foreman-base-url instead. This requires parsing the URL. My hope was that we or puppet already had a 'helper' to support this type of behavior.

In order to remove --capsule-puppet, need to ensure that the parameters currently set by puppet-capsule for the 'puppet' class can be passed in to the class that is referenced elsewhere (as part of --enable-puppet). I am not sure, yet, how to accomplish that. The following is a reference: https://github.com/bbuckingham/puppet-capsule/blob/capsule-scenario/manifests/init.pp#L215-L228 .

@@ -13,6 +13,7 @@ fixtures:
foreman: "git://github.com/theforeman/puppet-foreman"
Copy link
Member

Choose a reason for hiding this comment

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

We should be able to get rid of a lot of the fixtures present here since they would no longer be referenced with the removal of foreman_proxy

Copy link
Member

Choose a reason for hiding this comment

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

But it's still in a precondition, so you can't remove them yet.

Copy link
Member

Choose a reason for hiding this comment

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

Just Foreman or all of them? I was referencing auditing the list as a whole (e.g. tftp, xinetd, dhcp, dns, foreman_proxy etc.)

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 may not require all repositories, but I suspect you will still need most of them. Doing a full check can't hurt though :)

Copy link
Member Author

Choose a reason for hiding this comment

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

I was able to remove dhcp/dns; however, removing any additional ones at this time does result in test failures.

@bbuckingham bbuckingham force-pushed the capsule-scenario branch 2 times, most recently from 9b45e2f to 5aec0fd Compare December 2, 2015 19:22
bbuckingham added a commit to bbuckingham/katello-installer that referenced this pull request Dec 16, 2015
…sule

This commit contains some initial changes to support the puppet-capsule
changes that decouple puppet-foreman_proxy from the puppet-capsule.
(Ref: theforeman/puppet-foreman_proxy_content#64)

The following is an example install using this configuration:

capsule-installer --register-in-foreman "true"\
                  --registered-proxy-url "https://capsule.example.com:9090"\
                  --oauth-consumer-key "pvUutwvPU3Rni5RWqisL6Tx4fAF5yDSa"\
                  --oauth-consumer-secret "JTGnd3fx6GB4uki5LtNPFU6cCSq9NrFk"\
                  --foreman-base-url "https://katello.example.com"\
                  --trusted-hosts "katello.example.com"\
                  --trusted-hosts "capsule.example.com"\
                  --parent-fqdn "katello.example.com"\
                  --pulp-oauth-secret "3HNmounKP6mbQYthkvkw2GXV5toxeFsu"\
                  --certs-tar "~/capsule.example.com-certs.tar"\
                  --puppet "true"\
                  --puppetca "true"\
                  --enable-foreman-proxy-plugin-pulp\
                  --enabled "false"\
                  --pulpnode-enabled "true"
@ehelms
Copy link
Member

ehelms commented Dec 16, 2015

This got the errors fixed up for me:

diff --git a/manifests/init.pp b/manifests/init.pp
index f2ac476..2be2ab2 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -79,6 +79,7 @@ class capsule (
   validate_present($capsule::parent_fqdn)

   $pulp = $::foreman_proxy::plugin::pulp::pulpnode_enabled
+
   if $pulp {
     validate_present($pulp_oauth_secret)
   }
diff --git a/spec/classes/capsule_spec.rb b/spec/classes/capsule_spec.rb
index 89f2218..1b6fe33 100644
--- a/spec/classes/capsule_spec.rb
+++ b/spec/classes/capsule_spec.rb
@@ -13,10 +13,6 @@ describe 'capsule' do
       }
     end

-    let(:pre_condition) do
-      ['include foreman_proxy']
-    end
-
     it { should contain_class('capsule::install') }
   end

@@ -33,14 +29,13 @@ describe 'capsule' do

     let(:params) do
       {
-        :pulp              => true,
         :pulp_oauth_secret => 'mysecret',
         :qpid_router       => false
       }
     end

     let(:pre_condition) do
-      ['include foreman_proxy']
+      "class {'foreman_proxy::plugin::pulp': pulpnode_enabled => true}"
     end

     it { should contain_class('crane').with( {'key' => '/etc/pki/katello/private/katello-apache.key',

@bbuckingham
Copy link
Member Author

@ehelms, Thanks for the test updates! Applied them with a rebase to the PR.

bbuckingham added a commit to bbuckingham/katello-installer that referenced this pull request Jan 7, 2016
… puppet-capsule

This commit contains some initial changes to support the puppet-capsule
changes that decouple puppet-foreman_proxy from the puppet-capsule.
(Ref: theforeman/puppet-foreman_proxy_content#64)

Below are a couple of example installs using this configuration:

katello-installer

capsule-installer --register-in-foreman "true"\
                  --registered-proxy-url "https://capsule.example.com:9090"\
                  --oauth-consumer-key "pvUutwvPU3Rni5RWqisL6Tx4fAF5yDSa"\
                  --oauth-consumer-secret "JTGnd3fx6GB4uki5LtNPFU6cCSq9NrFk"\
                  --foreman-base-url "https://katello.example.com"\
                  --trusted-hosts "katello.example.com"\
                  --trusted-hosts "capsule.example.com"\
                  --parent-fqdn "katello.example.com"\
                  --pulp-oauth-secret "3HNmounKP6mbQYthkvkw2GXV5toxeFsu"\
                  --certs-tar "~/capsule.example.com-certs.tar"\
                  --puppet "true"\
                  --puppetca "true"\
                  --enable-foreman-proxy-plugin-pulp\
                  --enabled "false"\
                  --pulpnode-enabled "true"
@bbuckingham bbuckingham changed the title [DO NOT MERGE] capsule scenario - initial changes to support installing capsule as a scenario [DO NOT MERGE] initial changes to support installing decoupling puppet-foreman_proxy from puppet-capsule Jan 7, 2016
@bbuckingham bbuckingham changed the title [DO NOT MERGE] initial changes to support installing decoupling puppet-foreman_proxy from puppet-capsule [DO NOT MERGE] initial changes to support decoupling puppet-foreman_proxy from puppet-capsule Jan 7, 2016
bbuckingham added a commit to bbuckingham/katello-installer that referenced this pull request Jan 8, 2016
… puppet-capsule

This commit contains some initial changes to support the puppet-capsule
changes that decouple puppet-foreman_proxy from the puppet-capsule.
(Ref: theforeman/puppet-foreman_proxy_content#64)

Below are a couple of example installs using this configuration:

katello-installer

capsule-installer --register-in-foreman "true"\
                  --registered-proxy-url "https://capsule.example.com:9090"\
                  --oauth-consumer-key "pvUutwvPU3Rni5RWqisL6Tx4fAF5yDSa"\
                  --oauth-consumer-secret "JTGnd3fx6GB4uki5LtNPFU6cCSq9NrFk"\
                  --foreman-base-url "https://katello.example.com"\
                  --trusted-hosts "katello.example.com"\
                  --trusted-hosts "capsule.example.com"\
                  --parent-fqdn "katello.example.com"\
                  --pulp-oauth-secret "3HNmounKP6mbQYthkvkw2GXV5toxeFsu"\
                  --certs-tar "~/capsule.example.com-certs.tar"\
                  --puppet "true"\
                  --puppetca "true"\
                  --enable-foreman-proxy-plugin-pulp\
                  --enabled "false"\
                  --pulpnode-enabled "true"
@ehelms
Copy link
Member

ehelms commented Jan 18, 2016

@bbuckingham do you still consider this in a DNM state? I am feeling fairly confident in it to consider merging and revving the version. I believe this new version would still get imported into katello-installer, so we could consider putting in a version lock in Puppetfile or only merging this once Katello/katello-installer#283 is ready -- which I think it is if we are doing the migration PR after the fact?

@bbuckingham
Copy link
Member Author

@ehelms, I do not have any changes pending on this particular PR. If we find something after it is in place, we can create separate PRs. We will need the changes that you referenced for katello installer (Katello/katello-installer#283) as well as the kafo migration changes that martin is working on to be fully functional (for existing installs).

bbuckingham added a commit to bbuckingham/katello-installer that referenced this pull request Jan 19, 2016
… puppet-capsule

This commit contains some initial changes to support the puppet-capsule
changes that decouple puppet-foreman_proxy from the puppet-capsule.
(Ref: theforeman/puppet-foreman_proxy_content#64)

Below are a couple of example installs using this configuration:

katello-installer

capsule-installer --register-in-foreman "true"\
                  --registered-proxy-url "https://capsule.example.com:9090"\
                  --oauth-consumer-key "pvUutwvPU3Rni5RWqisL6Tx4fAF5yDSa"\
                  --oauth-consumer-secret "JTGnd3fx6GB4uki5LtNPFU6cCSq9NrFk"\
                  --foreman-base-url "https://katello.example.com"\
                  --trusted-hosts "katello.example.com"\
                  --trusted-hosts "capsule.example.com"\
                  --parent-fqdn "katello.example.com"\
                  --pulp-oauth-secret "3HNmounKP6mbQYthkvkw2GXV5toxeFsu"\
                  --certs-tar "~/capsule.example.com-certs.tar"\
                  --puppet "true"\
                  --puppetca "true"\
                  --enable-foreman-proxy-plugin-pulp\
                  --enabled "false"\
                  --pulpnode-enabled "true"
bbuckingham added a commit to bbuckingham/katello-installer that referenced this pull request Jan 19, 2016
…eman_proxy from puppet-capsule

This commit contains some initial changes to support the puppet-capsule
changes that decouple puppet-foreman_proxy from the puppet-capsule.
(Ref: theforeman/puppet-foreman_proxy_content#64)

Below are a couple of example installs using this configuration:

katello-installer

capsule-installer --register-in-foreman "true"\
                  --registered-proxy-url "https://capsule.example.com:9090"\
                  --oauth-consumer-key "pvUutwvPU3Rni5RWqisL6Tx4fAF5yDSa"\
                  --oauth-consumer-secret "JTGnd3fx6GB4uki5LtNPFU6cCSq9NrFk"\
                  --foreman-base-url "https://katello.example.com"\
                  --trusted-hosts "katello.example.com"\
                  --trusted-hosts "capsule.example.com"\
                  --parent-fqdn "katello.example.com"\
                  --pulp-oauth-secret "3HNmounKP6mbQYthkvkw2GXV5toxeFsu"\
                  --certs-tar "~/capsule.example.com-certs.tar"\
                  --puppet "true"\
                  --puppetca "true"\
                  --enable-foreman-proxy-plugin-pulp\
                  --enabled "false"\
                  --pulpnode-enabled "true"
The changes in this commit are an initial step towards enabling the capsule
to be deployed as a kafo 'scenario' using the foreman-installer.

The following is an example of using the scenario-based installer to
install a capsule using this module:

foreman-installer --scenario capsule \
                  --capsule-parent-fqdn                 "katello.example.com"\
                  --foreman-proxy-register-in-foreman   "true"\
                  --foreman-proxy-registered-proxy-url  "https://capsule.example.com:9090"\
                  --foreman-proxy-oauth-consumer-key    "QSJ2qCGV3zWyohCJfKxQBDCCjceBiTMy"\
                  --foreman-proxy-oauth-consumer-secret "DGKBJjXWfkyroiyDHNhYAFn9uTnUcJxa"\
                  --foreman-proxy-foreman-base-url      "https://katello.example.com"\
                  --foreman-proxy-trusted-hosts         "katello.example.com"\
                  --foreman-proxy-trusted-hosts         "capsule.example.com"\
                  --capsule-pulp-oauth-secret           "bQ5zUPVd2qVDY987D4VtD6Va9pDj4Y7J"\
                  --capsule-certs-tar                   "~/capsule.example.com-certs.tar"\
                  --capsule-puppet                      "true"\
                  --capsule-puppetca                    "true"\
                  --capsule-pulp                        "true"

The following is an example of using the existing capsule-installer to
install a capsule using this module:

capsule-installer --register-in-foreman         "true"\
                  --registered-proxy-url        "https://capsule.example.com:9090"\
                  --oauth-consumer-key          "pvUutwvPU3Rni5RWqisL6Tx4fAF5yDSa"\
                  --oauth-consumer-secret       "JTGnd3fx6GB4uki5LtNPFU6cCSq9NrFk"\
                  --foreman-base-url            "https://katello.example.com"\
                  --trusted-hosts               "katello.example.com"\
                  --trusted-hosts               "capsule.example.com"\
                  --parent-fqdn                 "katello.example.com"\
                  --pulp-oauth-secret           "3HNmounKP6mbQYthkvkw2GXV5toxeFsu"\
                  --certs-tar                   "~/capsule.example.com-certs.tar"\
                  --puppet                      "true"\
                  --puppetca                    "true"\
                  --enable-foreman-proxy-plugin-pulp\
                  --enabled                     "false"\
                  --pulpnode-enabled            "true"

Note: In order to enable pulp and leverage parameters provided by the puppet-foreman_proxy,
the following arguments are now used : --enable-foreman-proxy-plugin-pulp (to enable the pulp plugin),
--enabled (do not configure as a pulp master), --pulpnode-enabled (configure as a pulp node)
@bbuckingham bbuckingham changed the title [DO NOT MERGE] initial changes to support decoupling puppet-foreman_proxy from puppet-capsule refs #10533 - initial changes to support decoupling puppet-foreman_proxy from puppet-capsule Jan 19, 2016
@ehelms
Copy link
Member

ehelms commented Jan 19, 2016

We can either bump the version here, or after this I can use blacksmith to do so.

@bbuckingham
Copy link
Member Author

@ehelms, We can bump it however you prefer.

@ehelms
Copy link
Member

ehelms commented Jan 23, 2016

ACK - I'll do a bump after we merge this

@bbuckingham
Copy link
Member Author

@ehelms, Thanks! Will merge now. :)

bbuckingham added a commit that referenced this pull request Jan 23, 2016
refs #10533 - initial changes to support decoupling puppet-foreman_proxy from puppet-capsule
@bbuckingham bbuckingham merged commit 5aa7d7b into theforeman:master Jan 23, 2016
bbuckingham added a commit to bbuckingham/katello-installer that referenced this pull request Jun 8, 2016
With the Katello on Foreman feature, there was an effort to separate
the foreman_proxy aspects from the puppet-capsule.  The changes
for this were primarily done as part of:
	theforeman/puppet-foreman_proxy_content#64

At that time, there were no migration capabilities to move the
answers from the 'capsule' to 'foreman_proxy' within the various
answer files (e.g. answers.katello-installer.yaml &
answers.capsule-installer.yaml).

This commit will add in migrations for each env to support moving
the parameters over.  This includes:
- katello
- katello-devel
- capsule

It should be noted that for katello and katello-devel include
an additional migration.  It is one that was added in a previous
commit for capsule, but it should apply to all environments.
bbuckingham added a commit to bbuckingham/katello-installer that referenced this pull request Jun 8, 2016
With the Katello on Foreman feature, there was an effort to separate
the foreman_proxy aspects from the puppet-capsule.  The changes
for this were primarily done as part of:
	theforeman/puppet-foreman_proxy_content#64

At that time, there were no migration capabilities to move the
answers from the 'capsule' to 'foreman_proxy' within the various
answer files (e.g. answers.katello-installer.yaml &
answers.capsule-installer.yaml).

This commit will add in migrations for each env to support moving
the parameters over.  This includes:
- katello
- katello-devel
- capsule

It should be noted that for katello and katello-devel include
an additional migration.  It is one that was added in a previous
commit for capsule, but it should apply to all environments.
ehelms pushed a commit to Katello/katello-installer that referenced this pull request Jun 10, 2016
With the Katello on Foreman feature, there was an effort to separate
the foreman_proxy aspects from the puppet-capsule.  The changes
for this were primarily done as part of:
	theforeman/puppet-foreman_proxy_content#64

At that time, there were no migration capabilities to move the
answers from the 'capsule' to 'foreman_proxy' within the various
answer files (e.g. answers.katello-installer.yaml &
answers.capsule-installer.yaml).

This commit will add in migrations for each env to support moving
the parameters over.  This includes:
- katello
- katello-devel
- capsule

It should be noted that for katello and katello-devel include
an additional migration.  It is one that was added in a previous
commit for capsule, but it should apply to all environments.

(cherry picked from commit 04290b8)
jlsherrill pushed a commit to jlsherrill/katello-installer that referenced this pull request Jun 23, 2016
With the Katello on Foreman feature, there was an effort to separate
the foreman_proxy aspects from the puppet-capsule.  The changes
for this were primarily done as part of:
	theforeman/puppet-foreman_proxy_content#64

At that time, there were no migration capabilities to move the
answers from the 'capsule' to 'foreman_proxy' within the various
answer files (e.g. answers.katello-installer.yaml &
answers.capsule-installer.yaml).

This commit will add in migrations for each env to support moving
the parameters over.  This includes:
- katello
- katello-devel
- capsule

It should be noted that for katello and katello-devel include
an additional migration.  It is one that was added in a previous
commit for capsule, but it should apply to all environments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants