Permalink
Browse files

add support for aeolus configuration profiles

  • Loading branch information...
1 parent 7cd009e commit 22f22262080223667514bcc1c1f7210e9847bcc3 @movitto movitto committed Aug 4, 2011
View
@@ -31,11 +31,13 @@ while true ; do
esac
done
+PUPPET_NODE='cleanup'
+
export FACTER_AEOLUS_ENABLE_HTTPS=true
export FACTER_AEOLUS_ENABLE_SECURITY=false
-puppet /usr/share/aeolus-configure/modules/aeolus/manifests/defaults.pp \
+puppet /usr/share/aeolus-configure/aeolus.pp \
--modulepath=/usr/share/aeolus-configure/modules/ \
- --external_nodes '/usr/sbin/aeolus-node cleanup' --node_terminus exec \
+ --external_nodes "/usr/sbin/aeolus-node $PUPPET_NODE" --node_terminus exec \
--logdest=/var/log/aeolus-configure/aeolus-cleanup.log \
--logdest=console \
$LOGLEVEL
View
@@ -4,38 +4,55 @@ usage()
cat << EOF
USAGE:
-aeolus-configure [-d|--debug] [-h|--help] [-v|--verbose]
+aeolus-configure [-d|--debug] [-h|--help] [-v|--verbose] [-i|--interactive]
OPTIONS:
-h | --help Show this message.
-d | --debug Debug logging mode.
-v | --verbose Verbose logging mode.
+ -i | --interactive Interactive installer.
EOF
}
-args=`getopt -o :hdv --long help,debug,verbose -- "$@"`
+args=`getopt -o :hdvi --long help,debug,verbose,interactive -- "$@"`
if test $? != 0
then
usage
exit 1
fi
+INTERACTIVE=1
+
eval set -- $args
while true ; do
case "$1" in
-h|--help) usage ; exit 1 ; shift ;;
-d|--debug) LOGLEVEL="--debug" ; shift ;;
-v|--verbose) LOGLEVEL="--verbose" ; shift ;;
+ -i|--interactive) INTERACTIVE=0 ; shift ;;
--) shift ; break ;;
*) usage ; exit 1 ;;
esac
done
+PUPPET_NODE='configure'
+
+if [[ $INTERACTIVE -eq 0 ]] ; then
+PUPPET_NODE='custom'
+/usr/bin/ruby /usr/share/aeolus-configure/cli.rb
+if [ $? == 1 ] ; then
+echo
+exit
+fi
+fi
+
+echo "Launching aeolus configuration recipe..."
+
export FACTER_AEOLUS_ENABLE_HTTPS=true
export FACTER_AEOLUS_ENABLE_SECURITY=false
-puppet /usr/share/aeolus-configure/modules/aeolus/manifests/defaults.pp \
+puppet /usr/share/aeolus-configure/aeolus.pp \
--modulepath=/usr/share/aeolus-configure/modules/ \
- --external_nodes '/usr/sbin/aeolus-node configure' --node_terminus exec \
+ --external_nodes "/usr/sbin/aeolus-node $PUPPET_NODE" --node_terminus exec \
--logdest=/var/log/aeolus-configure/aeolus-configure.log \
--logdest=console \
$LOGLEVEL
View
@@ -38,7 +38,7 @@ classes:
- aeolus::conductor
- aeolus::image-factory
- aeolus::iwhd
-- aeolus::conductor::seed_data
+- aeolus::profiles::default
# Uncomment this section to include rhev setup
#- aeolus::rhevm
#
View
@@ -0,0 +1,7 @@
+---
+parameters:
+ enable_https: true
+ enable_security: false
+classes:
+CUSTOM_CLASSES
+- aeolus::profiles::custom
@@ -116,40 +116,6 @@
enable => 'true' }
}
-class aeolus::conductor::seed_data {
- aeolus::create_bucket{"aeolus":}
-
- aeolus::site_admin{"$admin_user":
- email => 'aeolususer@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 => "512",
- cpu => "1",
- storage => "",
- architecture => "x86_64",
- require => Aeolus::Site_admin["admin"] }
-
-}
class aeolus::conductor::remove_seed_data {
aeolus::deltacloud::disabled{"mock": }
@@ -187,7 +153,7 @@
}
# Create a new site admin conductor web user
-define aeolus::site_admin($email="", $password="", $first_name="", $last_name=""){
+define aeolus::conductor::site_admin($email="", $password="", $first_name="", $last_name=""){
exec{"create_site_admin_user":
cwd => '/usr/share/aeolus-conductor',
environment => "RAILS_ENV=production",
@@ -13,6 +13,9 @@
import "rhevm"
import "vmware"
+import "defaults"
+import "profiles/*"
+
if $aeolus_enable_https == "true" or $aeolus_enable_https == "1" {
import "openssl"
$enable_https = true
@@ -0,0 +1,26 @@
+class aeolus::profiles::custom {
+
+aeolus::create_bucket{"aeolus":}
+
+aeolus::conductor::site_admin{"admin":
+ email => 'dcuser@aeolusproject.org',
+ password => "password",
+ first_name => 'aeolus',
+ last_name => 'user'}
+
+aeolus::conductor::login{"admin": password => "password",
+ require => Aeolus::Conductor::Site_admin['admin']}
+
+#AEOLUS_SEED_DATA
+
+aeolus::conductor::hwp{"hwp1":
+ memory => "1",
+ cpu => "1",
+ storage => "1",
+ architecture => "x86_64",
+ require => Aeolus::Conductor::Login["admin"] }
+
+aeolus::conductor::logout{"admin":
+ require => [#AEOLUS_SEED_DATA_REQUIRES
+ Aeolus::Conductor::Hwp["hwp1"]] }
+}
@@ -0,0 +1,51 @@
+class aeolus::profiles::default {
+
+ aeolus::create_bucket{"aeolus":}
+
+ aeolus::conductor::site_admin{"admin":
+ email => 'dcuser@aeolusproject.org',
+ password => "password",
+ first_name => 'aeolus',
+ last_name => 'user'}
+
+ aeolus::conductor::login{"admin": password => "password",
+ require => Aeolus::Conductor::Site_admin['admin']}
+
+ aeolus::provider{"mock":
+ type => 'mock',
+ port => 3002,
+ require => Aeolus::Conductor::Login["admin"] }
+ aeolus::conductor::provider::account{"mockuser":
+ provider => 'mock',
+ type => 'mock',
+ username => 'mockuser',
+ password => 'mockpassword',
+ require => Aeolus::Provider["mock"] }
+
+ aeolus::provider{"ec2-us-east-1":
+ type => 'ec2',
+ endpoint => 'us-east-1',
+ port => 3003,
+ require => Aeolus::Conductor::Login["admin"] }
+
+ aeolus::provider{"ec2-us-west-1":
+ type => 'ec2',
+ endpoint => 'us-west-1',
+ port => 3004,
+ require => Aeolus::Conductor::Login["admin"] }
+
+ aeolus::conductor::hwp{"hwp1":
+ memory => "512",
+ cpu => "1",
+ storage => "",
+ architecture => "x86_64",
+ require => Aeolus::Conductor::Login["admin"] }
+
+ aeolus::conductor::logout{"admin":
+ require => [Aeolus::Provider['mock'],
+ Aeolus::Conductor::Provider::Account['mockuser'],
+ Aeolus::Provider['ec2-us-east-1'],
+ Aeolus::Provider['ec2-us-west-1'],
+ Aeolus::Conductor::Hwp['hwp1']] }
+
+}

0 comments on commit 22f2226

Please sign in to comment.