Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
refs #17448 - renaming capsule to foreman-proxy (#437)
  • Loading branch information
cfouant authored and stbenjam committed Dec 14, 2016
1 parent 58fa2a7 commit 7314093
Show file tree
Hide file tree
Showing 38 changed files with 159 additions and 303 deletions.
20 changes: 10 additions & 10 deletions Puppetfile
@@ -1,14 +1,14 @@
forge 'https://forgeapi.puppetlabs.com'

mod 'katello/candlepin', :git => 'https://github.com/Katello/puppet-candlepin'
mod 'katello/capsule', :git => 'https://github.com/Katello/puppet-capsule'
mod 'katello/certs', :git => 'https://github.com/Katello/puppet-certs'
mod 'katello/common', :git => 'https://github.com/Katello/puppet-common'
mod 'katello/crane', :git => 'https://github.com/Katello/puppet-crane'
mod 'katello/katello', :git => 'https://github.com/Katello/puppet-katello'
mod 'katello/pulp', :git => 'https://github.com/Katello/puppet-pulp'
mod 'katello/qpid', :git => 'https://github.com/Katello/puppet-qpid'
mod 'katello/service_wait', :git => 'https://github.com/Katello/puppet-service_wait'
mod 'katello/candlepin', :git => 'https://github.com/Katello/puppet-candlepin'
mod 'katello/foreman_proxy_content', :git => 'https://github.com/Katello/puppet-foreman_proxy_content'
mod 'katello/certs', :git => 'https://github.com/Katello/puppet-certs'
mod 'katello/common', :git => 'https://github.com/Katello/puppet-common'
mod 'katello/crane', :git => 'https://github.com/Katello/puppet-crane'
mod 'katello/katello', :git => 'https://github.com/Katello/puppet-katello'
mod 'katello/pulp', :git => 'https://github.com/Katello/puppet-pulp'
mod 'katello/qpid', :git => 'https://github.com/Katello/puppet-qpid'
mod 'katello/service_wait', :git => 'https://github.com/Katello/puppet-service_wait'

# Katello devel specific modules
mod 'katello/katello_devel', :git => 'https://github.com/Katello/puppet-katello_devel'
mod 'katello/katello_devel', :git => 'https://github.com/Katello/puppet-katello_devel'
102 changes: 51 additions & 51 deletions README.md
Expand Up @@ -27,7 +27,7 @@ foreman-installer --scenario "katello"\
--foreman-proxy-dhcp "true"\
--foreman-proxy-dhcp-interface "virbr1"\
--foreman-proxy-tftp "true"\
--capsule-puppet "true"\
--foreman-proxy-content-puppet "true"\
--foreman-proxy-puppetca "true"
# Install only DNS with smart proxy
Expand All @@ -38,35 +38,35 @@ foreman-installer --scenario "katello"\
--foreman-proxy-dns-forwarders "8.8.4.4"\
--foreman-proxy-dns-interface "virbr1"\
--foreman-proxy-dns-zone "example.com"\
--capsule-puppet "false"\
--foreman-proxy-content-puppet "false"\
--foreman-proxy-puppetca "false"
# Generate certificates for installing capsule on another system
capsule-certs-generate --capsule-fqdn "mycapsule.example.com"\
--certs-tar "~/mycapsule.example.com-certs.tar"
# Generate certificates for installing Foreman proxy on another system
foreman-proxy-certs-generate --foreman-proxy-fqdn "myforeman-proxy-content.example.com"\
--certs-tar "~/myforeman-proxy-content.example.com-certs.tar"
# Copy the ~/mycapsule.example.com-certs.tar to the capsule system
# Copy the ~/myforeman-proxy.example.com-certs.tar to the foreman-proxy system
# register the system to Katello and run:
foreman-installer --scenario "capsule"\
--capsule-parent-fqdn "master.example.com"\
--foreman-proxy-register-in-foreman "true"\
--foreman-proxy-foreman-base-url "https://master.example.com"\
--foreman-proxy-trusted-hosts "master.example.com"\
--foreman-proxy-trusted-hosts "mycapsule.example.com"\
--foreman-proxy-oauth-consumer-key "foreman_oauth_key"\
--foreman-proxy-oauth-consumer-secret "foreman_oauth_secret"\
--capsule-pulp-oauth-secret "pulp_oauth_secret"\
--capsule-certs-tar "/root/mycapsule.exampe.com-certs.tar"\
--capsule-puppet "true"\
--foreman-proxy-puppetca "true"\
--foreman-proxy-dns "true"\
--foreman-proxy-dns-forwarders "8.8.8.8"\
--foreman-proxy-dns-forwarders "8.8.4.4"\
--foreman-proxy-dns-interface "virbr1"\
--foreman-proxy-dns-zone "example.com"\
--foreman-proxy-dhcp "true"\
--foreman-proxy-dhcp-interface "virbr1"\
--foreman-proxy-tftp "true"\
foreman-installer --scenario "foreman-proxy-content"\
--foreman-proxy-content-parent-fqdn "master.example.com"\
--foreman-proxy-register-in-foreman "true"\
--foreman-proxy-foreman-base-url "https://master.example.com"\
--foreman-proxy-trusted-hosts "master.example.com"\
--foreman-proxy-trusted-hosts "myforeman-proxy.example.com"\
--foreman-proxy-oauth-consumer-key "foreman_oauth_key"\
--foreman-proxy-oauth-consumer-secret "foreman_oauth_secret"\
--foreman-proxy-content-pulp-oauth-secret "pulp_oauth_secret"\
--foreman-proxy-content-certs-tar "/root/myforeman-proxy-content.example.com-certs.tar"\
--foreman-proxy-content-puppet "true"\
--foreman-proxy-puppetca "true"\
--foreman-proxy-dns "true"\
--foreman-proxy-dns-forwarders "8.8.8.8"\
--foreman-proxy-dns-forwarders "8.8.4.4"\
--foreman-proxy-dns-interface "virbr1"\
--foreman-proxy-dns-zone "example.com"\
--foreman-proxy-dhcp "true"\
--foreman-proxy-dhcp-interface "virbr1"\
--foreman-proxy-tftp "true"\
```

## Data Reset
Expand Down Expand Up @@ -161,18 +161,18 @@ foreman-installer --scenario katello\
```

Where the `--certs-server-ca-cert` is the CA used for issuing the
server certs (this CA gets distributed to the consumers and capsules).
server certs (this CA gets distributed to the consumers and Foreman proxies).

For the capsule, these options are passed as part of the
`capsule-certs-generate` script:
For the Foreman proxy, these options are passed as part of the
`foreman-proxy-certs-generate` script:

```
capsule-certs-generate --capsule-fqdn "$CAPSULE"\
--certs-tar "~/$CAPSULE-certs.tar"\
--server-cert ~/path/to/server.crt\
--server-cert-req ~/path/to/server.crt.req\
--server-key ~/path/to/server.key\
--server-ca-cert ~/cacert.crt
foreman-proxy-certs-generate --foreman-proxy-fqdn "$FOREMAN_PROXY"\
--certs-tar "~/$FOREMAN_PROXY-certs.tar"\
--server-cert ~/path/to/server.crt\
--server-cert-req ~/path/to/server.crt.req\
--server-key ~/path/to/server.key\
--server-ca-cert ~/cacert.crt
```

The rest of the procedure is identical to the default CA setup.
Expand Down Expand Up @@ -205,20 +205,20 @@ rpm -Uvh http://katello.example.com/pub/katello-ca-consumer-latest.noarch.rpm
```

When using the custom server CA, the CA needs to be used for
the server certificates on the capsules as well. The certificates for
the capsule are deployed to the capsule through the use of the
`capsule-certs-generate` script (followed by copying the certs tar to
the capsule and running the 'foreman-installer --scenario capsule'
the server certificates on the Foreman proxies as well. The certificates for
the Foreman proxy are deployed to the Foreman proxy through the use of the
`foreman-proxy-certs-generate` script (followed by copying the certs tar to
the Foreman proxy and running the 'foreman-installer --scenario foreman-proxy-content'
to refresh the certificates).:

```
capsule-certs-generate --capsule-fqdn "$CAPSULE"\
--certs-tar "~/$CAPSULE-certs.tar"\
--server-cert ~/path/to/server.crt\
--server-cert-req ~/path/to/server.crt.req\
--server-key ~/path/to/server.key\
--server-ca-cert ~/cacert.crt\
--certs-update-server
foreman-proxy-certs-generate --foreman-proxy-fqdn "$FOREMAN_PROXY_CONTENT"\
--certs-tar "~/$FOREMAN_PROXY_CONTENT-certs.tar"\
--server-cert ~/path/to/server.crt\
--server-cert-req ~/path/to/server.crt.req\
--server-key ~/path/to/server.key\
--server-ca-cert ~/cacert.crt\
--certs-update-server
```

#### Updating Certificates
Expand All @@ -238,13 +238,13 @@ To regenerate all the certificates used in the Katello server, there
is a `--certs-update-all`. This will generate and deploy the
certificates as well as restart corresponding services.

**On a capsule**
**On a Foreman proxy**

For updating the certificates on a capsule pass the same
For updating the certificates on a Foreman proxy pass the same
options (either `--certs-update-server` or `--certs-update-all`) to
the `capsule-certs-generate` script. The new certs tar gets generated
that needs to be transferred to the capsule and then
`foreman-installer --scenario capsule` needs to be re-run to apply
the `foreman-proxy-certs-generate` script. The new certs tar gets generated
that needs to be transferred to the Foreman proxy and then
`foreman-installer --scenario foreman-content-proxy` needs to be re-run to apply
the updates and restart corresponding services.

## Filing and Fixing Issues
Expand Down
10 changes: 5 additions & 5 deletions Rakefile
Expand Up @@ -17,7 +17,7 @@ FOREMAN_BRANCH = ENV['FOREMAN_BRANCH'] || 'develop'
PARSER_CACHE_DIR = ENV['PARSER_CACHE_DIR'] || "#{BUILDDIR}/parser_cache"

CONFIG_DIR = './config'
SCENARIOS = ['katello', 'capsule', 'katello-devel']
SCENARIOS = ['katello', 'foreman-proxy-content', 'katello-devel']

file BUILDDIR do
mkdir BUILDDIR
Expand Down Expand Up @@ -47,17 +47,17 @@ task :generate_parser_caches => [PARSER_CACHE_DIR] do
caches = [
"#{PARSER_CACHE_DIR}/katello.yaml",
"#{PARSER_CACHE_DIR}/katello-devel.yaml",
"#{PARSER_CACHE_DIR}/capsule-certs-generate.yaml"
"#{PARSER_CACHE_DIR}/foreman-proxy-certs-generate.yaml"
]

configs = [
'config/katello.yaml',
'config/katello-devel.yaml'
]

# capsule-certs-generate is a special (read: "problem") child
load File.expand_path(File.join(File.dirname(__FILE__), 'bin', 'capsule-certs-generate'))
gen = CapsuleCertsGenerate.new
# foreman-proxy-certs-generate is a special (read: "problem") child
load File.expand_path(File.join(File.dirname(__FILE__), 'bin', 'foreman-proxy-certs-generate'))
gen = ForemanProxyCertsGenerate.new
configs << gen.config_file.path

caches.each_with_index do |filename, i|
Expand Down
2 changes: 1 addition & 1 deletion bin/capsule-installer
@@ -1,6 +1,6 @@
#!/bin/bash

echo "ERROR: capsule-installer is no longer used. Please use 'foreman-installer --scenario capsule'."
echo "ERROR: capsule-installer is no longer used. Please use 'foreman-installer --scenario foreman-proxy-content'."
echo " For more information on available options, include '--help'."

exit 1
174 changes: 3 additions & 171 deletions bin/capsule-remove
@@ -1,174 +1,6 @@
#!/bin/bash

LOG="/var/log/capsule-clean.log"
echo "ERROR: capsule-remove is no longer used. Please use 'katello-remove' instead."
echo " For more information on available options, include '--help'."

function remove() {

CONFIG_FILES=(
/etc/pulp/
/usr/share/foreman
/usr/share/foreman-installer
/usr/share/foreman-installer-katello
/usr/share/katello-installer-base
/var/lib/puppet/
/var/lib/mongodb/
/var/lib/pulp/
/etc/httpd/
/usr/share/pulp
/etc/foreman-proxy
/var/lib/foreman-proxy
/etc/capsule-installer
/etc/foreman-proxy/
/etc/puppet/environments
/etc/pki/katello-certs-tools
/etc/crane.conf
/etc/mongod.conf
/var/www/html/pub/bootstrap.py
/var/www/html/pub/katello-rhsm-consumer
/var/lib/hiera
/var/lib/qpidd
/usr/share/qpid-tools
/etc/puppet
/etc/qpid-dispatch
/etc/hiera.yaml
/etc/squid
/etc/qpid
/var/www/html/pub/katello-server-ca.crt
)
LOG_FILES=(
/var/log/capsule-installer/
/var/log/pulp/
/var/log/httpd/
/var/log/mongodb/
/var/log/foreman-proxy
/var/log/foreman-installer
/var/log/squid
)
# Setting a variable to make sure we actually grab the FQDN of the capsule incase there are other packages that have a short hostname in them.

FQDN=$( hostname -f)

RPMS=(
`rpm -qa | grep puppetlabs-release`
`rpm -qa | grep foreman-release`
`rpm -qa | grep foreman-client`
`rpm -qa | grep foreman-proxy`
`rpm -qa | grep katello`
`rpm -qa | grep ^pulp`
`rpm -qa | grep ^python-pulp`
`rpm -qa | grep ^pulp-`
`rpm -qa | grep mongo`
`rpm -qa | grep ^mod_`
`rpm -qa | grep ^rubygem`
`rpm -qa | grep ^ruby193`
`rpm -qa | grep ^foreman`
`rpm -qa | grep ^qpid`
`rpm -qa | grep ^lucene`
`rpm -qa | grep ^python-crane`
`rpm -qa | grep ^python-celery`
`rpm -qa | grep ^python-gofer`
`rpm -qa | grep ^python-qpid`
`rpm -qa | grep ^python-kombu`
`rpm -qa | grep ^python-webpy`
`rpm -qa | grep ^python-nectar`
`rpm -qa | grep ^python-saslwrapper`
`rpm -qa | grep ^python-amqp`
`rpm -qa | grep ^python-billiard`
`rpm -qa | grep ^python-semantic-version`
`rpm -qa | grep ^python-requests`
`rpm -qa | grep ^python-isodate`
`rpm -qa | grep gutterball`
`rpm -qa | grep $FQDN`
saslwrapper
snappy-java
ruby
rubygems
httpd
puppet
squid
)
CERT_FILES=(
/etc/pki/pulp/
/etc/pki/katello
/root/ssl-build
/var/www/html/pub/katello-ca*.rpm
)

# stopping all katello/foreman related services

echo "Stopping Katello Capsule Services" | tee -a $LOG
katello-service stop | tee -a $LOG

echo "Removing RPMs" | tee -a $LOG
yum erase -y ${RPMS[*]} | tee -a $LOG

echo "Cleaning up configuration files" | tee -a $LOG
# Conf files
rm -rf ${CONFIG_FILES[*]} | tee -a $LOG

echo "Cleaning up log files" | tee -a $LOG
# logs
rm -rf ${LOG_FILES[*]} | tee -a $LOG

echo "Cleaning up Certs" | tee -a $LOG
# pulp cert stuff
rm -rf ${CERT_FILES[*]} | tee -a $LOG
}

menu()
{
clear
echo ""
echo "WARNING: This script will erase many packages and config files."
echo "Important packages such as the following will be removed:"
echo ""
echo " * httpd (apache)"
echo " * mongodb"
echo " * tomcat"
echo " * puppet"
echo " * ruby"
echo " * rubygems"
echo " * All Katello and Foreman Packages"
echo ""
echo "Once these packages and configuration files are removed there is no going back."
echo "If you use this system for anything other than Katello and Foreman you probably"
echo "do not want to execute this script."
echo ""
read -p "Read the source for a list of what is removed. Are you sure(Y/N)? " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo "** cancelled **"
exit 1
fi

echo ""
echo "ARE YOU SURE?: This script permanently deletes data and configuration."
read -p "Read the source for a list of what is removed. Type [remove] to continue? " -r
echo # (optional) move to a new line
if [[ ! $REPLY == remove ]]
then
echo "** cancelled **"
exit 1
else
echo "Confirmed! Let's remove all files"
remove
fi
}

# In case of --help or -h
for var in $@; do
if [[ $var == "--help" || $var == "-h" ]]
then
echo -e "This script is used to remove all capsule related packages and services. \nThis should only be used if you are sure you are wanting to completely remove Capsule from this machine and lose all of your settings and synced content. \nOptional flags:\n--unattended this option will start the removal process without any warnings or confirmations."
exit 1
fi
if [[ $var == "--unattended" ]]
then
remove
exit
fi
done

# Principal
menu
exit 1

0 comments on commit 7314093

Please sign in to comment.