https://bugzilla.redhat.com/show_bug.cgi?id=731863
Added profiles (-p option) support to aeolus-cleanup. Valid profiles are iwhd, imagefactory, conductor, and rhevm.
Refactored files under conf/. Each profile has a _configure and a _cleanup version. --- bin/aeolus-cleanup | 23 ++++++++++++++--------- bin/aeolus-configure | 4 ++-- conf/cleanup | 22 ---------------------- conf/conductor_cleanup | 12 ++++++++++++ conf/configure | 27 --------------------------- conf/custom | 7 ------- conf/custom_configure | 7 +++++++ conf/default_cleanup | 22 ++++++++++++++++++++++ conf/default_configure | 27 +++++++++++++++++++++++++++ conf/deltacloud | 4 ---- conf/deltacloud_cleanup | 12 ++++++++++++ conf/deltacloud_configure | 4 ++++ conf/ec2 | 13 ------------- conf/ec2_configure | 13 +++++++++++++ conf/imagebuilder | 6 ------ conf/imagebuilder_configure | 6 ++++++ conf/imagefactory_cleanup | 12 ++++++++++++ conf/imagefactory_configure | 4 ++++ conf/mock | 12 ------------ conf/mock_configure | 12 ++++++++++++ conf/rhevm | 20 -------------------- conf/rhevm_cleanup | 17 +++++++++++++++++ conf/rhevm_configure | 20 ++++++++++++++++++++ conf/vsphere | 18 ------------------ conf/vsphere_configure | 18 ++++++++++++++++++ conf/wui_configure | 5 +++++ 26 files changed, 207 insertions(+), 140 deletions(-) delete mode 100644 conf/cleanup create mode 100644 conf/conductor_cleanup delete mode 100644 conf/configure delete mode 100644 conf/custom create mode 100644 conf/custom_configure create mode 100644 conf/default_cleanup create mode 100644 conf/default_configure delete mode 100644 conf/deltacloud create mode 100644 conf/deltacloud_cleanup create mode 100644 conf/deltacloud_configure delete mode 100644 conf/ec2 create mode 100644 conf/ec2_configure delete mode 100644 conf/imagebuilder create mode 100644 conf/imagebuilder_configure create mode 100644 conf/imagefactory_cleanup create mode 100644 conf/imagefactory_configure delete mode 100644 conf/mock create mode 100644 conf/mock_configure delete mode 100644 conf/rhevm create mode 100644 conf/rhevm_cleanup create mode 100644 conf/rhevm_configure delete mode 100644 conf/vsphere create mode 100644 conf/vsphere_configure create mode 100644 conf/wui_configure
diff --git a/bin/aeolus-cleanup b/bin/aeolus-cleanup index ef7427c..7d15559 100644 --- a/bin/aeolus-cleanup +++ b/bin/aeolus-cleanup @@ -19,17 +19,18 @@ usage() cat << EOF
USAGE: -aeolus-cleanup [-d|--debug] [-h|--help] [-v|--verbose] [-s|--savedata] +aeolus-cleanup [-d|--debug] [-h|--help] [-v|--verbose] [-s|--savedata] [-p|--profile]
OPTIONS: -h | --help Show this message. -d | --debug Debug logging mode. -v | --verbose Verbose logging mode. -s | --savedata Do not delete existing data. + -p | --profile Name of profile to use. A comma separated list can be used to specify multiple profiles. EOF }
-args=`getopt -o :hdvs --long help,debug,verbose,savedata -- "$@"` +args=`getopt -o :hdvsp: --long help,debug,verbose,savedata,profile -- "$@"` if test $? != 0 then usage @@ -37,6 +38,7 @@ if test $? != 0 fi
SAVE_DATA=false +PUPPET_NODE='default'
eval set -- $args while true ; do @@ -45,24 +47,27 @@ while true ; do -d|--debug) LOGLEVEL="--debug" ; shift ;; -v|--verbose) LOGLEVEL="--verbose" ; shift ;; -s|--savedata) SAVE_DATA=true ; shift ;; + -p|--profile) PUPPET_NODE=$2 ; shift ; shift ;; --) shift ; break ;; *) usage ; exit 1 ;; esac done
-PUPPET_NODE='cleanup' - export FACTER_AEOLUS_ENABLE_HTTPS=true export FACTER_AEOLUS_ENABLE_SECURITY=false export FACTER_AEOLUS_SAVE_DATA=$SAVE_DATA
-puppet /usr/share/aeolus-configure/modules/aeolus/aeolus.pp \ +NODE_ARRAY=(`echo $PUPPET_NODE | tr "," "\n"`) +for x in "${NODE_ARRAY[@]}" +do + puppet /usr/share/aeolus-configure/modules/aeolus/aeolus.pp \ --modulepath=/usr/share/aeolus-configure/modules/ \ - --external_nodes "/bin/sh /usr/share/aeolus-configure/modules/aeolus/aeolus-node $PUPPET_NODE" --node_terminus exec \ + --external_nodes "/bin/sh /usr/share/aeolus-configure/modules/aeolus/aeolus-node ${x}_cleanup" --node_terminus exec \ --logdest=/var/log/aeolus-configure/aeolus-cleanup.log \ --logdest=console \ $LOGLEVEL \ --detailed-exitcodes -if [ $? != 0 -a $? != 2 ] ; then - exit 1 -fi + if [ $? != 0 -a $? != 2 ] ; then + exit 1 + fi +done \ No newline at end of file diff --git a/bin/aeolus-configure b/bin/aeolus-configure index 9b57b99..503851d 100755 --- a/bin/aeolus-configure +++ b/bin/aeolus-configure @@ -39,7 +39,7 @@ fi
INTERACTIVE=1
-PUPPET_NODE='configure' +PUPPET_NODE='default'
eval set -- $args while true ; do @@ -74,7 +74,7 @@ for x in "${NODE_ARRAY[@]}" do puppet /usr/share/aeolus-configure/modules/aeolus/aeolus.pp \ --modulepath=/usr/share/aeolus-configure/modules/ \ - --external_nodes "/bin/sh /usr/share/aeolus-configure/modules/aeolus/aeolus-node $x" --node_terminus exec \ + --external_nodes "/bin/sh /usr/share/aeolus-configure/modules/aeolus/aeolus-node ${x}_configure" --node_terminus exec \ --logdest=/var/log/aeolus-configure/aeolus-configure.log \ --logdest=console \ $LOGLEVEL \ diff --git a/conf/cleanup b/conf/cleanup deleted file mode 100644 index 5e2fcd7..0000000 --- a/conf/cleanup +++ /dev/null @@ -1,22 +0,0 @@ -#Default cleanup specification - -#Set everything up on this box. -#You can override the default behavior -#by creating <fqdn>_cleanup with the -#class membership and parameters as -#desire and it will take precedence over this. ---- -parameters: - enable_https: true - enable_security: false -# Uncomment these to clean up RHEV -# rhevm_nfs_server: nfs.server.com -# rhevm_nfs_export: /export/export_domain -# rhevm_nfs_mount_point: /mnt/rhevm-nfs -classes: -- aeolus::conductor::disabled -- aeolus::iwhd::disabled -- aeolus::image-factory::disabled -- aeolus::deltacloud::disabled -# Uncomment this to clean up RHEV details -#- aeolus::profiles::rhevm::disabled diff --git a/conf/conductor_cleanup b/conf/conductor_cleanup new file mode 100644 index 0000000..708be5e --- /dev/null +++ b/conf/conductor_cleanup @@ -0,0 +1,12 @@ +#conductor-only cleanup specification + +#You can override the default behavior +#by renaming this to <fqdn>_cleanup. +#This will result in only conductor being +#disabled +--- +parameters: + enable_https: true + enable_security: false +classes: +- aeolus::conductor::disabled diff --git a/conf/configure b/conf/configure deleted file mode 100644 index db33897..0000000 --- a/conf/configure +++ /dev/null @@ -1,27 +0,0 @@ -#Default setup configuration. - -#Set everything up on this box. -#You can override the default behavior -#by creating <fqdn>_configure with the -#class membership and parameters as -#desire and it will take precedence over this. - -#NOTE: Although this suggests the components -#can be deployed on individual boxes. This will likely -#become a common practice, but be advised that currently -#apart from https on the web server for conductor, you should -#consider intermachine communications insecure. Securing -#intermachine service calls is on the roadmap. -# ---- -parameters: - enable_https: true - enable_security: false - package_provider: rpm -classes: -- aeolus::conductor -- aeolus::image-factory -- aeolus::iwhd -- aeolus::deltacloud::core -- aeolus::deltacloud::ec2 -- aeolus::profiles::default diff --git a/conf/custom b/conf/custom deleted file mode 100644 index 1e7f7aa..0000000 --- a/conf/custom +++ /dev/null @@ -1,7 +0,0 @@ ---- -parameters: - enable_https: true - enable_security: false -classes: -CUSTOM_CLASSES -- aeolus::profiles::custom diff --git a/conf/custom_configure b/conf/custom_configure new file mode 100644 index 0000000..1e7f7aa --- /dev/null +++ b/conf/custom_configure @@ -0,0 +1,7 @@ +--- +parameters: + enable_https: true + enable_security: false +classes: +CUSTOM_CLASSES +- aeolus::profiles::custom diff --git a/conf/default_cleanup b/conf/default_cleanup new file mode 100644 index 0000000..5e2fcd7 --- /dev/null +++ b/conf/default_cleanup @@ -0,0 +1,22 @@ +#Default cleanup specification + +#Set everything up on this box. +#You can override the default behavior +#by creating <fqdn>_cleanup with the +#class membership and parameters as +#desire and it will take precedence over this. +--- +parameters: + enable_https: true + enable_security: false +# Uncomment these to clean up RHEV +# rhevm_nfs_server: nfs.server.com +# rhevm_nfs_export: /export/export_domain +# rhevm_nfs_mount_point: /mnt/rhevm-nfs +classes: +- aeolus::conductor::disabled +- aeolus::iwhd::disabled +- aeolus::image-factory::disabled +- aeolus::deltacloud::disabled +# Uncomment this to clean up RHEV details +#- aeolus::profiles::rhevm::disabled diff --git a/conf/default_configure b/conf/default_configure new file mode 100644 index 0000000..db33897 --- /dev/null +++ b/conf/default_configure @@ -0,0 +1,27 @@ +#Default setup configuration. + +#Set everything up on this box. +#You can override the default behavior +#by creating <fqdn>_configure with the +#class membership and parameters as +#desire and it will take precedence over this. + +#NOTE: Although this suggests the components +#can be deployed on individual boxes. This will likely +#become a common practice, but be advised that currently +#apart from https on the web server for conductor, you should +#consider intermachine communications insecure. Securing +#intermachine service calls is on the roadmap. +# +--- +parameters: + enable_https: true + enable_security: false + package_provider: rpm +classes: +- aeolus::conductor +- aeolus::image-factory +- aeolus::iwhd +- aeolus::deltacloud::core +- aeolus::deltacloud::ec2 +- aeolus::profiles::default diff --git a/conf/deltacloud b/conf/deltacloud deleted file mode 100644 index 329b235..0000000 --- a/conf/deltacloud +++ /dev/null @@ -1,4 +0,0 @@ -parameters: - package_provider: rpm -classes: -- aeolus::profiles::deltacloud diff --git a/conf/deltacloud_cleanup b/conf/deltacloud_cleanup new file mode 100644 index 0000000..42dd2bc --- /dev/null +++ b/conf/deltacloud_cleanup @@ -0,0 +1,12 @@ +#deltacloud-only cleanup specification + +#You can override the default behavior +#by renaming this to <fqdn>_cleanup. +#This will result in only deltacloud being +#disabled +--- +parameters: + enable_https: true + enable_security: false +classes: +- aeolus::deltacloud::disabled diff --git a/conf/deltacloud_configure b/conf/deltacloud_configure new file mode 100644 index 0000000..329b235 --- /dev/null +++ b/conf/deltacloud_configure @@ -0,0 +1,4 @@ +parameters: + package_provider: rpm +classes: +- aeolus::profiles::deltacloud diff --git a/conf/ec2 b/conf/ec2 deleted file mode 100644 index 142887f..0000000 --- a/conf/ec2 +++ /dev/null @@ -1,13 +0,0 @@ -# ec2 setup configuration. ---- -parameters: - enable_https: true - enable_security: false - package_provider: rpm -classes: -- aeolus::conductor -- aeolus::image-factory -- aeolus::iwhd -- aeolus::deltacloud::core -- aeolus::deltacloud::ec2 -- aeolus::profiles::ec2 diff --git a/conf/ec2_configure b/conf/ec2_configure new file mode 100644 index 0000000..142887f --- /dev/null +++ b/conf/ec2_configure @@ -0,0 +1,13 @@ +# ec2 setup configuration. +--- +parameters: + enable_https: true + enable_security: false + package_provider: rpm +classes: +- aeolus::conductor +- aeolus::image-factory +- aeolus::iwhd +- aeolus::deltacloud::core +- aeolus::deltacloud::ec2 +- aeolus::profiles::ec2 diff --git a/conf/imagebuilder b/conf/imagebuilder deleted file mode 100644 index 7fb49e9..0000000 --- a/conf/imagebuilder +++ /dev/null @@ -1,6 +0,0 @@ -parameters: - package_provider: rpm -classes: -- aeolus::image-factory -- aeolus::iwhd -- aeolus::profiles::imagebuilder diff --git a/conf/imagebuilder_configure b/conf/imagebuilder_configure new file mode 100644 index 0000000..7fb49e9 --- /dev/null +++ b/conf/imagebuilder_configure @@ -0,0 +1,6 @@ +parameters: + package_provider: rpm +classes: +- aeolus::image-factory +- aeolus::iwhd +- aeolus::profiles::imagebuilder diff --git a/conf/imagefactory_cleanup b/conf/imagefactory_cleanup new file mode 100644 index 0000000..1d30d0a --- /dev/null +++ b/conf/imagefactory_cleanup @@ -0,0 +1,12 @@ +#imagefactory-only cleanup specification + +#You can override the default behavior +#by renaming this to <fqdn>_cleanup. +#This will result in only imagefactory being +#disabled +--- +parameters: + enable_https: true + enable_security: false +classes: +- aeolus::image-factory::disabled diff --git a/conf/imagefactory_configure b/conf/imagefactory_configure new file mode 100644 index 0000000..ed15806 --- /dev/null +++ b/conf/imagefactory_configure @@ -0,0 +1,4 @@ +parameters: + package_provider: rpm +classes: +- aeolus::image-factory diff --git a/conf/mock b/conf/mock deleted file mode 100644 index 087c329..0000000 --- a/conf/mock +++ /dev/null @@ -1,12 +0,0 @@ -# mock setup configuration. ---- -parameters: - enable_https: true - enable_security: false - package_provider: rpm -classes: -- aeolus::conductor -- aeolus::image-factory -- aeolus::iwhd -- aeolus::deltacloud::core -- aeolus::profiles::mock diff --git a/conf/mock_configure b/conf/mock_configure new file mode 100644 index 0000000..087c329 --- /dev/null +++ b/conf/mock_configure @@ -0,0 +1,12 @@ +# mock setup configuration. +--- +parameters: + enable_https: true + enable_security: false + package_provider: rpm +classes: +- aeolus::conductor +- aeolus::image-factory +- aeolus::iwhd +- aeolus::deltacloud::core +- aeolus::profiles::mock diff --git a/conf/rhevm b/conf/rhevm deleted file mode 100644 index 860c079..0000000 --- a/conf/rhevm +++ /dev/null @@ -1,20 +0,0 @@ ---- -parameters: - enable_https: true - enable_security: false - package_provider: rpm -# Uncomment and provide values to match your RHEV environment. -# Values below are examples. -# rhevm_nfs_server: nfs.server.com -# rhevm_nfs_export: /export/export_domain -# rhevm_nfs_mount_point: /mnt/rhevm-nfs -# rhevm_deltacloud_username: username@fqdn -# rhevm_deltacloud_password: password -# rhevm_deltacloud_provider: https://rhevm.server.com:8443/api -# rhevm_push_timeout: 1800 -classes: -- aeolus::conductor -- aeolus::image-factory -- aeolus::iwhd -- aeolus::deltacloud::core -- aeolus::profiles::rhevm diff --git a/conf/rhevm_cleanup b/conf/rhevm_cleanup new file mode 100644 index 0000000..55c1b46 --- /dev/null +++ b/conf/rhevm_cleanup @@ -0,0 +1,17 @@ +#rhevm-only cleanup specification + +#You can override the default behavior +#by renaming this to <fqdn>_cleanup. +#This will result in only rhevm being +#disabled +--- +parameters: + enable_https: true + enable_security: false +# Uncomment and provide values to match your RHEV environment. +# Values below are examples. +# rhevm_nfs_server: nfs.server.com +# rhevm_nfs_export: /export/export_domain +# rhevm_nfs_mount_point: /mnt/rhevm-nfs +classes: +- aeolus::profiles::rhevm::disabled diff --git a/conf/rhevm_configure b/conf/rhevm_configure new file mode 100644 index 0000000..860c079 --- /dev/null +++ b/conf/rhevm_configure @@ -0,0 +1,20 @@ +--- +parameters: + enable_https: true + enable_security: false + package_provider: rpm +# Uncomment and provide values to match your RHEV environment. +# Values below are examples. +# rhevm_nfs_server: nfs.server.com +# rhevm_nfs_export: /export/export_domain +# rhevm_nfs_mount_point: /mnt/rhevm-nfs +# rhevm_deltacloud_username: username@fqdn +# rhevm_deltacloud_password: password +# rhevm_deltacloud_provider: https://rhevm.server.com:8443/api +# rhevm_push_timeout: 1800 +classes: +- aeolus::conductor +- aeolus::image-factory +- aeolus::iwhd +- aeolus::deltacloud::core +- aeolus::profiles::rhevm diff --git a/conf/vsphere b/conf/vsphere deleted file mode 100644 index b000bc4..0000000 --- a/conf/vsphere +++ /dev/null @@ -1,18 +0,0 @@ ---- -parameters: - enable_https: true - enable_security: false - package_provider: rpm -# Uncomment and provide values to match your vSphere environment. -# Values below are examples. -# vsphere_deltacloud_provider: vsphere.server.com -# vsphere_username: username -# vsphere_password: password -# vsphere_datastore: datastore -# vsphere_network_name: network_name -classes: -- aeolus::conductor -- aeolus::image-factory -- aeolus::iwhd -- aeolus::deltacloud::core -- aeolus::profiles::vsphere diff --git a/conf/vsphere_configure b/conf/vsphere_configure new file mode 100644 index 0000000..b000bc4 --- /dev/null +++ b/conf/vsphere_configure @@ -0,0 +1,18 @@ +--- +parameters: + enable_https: true + enable_security: false + package_provider: rpm +# Uncomment and provide values to match your vSphere environment. +# Values below are examples. +# vsphere_deltacloud_provider: vsphere.server.com +# vsphere_username: username +# vsphere_password: password +# vsphere_datastore: datastore +# vsphere_network_name: network_name +classes: +- aeolus::conductor +- aeolus::image-factory +- aeolus::iwhd +- aeolus::deltacloud::core +- aeolus::profiles::vsphere diff --git a/conf/wui_configure b/conf/wui_configure new file mode 100644 index 0000000..b2f20c5 --- /dev/null +++ b/conf/wui_configure @@ -0,0 +1,5 @@ +parameters: + package_provider: rpm +classes: +- aeolus::conductor +- aeolus::profiles::conductor