[PATCH configure] BZ 788644 - multiple RHEV providers with aeolus_cleanup

Richard Su rwsu at redhat.com
Thu Feb 9 00:03:09 UTC 2012


https://bugzilla.redhat.com/show_bug.cgi?id=788644

Cleanup process needed to be updated to support multiple
RHEV providers.
---
 conf/rhevm_cleanup                                 |   16 +++++++++-----
 recipes/aeolus/manifests/profiles/rhevm.pp         |    7 +----
 recipes/aeolus/manifests/profiles/rhevm/disable.pp |   21 ++++++++++++++++++++
 3 files changed, 33 insertions(+), 11 deletions(-)
 create mode 100644 recipes/aeolus/manifests/profiles/rhevm/disable.pp

diff --git a/conf/rhevm_cleanup b/conf/rhevm_cleanup
index 55c1b46..d28dad1 100644
--- a/conf/rhevm_cleanup
+++ b/conf/rhevm_cleanup
@@ -8,10 +8,14 @@
 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
+  package_provider: rpm
 classes:
-- aeolus::profiles::rhevm::disabled
+  aeolus::profiles::rhevm::disabled:
+    instances:
+      default:
+        # Uncomment and provide values to match your RHEV environment.
+        #
+        # Values below are examples.
+        #
+        #  nfs_mount_point: /mnt/rhevm-nfs
+
diff --git a/recipes/aeolus/manifests/profiles/rhevm.pp b/recipes/aeolus/manifests/profiles/rhevm.pp
index 85bc8e6..5d56f80 100644
--- a/recipes/aeolus/manifests/profiles/rhevm.pp
+++ b/recipes/aeolus/manifests/profiles/rhevm.pp
@@ -54,9 +54,6 @@ define aeolus::rhevm::validate($rhevm_rest_api_url,$rhevm_data_center,$rhevm_use
   }
 }
 
-class aeolus::profiles::rhevm::disabled {
-  exec {"umount $rhevm_nfs_mount_point":
-        path => ["/sbin", "/bin"],
-        onlyif => [["mount -l | grep $rhevm_nfs_mount_point"],
-                   ["/bin/sh -c '! (ps -ef | grep -v grep | grep dc-rhev-image)'"]]}
+class aeolus::profiles::rhevm::disabled($instances) {
+    create_resources2('aeolus::profiles::rhevm::disable', $instances)
 }
diff --git a/recipes/aeolus/manifests/profiles/rhevm/disable.pp b/recipes/aeolus/manifests/profiles/rhevm/disable.pp
new file mode 100644
index 0000000..4ab8346
--- /dev/null
+++ b/recipes/aeolus/manifests/profiles/rhevm/disable.pp
@@ -0,0 +1,21 @@
+#   Copyright 2012 Red Hat, Inc.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+
+define aeolus::profiles::rhevm::disable ($nfs_mount_point)
+{
+  exec {"umount $nfs_mount_point":
+    path => ["/sbin", "/bin"],
+    onlyif => [["mount -l | grep $nfs_mount_point"],
+               ["/bin/sh -c '! (ps -ef | grep -v grep | grep dc-rhev-image)'"]]}
+}
-- 
1.7.7.6




More information about the aeolus-devel mailing list