1. check pulp rpm is installed
2. start pulp-server service
3. initializes pulp
4. saves default credentials (may need to change admin password)
5. creates x86_64 repos for f13 and f14
6. triggers a sync on both repos
There is an option to force the sync and wait until the sync completes before returning
status to puppet. For me, the initial sync took 1hr and subsequent syncs took 2 minutes. I
decided not to use the force option and let sync happen in the background.
---
recipes/aeolus_recipe/aeolus_recipe.pp | 1 +
recipes/aeolus_recipe/aeolus_uninstall.pp | 1 +
recipes/aeolus_recipe/manifests/aeolus.pp | 2 +-
recipes/aeolus_recipe/manifests/pulp.pp | 53 +++++++++++++++++++++++++++++
4 files changed, 56 insertions(+), 1 deletions(-)
create mode 100644 recipes/aeolus_recipe/manifests/pulp.pp
diff --git a/recipes/aeolus_recipe/aeolus_recipe.pp
b/recipes/aeolus_recipe/aeolus_recipe.pp
index dd05dc3..744d773 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":}
diff --git a/recipes/aeolus_recipe/aeolus_uninstall.pp
b/recipes/aeolus_recipe/aeolus_uninstall.pp
index c0b0eae..7c2d4c0 100644
--- a/recipes/aeolus_recipe/aeolus_uninstall.pp
+++ b/recipes/aeolus_recipe/aeolus_uninstall.pp
@@ -30,6 +30,7 @@ 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": }
diff --git a/recipes/aeolus_recipe/manifests/aeolus.pp
b/recipes/aeolus_recipe/manifests/aeolus.pp
index de43f9c..d94ed38 100644
--- a/recipes/aeolus_recipe/manifests/aeolus.pp
+++ b/recipes/aeolus_recipe/manifests/aeolus.pp
@@ -10,6 +10,7 @@ import "conductor"
import "deltacloud"
import "iwhd"
import "image-factory"
+import "pulp"
if $aeolus_enable_https == "true" or $aeolus_enable_https == "1" {
import "openssl"
@@ -63,4 +64,3 @@ define aeolus::provider($type, $port, $login_user="",
$login_password=""){
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..cf97827
--- /dev/null
+++ b/recipes/aeolus_recipe/manifests/pulp.pp
@@ -0,0 +1,53 @@
+# Aeolus pulp puppet definitions
+
+class aeolus::pulp inherits aeolus {
+ package { 'pulp':
+ ensure => 'installed'
+ }
+
+ exec{'pulp-init':
+ command => "/sbin/service pulp-server init",
+ logoutput => true,
+ require => Package['pulp']}
+
+ 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,
+ 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
+ }
+}
--
1.7.4.4