(morazi's patchset merged/reworked)
aeolus configuration can now be specified in yml config files
---
Rakefile | 2 +-
bin/aeolus-cleanup | 5 +-
bin/aeolus-configure | 3 +-
bin/aeolus-node | 9 +++
contrib/aeolus-configure.spec | 14 ++++--
recipes/aeolus_recipe/aeolus_recipe.pp | 70 --------------------------
recipes/aeolus_recipe/aeolus_uninstall.pp | 38 --------------
recipes/aeolus_recipe/manifests/conductor.pp | 41 +++++++++++++++
recipes/aeolus_recipe/manifests/init.pp | 63 +++++++++++++++++++++++
recipes/apache/manifests/init.pp | 6 +-
10 files changed, 132 insertions(+), 119 deletions(-)
create mode 100644 bin/aeolus-node
delete mode 100644 recipes/aeolus_recipe/aeolus_recipe.pp
delete mode 100644 recipes/aeolus_recipe/aeolus_uninstall.pp
create mode 100644 recipes/aeolus_recipe/manifests/init.pp
diff --git a/Rakefile b/Rakefile
index 1104573..647cf65 100644
--- a/Rakefile
+++ b/Rakefile
@@ -19,7 +19,7 @@ RPM_SPEC = "contrib/aeolus-configure.spec"
rpm_task =
Rake::RpmTask.new(RPM_SPEC) do |rpm|
rpm.need_tar = true
- rpm.package_files.include("bin/*", "recipes/**/*")
+ rpm.package_files.include("bin/*", "recipes/**/*",
"conf/*")
rpm.topdir = "#{RPMBUILD_DIR}"
end
diff --git a/bin/aeolus-cleanup b/bin/aeolus-cleanup
index 87fb405..a45a277 100644
--- a/bin/aeolus-cleanup
+++ b/bin/aeolus-cleanup
@@ -2,8 +2,9 @@
export FACTER_AEOLUS_ENABLE_HTTPS=true
export FACTER_AEOLUS_ENABLE_SECURITY=false
-puppet /usr/share/aeolus-configure/aeolus_uninstall.pp \
++puppet /usr/share/aeolus-configure/modules/aeolus_recipe/manifests/defaults.pp \
--modulepath=/usr/share/aeolus-configure/modules/ \
- --logdest=/var/log/aeolus-configure/aeolus-cleanup.log \
+ --external_nodes '/usr/sbin/aeolus-node cleanup' --node_terminus exec \
+ --logdest=/var/log/aeolus-configure/aeolus-configure.log \
--logdest=console
diff --git a/bin/aeolus-configure b/bin/aeolus-configure
index 6d87cb1..a4fae56 100644
--- a/bin/aeolus-configure
+++ b/bin/aeolus-configure
@@ -2,8 +2,9 @@
export FACTER_AEOLUS_ENABLE_HTTPS=true
export FACTER_AEOLUS_ENABLE_SECURITY=false
-puppet /usr/share/aeolus-configure/aeolus_recipe.pp \
+puppet /usr/share/aeolus-configure/modules/aeolus_recipe/manifests/defaults.pp \
--modulepath=/usr/share/aeolus-configure/modules/ \
+ --external_nodes '/usr/sbin/aeolus-node configure' --node_terminus exec \
--logdest=/var/log/aeolus-configure/aeolus-configure.log \
--logdest=console
diff --git a/bin/aeolus-node b/bin/aeolus-node
new file mode 100644
index 0000000..5b1468a
--- /dev/null
+++ b/bin/aeolus-node
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+CAT=/bin/cat
+NODE_DIR=/etc/aeolus-configure/nodes
+
+# look for node setting files, or revert to default
+[ -f nodes/$2_$1 ] && NODE=$2_$1 || NODE=default_$1
+
+$CAT $NODE_DIR/$NODE
diff --git a/contrib/aeolus-configure.spec b/contrib/aeolus-configure.spec
index 4bfaf6a..f4a9877 100644
--- a/contrib/aeolus-configure.spec
+++ b/contrib/aeolus-configure.spec
@@ -3,8 +3,8 @@
Summary: Aeolus Configure Puppet Recipe
Name: aeolus-configure
-Version: 2.0.0
-Release: 11%{?dist}%{?extra_release}
+Version: 2.0.1
+Release: 0%{?dist}%{?extra_release}
Group: Applications/Internet
License: GPLv2+
@@ -31,8 +31,8 @@ Aeolus Configure Puppet Recipe
%install
rm -rf %{buildroot}
%{__mkdir} -p %{buildroot}/%{dchome}/modules/aeolus_recipe %{buildroot}/%{_sbindir}
-%{__cp} -R %{pbuild}/recipes/aeolus_recipe/aeolus_recipe.pp %{buildroot}/%{dchome}
-%{__cp} -R %{pbuild}/recipes/aeolus_recipe/aeolus_uninstall.pp %{buildroot}/%{dchome}
+%{__mkdir} -p %{buildroot}%{_sysconfdir}/aeolus-configure/nodes
+%{__cp} -R %{pbuild}/conf/* %{buildroot}%{_sysconfdir}/aeolus-configure/nodes
%{__cp} -R %{pbuild}/recipes/aeolus_recipe/*/
%{buildroot}/%{dchome}/modules/aeolus_recipe
%{__cp} -R %{pbuild}/recipes/apache/ %{buildroot}/%{dchome}/modules/apache
%{__cp} -R %{pbuild}/recipes/ntp/ %{buildroot}/%{dchome}/modules/ntp
@@ -40,6 +40,7 @@ rm -rf %{buildroot}
%{__cp} -R %{pbuild}/recipes/postgres/ %{buildroot}/%{dchome}/modules/postgres
%{__cp} -R %{pbuild}/bin/aeolus-configure %{buildroot}/%{_sbindir}/
%{__cp} -R %{pbuild}/bin/aeolus-cleanup %{buildroot}/%{_sbindir}/
+%{__cp} -R %{pbuild}/bin/aeolus-node %{buildroot}/%{_sbindir}/\
%clean
rm -rf %{buildroot}
@@ -48,9 +49,14 @@ rm -rf %{buildroot}
%defattr(-,root,root,-)
%attr(0755, root, root) %{_sbindir}/aeolus-configure
%attr(0755, root, root) %{_sbindir}/aeolus-cleanup
+%attr(0755, root, root) %{_sbindir}/aeolus-node
+%config(noreplace) %{_sysconfdir}/aeolus-configure/nodes/*
%{dchome}
%changelog
+* Wed May 18 2011 Mike Orazi <morazi(a)redhat.com> 2.0.1-0
+- Move using external nodes so changes to behavior can happen in etc
+
* Wed May 18 2011 Chris Lalancette <clalance(a)redhat.com> - 2.0.0-11
- Bump the release version
diff --git a/recipes/aeolus_recipe/aeolus_recipe.pp
b/recipes/aeolus_recipe/aeolus_recipe.pp
deleted file mode 100644
index 6ae1827..0000000
--- a/recipes/aeolus_recipe/aeolus_recipe.pp
+++ /dev/null
@@ -1,70 +0,0 @@
-#--
-# Copyright (C) 2010 Red Hat Inc.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# Author: Mohammed Morsi <mmorsi(a)redhat.com>
-#--
-
-#
-# aeolus installation recipe
-#
-
-# Modules used by the recipe
-import "aeolus_recipe/aeolus"
-import "aeolus_recipe/defaults"
-
-# include the various aeolus components
-include aeolus::conductor
-include aeolus::image-factory
-include aeolus::iwhd
-
-aeolus::create_bucket{"aeolus":}
-
-aeolus::site_admin{"$admin_user":
- email => 'dcuser(a)aeolusproject.org',
- password => "$admin_password",
- first_name => 'aeolus',
- last_name => 'user'}
-
-aeolus::provider{"mock":
- type => 'mock',
- port => 3002,
- require => Aeolus::Site_admin["admin"] }
-
-aeolus::provider{"ec2-us-east-1":
- type => 'ec2',
- endpoint => 'us-east-1',
- port => 3003,
- require => Aeolus::Site_admin["admin"] }
-
-aeolus::provider{"ec2-us-west-1":
- type => 'ec2',
- endpoint => 'us-west-1',
- port => 3004,
- require => Aeolus::Site_admin["admin"] }
-
-aeolus::provider{"rhevm":
- type => "rhevm",
- port => 3005,
- require => Aeolus::Site_admin["admin"] }
-
-aeolus::conductor::hwp{"hwp1":
- memory => "1",
- cpu => "1",
- storage => "1",
- architecture => "x86_64",
- require => Aeolus::Site_admin["admin"] }
-
diff --git a/recipes/aeolus_recipe/aeolus_uninstall.pp
b/recipes/aeolus_recipe/aeolus_uninstall.pp
deleted file mode 100644
index 572960a..0000000
--- a/recipes/aeolus_recipe/aeolus_uninstall.pp
+++ /dev/null
@@ -1,38 +0,0 @@
-#--
-# Copyright (C) 2010 Red Hat Inc.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# Author: Mohammed Morsi <mmorsi(a)redhat.com>
-#--
-
-#
-# aeolus uninstallation recipe
-#
-
-# Modules used by the recipe
-import "aeolus_recipe/aeolus"
-import "aeolus_recipe/defaults"
-
-# disable the various aeolus components
-include aeolus::conductor::disabled
-include aeolus::iwhd::disabled
-include aeolus::image-factory::disabled
-
-aeolus::deltacloud::disabled{"mock": }
-aeolus::deltacloud::disabled{"ec2-us-east-1": }
-aeolus::deltacloud::disabled{"ec2-us-west-1": }
-aeolus::deltacloud::disabled{"rhevm": }
-
diff --git a/recipes/aeolus_recipe/manifests/conductor.pp
b/recipes/aeolus_recipe/manifests/conductor.pp
index 10de426..ebe703f 100644
--- a/recipes/aeolus_recipe/manifests/conductor.pp
+++ b/recipes/aeolus_recipe/manifests/conductor.pp
@@ -160,6 +160,47 @@ class aeolus::conductor inherits aeolus {
enable => 'true' }
}
+class aeolus::conductor::seed_data {
+ aeolus::create_bucket{"aeolus":}
+
+ aeolus::site_admin{"$admin_user":
+ email => 'dcuser(a)aeolusproject.org',
+ password => "$admin_password",
+ first_name => 'aeolus',
+ last_name => 'user'}
+
+ aeolus::provider{"mock":
+ type => 'mock',
+ port => 3002,
+ require => Aeolus::Site_admin["admin"] }
+
+ aeolus::provider{"ec2-us-east-1":
+ type => 'ec2',
+ endpoint => 'us-east-1',
+ port => 3003,
+ require => Aeolus::Site_admin["admin"] }
+
+ aeolus::provider{"ec2-us-west-1":
+ type => 'ec2',
+ endpoint => 'us-west-1',
+ port => 3004,
+ require => Aeolus::Site_admin["admin"] }
+
+ aeolus::conductor::hwp{"hwp1":
+ memory => "1",
+ cpu => "1",
+ storage => "1",
+ architecture => "x86_64",
+ require => Aeolus::Site_admin["admin"] }
+
+}
+
+class aeolus::conductor::remove_seed_data {
+ aeolus::deltacloud::disabled{"mock": }
+ aeolus::deltacloud::disabled{"ec2-us-east-1": }
+ aeolus::deltacloud::disabled{"ec2-us-west-1": }
+}
+
class aeolus::conductor::disabled {
file {"/var/lib/aeolus-conductor":
ensure => absent,
diff --git a/recipes/aeolus_recipe/manifests/init.pp
b/recipes/aeolus_recipe/manifests/init.pp
new file mode 100644
index 0000000..e3e601c
--- /dev/null
+++ b/recipes/aeolus_recipe/manifests/init.pp
@@ -0,0 +1,63 @@
+# Aeolus puppet definitions
+
+import "postgres"
+import "apache"
+import "rails"
+import "selinux"
+import "ntp"
+
+import "conductor"
+import "deltacloud"
+import "iwhd"
+import "image-factory"
+
+if $aeolus_enable_https == "true" or $aeolus_enable_https == "1" {
+ import "openssl"
+ $enable_https = true
+} else {
+ $enable_https = false
+}
+
+if $aeolus_enable_security == "true" or $aeolus_enable_security ==
"1" {
+ import "openssl"
+ $enable_security = true
+} else {
+ $enable_security = false
+}
+
+
+# Base aeolus class
+class aeolus {
+ package{'curl': ensure => 'installed'}
+
+ # Setup repos which to pull aeolus components
+ # TODO: Don't hardcode these repos to RHEL-6
+ # The issue is that $releasever resolves to something like 6Server
+ # so we either need to have a repo per RHEL variant, or we need
+ # to have smarter logic here
+ $base_url_release = $operatingsystem ? { 'fedora' =>
"fedora-\$releasever",
+ 'redhat' => 'rhel-6'
}
+ $pulp_base_url_release = $operatingsystem ? { 'fedora' =>
"fedora-13",
+ 'redhat' => 'rhel5'
}
+
+ yumrepo{"${name}_arch":
+ name => "${name}_arch",
+ descr => "${name}_arch",
+ baseurl =>
"http://repos.fedorapeople.org/repos/aeolus/packages/${base_url_release}/\$basearch",
+ enabled => 0, gpgcheck => 0}
+ yumrepo{"${name}_noarch":
+ name => "${name}_noarch",
+ descr => "${name}_noarch",
+ baseurl =>
"http://repos.fedorapeople.org/repos/aeolus/packages/${base_url_release}/noarch",
+ enabled => 0, gpgcheck => 0}
+
+}
+
+# Create a new provider in aeolus
+define aeolus::provider($type, $port, $endpoint=""){
+ aeolus::deltacloud{$name: provider_type => $type, endpoint => $endpoint, port
=> $port}
+ aeolus::conductor::provider{$name:
+ type => $type,
+ url =>
"http://localhost:${port}/api",
+ require => Aeolus::Deltacloud[$name] }
+}
diff --git a/recipes/apache/manifests/init.pp b/recipes/apache/manifests/init.pp
index de703aa..32a0723 100644
--- a/recipes/apache/manifests/init.pp
+++ b/recipes/apache/manifests/init.pp
@@ -1,6 +1,3 @@
-$apache_dir = "/etc/httpd"
-$apache_conf_dir = "${apache_dir}/conf.d"
-
class apache {
# require apache and mod_ssl
package { "httpd": ensure => installed }
@@ -31,6 +28,9 @@ class apache {
}
define apache::site ( $ensure = 'present', $source = '') {
+ $apache_dir = "/etc/httpd"
+ $apache_conf_dir = "${apache_dir}/conf.d"
+
$site_file = "${apache_conf_dir}/${name}.conf"
file {
$site_file:
--
1.7.2.3