In this version, Pulp is activated only if its rpm is available from
a yum repo.
The steps in the script are:
1. check Pulp rpm is installed
2. write out templatized configuration files
3. initialize Pulp
4. start pulp-server service
5. save default credentials (may need to change admin password)
6. create x86_64 repos for f13 and f14
7. trigger a sync on both repos
Syncs run in the background. The first sync may take some time to complete
depending on your network bandwidth. Use "pulp-admin repo status --id" to
check the status of the sync using f13-x86_64 and f14-x86_64 for the
repo id.
---
bin/aeolus-configure | 6 +
recipes/aeolus_recipe/aeolus_recipe.pp | 2 +-
recipes/aeolus_recipe/aeolus_uninstall.pp | 2 +-
recipes/aeolus_recipe/manifests/aeolus.pp | 8 ++-
recipes/aeolus_recipe/manifests/pulp.pp | 76 ++++++++++++++
recipes/aeolus_recipe/templates/pulp-client.conf | 49 +++++++++
recipes/aeolus_recipe/templates/pulp.conf | 119 ++++++++++++++++++++++
7 files changed, 259 insertions(+), 3 deletions(-)
create mode 100644 recipes/aeolus_recipe/manifests/pulp.pp
create mode 100755 recipes/aeolus_recipe/templates/pulp-client.conf
create mode 100644 recipes/aeolus_recipe/templates/pulp.conf
diff --git a/bin/aeolus-configure b/bin/aeolus-configure
index 6d87cb1..ee004e0 100644
--- a/bin/aeolus-configure
+++ b/bin/aeolus-configure
@@ -1,5 +1,11 @@
#!/bin/sh
+YUM_LIST_PULP=`yum list pulp`
+if [[ "$YUM_LIST_PULP" == *pulp* ]]
+then
+ export FACTER_AEOLUS_ENABLE_PULP=true
+fi
+
export FACTER_AEOLUS_ENABLE_HTTPS=true
export FACTER_AEOLUS_ENABLE_SECURITY=false
puppet /usr/share/aeolus-configure/aeolus_recipe.pp \
diff --git a/recipes/aeolus_recipe/aeolus_recipe.pp
b/recipes/aeolus_recipe/aeolus_recipe.pp
index 879b314..65f468f 100644
--- a/recipes/aeolus_recipe/aeolus_recipe.pp
+++ b/recipes/aeolus_recipe/aeolus_recipe.pp
@@ -30,6 +30,7 @@ import "aeolus_recipe/defaults"
include aeolus::conductor
include aeolus::image-factory
include aeolus::iwhd
+include aeolus::pulp
aeolus::create_bucket{"aeolus":}
@@ -70,4 +71,3 @@ aeolus::conductor::hwp{"hwp1":
login_user => 'admin',
login_password => 'password',
require => Aeolus::Site_admin["admin"] }
-
diff --git a/recipes/aeolus_recipe/aeolus_uninstall.pp
b/recipes/aeolus_recipe/aeolus_uninstall.pp
index c0b0eae..8dba827 100644
--- a/recipes/aeolus_recipe/aeolus_uninstall.pp
+++ b/recipes/aeolus_recipe/aeolus_uninstall.pp
@@ -30,8 +30,8 @@ import "aeolus_recipe/defaults"
include aeolus::conductor::disabled
include aeolus::iwhd::disabled
include aeolus::image-factory::disabled
+include aeolus::pulp::disabled
aeolus::deltacloud::disabled{"mock": }
aeolus::deltacloud::disabled{"ec2-us-east-1": }
aeolus::deltacloud::disabled{"ec2-us-west-1": }
-
diff --git a/recipes/aeolus_recipe/manifests/aeolus.pp
b/recipes/aeolus_recipe/manifests/aeolus.pp
index ca684bb..b944ff9 100644
--- a/recipes/aeolus_recipe/manifests/aeolus.pp
+++ b/recipes/aeolus_recipe/manifests/aeolus.pp
@@ -25,6 +25,13 @@ if $aeolus_enable_security == "true" or
$aeolus_enable_security == "1" {
$enable_security = false
}
+if $aeolus_enable_pulp == "true" or $aeolus_enable_pulp == "1" {
+ import "pulp"
+ $enable_pulp = true
+} else {
+ $enable_pulp = false
+}
+
# Base aeolus class
class aeolus {
@@ -63,4 +70,3 @@ define aeolus::provider($type, $port, $endpoint="",
$login_user="", $login_passw
login_password => $login_password,
require => Aeolus::Deltacloud[$name] }
}
-
diff --git a/recipes/aeolus_recipe/manifests/pulp.pp
b/recipes/aeolus_recipe/manifests/pulp.pp
new file mode 100644
index 0000000..595fe24
--- /dev/null
+++ b/recipes/aeolus_recipe/manifests/pulp.pp
@@ -0,0 +1,76 @@
+# Aeolus pulp puppet definitions
+
+class aeolus::pulp inherits aeolus {
+
+if $enable_pulp {
+ package { 'pulp':
+ ensure => 'installed'
+ }
+
+ file { 'pulp-conf-file-pulp':
+ path => '/etc/pulp/pulp.conf',
+ owner => root,
+ group => root,
+ content => template("aeolus_recipe/pulp.conf"),
+ require => Package['pulp']
+ }
+
+ file { 'pulp-conf-file-client':
+ path => '/etc/pulp/client.conf',
+ owner => apache,
+ group => apache,
+ content => template("aeolus_recipe/pulp-client.conf"),
+ require => Package['pulp']
+ }
+
+ exec{'pulp-init':
+ command => "/sbin/service pulp-server init",
+ logoutput => true,
+ creates => "/var/lib/pulp/init.flag",
+ require => [Package['pulp'],
+ File['pulp-conf-file-pulp'],
+ File['pulp-conf-file-client']]}
+
+ service { 'pulp-server':
+ ensure => 'running',
+ enable => true,
+ require => [Package['pulp'],
+ Exec["pulp-init"]]}
+
+ exec{'pulp-auth':
+ command => "/usr/bin/pulp-admin -u admin -p admin auth login --username admin
--password admin",
+ logoutput => true,
+ creates => "/root/.pulp/user-key.pem",
+ require => Service['pulp-server']}
+
+ exec{'pulp-f13-x86-64-repo-create':
+ command => "/usr/bin/pulp-admin repo create --id f13-x86_64 --feed
yum:http://download.fedoraproject.org/pub/fedora/linux/releases/13/Fedora...;,
+ logoutput => true,
+ creates =>
"/var/lib/pulp/repos/pub/fedora/linux/releases/13/Fedora/x86_64/os",
+ require => Exec['pulp-auth']}
+
+ exec{'pulp-f13-x86-64-repo-sync':
+ command => "/usr/bin/pulp-admin repo sync --id f13-x86_64",
+ logoutput => true,
+ require => Exec['pulp-f13-x86-64-repo-create']}
+
+ exec{'pulp-f14-x86-64-repo-create':
+ command => "/usr/bin/pulp-admin repo create --id f14-x86_64 --feed
yum:http://download.fedoraproject.org/pub/fedora/linux/releases/14/Fedora...;,
+ logoutput => true,
+ creates =>
"/var/lib/pulp/repos/pub/fedora/linux/releases/14/Fedora/x86_64/os",
+ require => Exec['pulp-auth']}
+
+ exec{'pulp-f14-x86-64-repo-sync':
+ command => "/usr/bin/pulp-admin repo sync --id f14-x86_64",
+ logoutput => true,
+ require => Exec['pulp-f14-x86-64-repo-create']}
+ }
+}
+
+class aeolus::pulp::disabled {
+ service { 'pulp-server':
+ ensure => 'stopped',
+ enable => false,
+ hasstatus=> true
+ }
+}
diff --git a/recipes/aeolus_recipe/templates/pulp-client.conf
b/recipes/aeolus_recipe/templates/pulp-client.conf
new file mode 100755
index 0000000..7c990e8
--- /dev/null
+++ b/recipes/aeolus_recipe/templates/pulp-client.conf
@@ -0,0 +1,49 @@
+# The pulp server configuration
+# host : The pulp server
+# port : The port providing the RESTful API.
+# scheme : The protocol.
+# interval : The agent update interval
+[server]
+host = <%= fqdn %>
+port = 443
+scheme = https
+path = /pulp/api
+interval = 240
+
+# Client configuration
+# reboot_schedule : Time in minutes or 'now' before system is scheduled for
reboot
+# when user requests a reboot for applicable errata.
+# assumeyes : Uncomment this to override this value. Assumes that install performs
all the suggested actions such as reboot on successful install;
+# import_gpg_keys : automatically import gpg keys if available during remote package
installs
+[client]
+reboot_schedule = 3
+import_gpg_keys = False
+#assumeyes = False
+repo_file = /etc/yum.repos.d/pulp.repo
+mirror_list_dir = /etc/yum.repos.d
+gpg_keys_dir = /etc/pki/pulp-gpg-keys
+
+# heartbeat
+# interval in seconds
+[heartbeat]
+seconds=10
+
+# messaging
+# scheme: (tcp|ssl)
+# port: broker port
+# cacert: the CA certificate (PEM) to verify the server.
+# clientcert: The client (PEM) key & certificate.
+[messaging]
+scheme = tcp
+port = 5672
+cacert =
+clientcert =
+
+
+# Content distribution options
+# baseurl : The content base url
+# keyurl : The gpg key base url
+[cds]
+baseurl =
https://localhost/pulp/repos
+keyurl =
http://localhost/pulp/gpg
+ksurl =
http://localhost/pulp/ks
diff --git a/recipes/aeolus_recipe/templates/pulp.conf
b/recipes/aeolus_recipe/templates/pulp.conf
new file mode 100644
index 0000000..ef34eaf
--- /dev/null
+++ b/recipes/aeolus_recipe/templates/pulp.conf
@@ -0,0 +1,119 @@
+# Server options
+#
+# server_name: server hostname(protocol defaults to https)
+# relative_url: the relative url at which repos are exposed to the clients
+# key_url: the relative url at which gpg keys are exposed to clients
+# default_login: default admin username for your pulp server
+# default_password: default password for admin
+# Highly recommend changing the default_password with "pulp-admin user update"
+#
+[server]
+server_name: <%= fqdn %>
+relative_url: /pulp/repos
+key_url: /pulp/gpg
+default_login: admin
+default_password: admin
+
+# Messaging options.
+#
+# url: the broker url.
+# cacert: path to PEM encoded CA certificate file
+# clientcert: path to PEM encoded file containing both
+# the private key and certificate.
+#
+# The url has form: <transport>://<host>:<port> where
+# transport can be (tcp|ssl). When ssl is specified,
+# cacert and clientcert must be specified.
+
+[messaging]
+url: tcp://localhost:5672
+cacert: /etc/pki/qpid/ca/ca.crt
+clientcert: /etc/pki/qpid/client/client.pem
+
+#
+# AMQP event processing
+#
+[events]
+send_enabled: false
+recv_enabled: false
+
+# Configures aspects of the pulp web server security.
+#
+# cacert: full path to the CA certificate that will be used to sign
+# consumer and admin identification certificates. This MUST match
+# the value of SSLCACertificateFile in /etc/httpd/conf.d/pulp.conf.
+# cakey: full path to the private key for the CA certificate
+#
+
+[security]
+cacert: /etc/pki/pulp/ca.crt
+cakey: /etc/pki/pulp/ca.key
+# oauth_key: string key to enable OAuth style authentication
+# oauth_secret: string shared secret that can be used for OAuth style authentication
+# For more info see:
https://fedorahosted.org/pulp/wiki/Authentication
+
+[auditing]
+events_file: /var/log/pulp/events.log
+lifetime: 90
+backups: 4
+
+# Configuration for storage of consumer history
+#
+# lifetime: length in days - consumer history entries older than this
+# will be purged; setting this to -1 will disable history purging
+[consumer_history]
+lifetime: 180
+
+[logs]
+qpid_log_level: info
+level: info
+pulp_file: /var/log/pulp/pulp.log
+grinder_file: /var/log/pulp/grinder.log
+
+[rhn]
+# using less than 5 threads can cause issues with progress feed back
+threads: 5
+fetch_all_packages: false
+remove_old_packages: false
+cert_file: /etc/sysconfig/rhn/entitlement-cert.xml
+systemid_file: /etc/sysconfig/rhn/systemid
+
+[yum]
+threads: 3
+# True/False to flag if we should remove older rpms
+remove_old_packages: false
+# Integer to specify how many old packages to keep.
+# Only used if 'removeold' is set to True
+num_old_pkgs_keep: 2
+# Uncomment below to set a bandwidth limit in KB/sec for downloading
+# Only used if 'removeold' is set to True
+num_old_pkgs_keep: 2
+# Uncomment below to set a bandwidth limit in KB/sec for downloading
+# 0 represents unlimited
+# limit_in_KB: 500
+# Uncomment the below section with appropriate values for proxy configuration
+# proxy_url:
+# proxy_port:
+# proxy_user:
+# proxy_pass:
+
+[repos]
+content_url:
https://cdn.redhat.com/
+use_entitlement_certs = false
+default_to_published: true
+
+[database]
+# automatically upgrade the database when the data model changes
+name: pulp_database
+# comma separated list of URIs to pass to pymongo
+seeds: localhost
+
+# Uncomment the below section with appropriate values, to use an external ldap for
+# user authentication instead of pulp.
+#[ldap]
+#uri: ldap://localhost
+#base: dc=localhost
+
+[cds]
+# messaging timeout for sync. <initial>:<duration>
+sync_timeout = 10:7200
--
1.7.4.4