1. enable/disable RHEV-M support through config file
2. templatized /etc/rhevm.json and /etc/iwhd/conf.js
3. mount NFS shared directory between iwhd and RHEV-M
4. startup deltacloud-core with RHEV-M powershell as api provider
5. create a hardware profile for RHEV-M
6. add RHEV-M provider in Conductor
---
conf/rhevm_cleanup | 15 +++++++++
conf/rhevm_configure | 26 ++++++++++++++++
recipes/aeolus/manifests/init.pp | 1 +
recipes/aeolus/manifests/rhevm.pp | 53 +++++++++++++++++++++++++++++++++
recipes/aeolus/templates/iwhd-conf.js | 7 ++++
recipes/aeolus/templates/rhevm.json | 12 +++++++
6 files changed, 114 insertions(+), 0 deletions(-)
create mode 100644 conf/rhevm_cleanup
create mode 100644 conf/rhevm_configure
create mode 100644 recipes/aeolus/manifests/rhevm.pp
create mode 100644 recipes/aeolus/templates/iwhd-conf.js
create mode 100644 recipes/aeolus/templates/rhevm.json
diff --git a/conf/rhevm_cleanup b/conf/rhevm_cleanup
new file mode 100644
index 0000000..a43d991
--- /dev/null
+++ b/conf/rhevm_cleanup
@@ -0,0 +1,15 @@
+#RHEV-M-only cleanup specification
+
+#You can override the default behavior
+#by renaming this to <fqdn>_cleanup.
+#This will result in only iwhd being
+#disabled
+---
+parameters:
+ enable_https: true
+ enable_security: false
+ rhevm_nfs_server:
nfs.server.com
+ rhevm_nfs_export: /export/export_domain
+ rhevm_nfs_mount_point: /mnt/rhevm-nfs
+classes:
+- aeolus::rhevm::disabled
diff --git a/conf/rhevm_configure b/conf/rhevm_configure
new file mode 100644
index 0000000..8e6e601
--- /dev/null
+++ b/conf/rhevm_configure
@@ -0,0 +1,26 @@
+#RHEV-M-only setup configuration.
+
+#renaming this file to <fqdn>_configure will
+#make it override the default configure everything
+#behavior with the behavior below to only set up
+#iwhd
+
+#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
+ rhevm_nfs_server:
nfs.server.com
+ rhevm_nfs_export: /export/export_domain
+ rhevm_nfs_mount_point: /mnt/rhevm-nfs
+ rhevm_deltacloud_port: 3005
+ rhevm_deltacloud_username: username@fqdn
+ rhevm_deltacloud_password: password
+ rhevm_deltacloud_powershell_url:
https://rhevm.server.com:8543/rhevm-api-powershell
+classes:
+- aeolus::rhevm
diff --git a/recipes/aeolus/manifests/init.pp b/recipes/aeolus/manifests/init.pp
index e3e601c..1144293 100644
--- a/recipes/aeolus/manifests/init.pp
+++ b/recipes/aeolus/manifests/init.pp
@@ -10,6 +10,7 @@ import "conductor"
import "deltacloud"
import "iwhd"
import "image-factory"
+import "rhevm"
if $aeolus_enable_https == "true" or $aeolus_enable_https == "1" {
import "openssl"
diff --git a/recipes/aeolus/manifests/rhevm.pp b/recipes/aeolus/manifests/rhevm.pp
new file mode 100644
index 0000000..84c18c6
--- /dev/null
+++ b/recipes/aeolus/manifests/rhevm.pp
@@ -0,0 +1,53 @@
+class aeolus::rhevm inherits aeolus {
+ file {"/etc/rhevm.json":
+ content => template("aeolus/rhevm.json"),
+ mode => 755,
+ require => Package['aeolus-conductor-daemons'] }
+
+ file {"/etc/iwhd/conf.js":
+ content => template("aeolus/iwhd-conf.js"),
+ mode => 755,
+ require => Package['aeolus-conductor-daemons'] }
+
+ file {"$rhevm_nfs_mount_point":
+ ensure => 'directory'}
+
+ mount {"$rhevm_nfs_mount_point":
+ ensure => mounted,
+ device => "$rhevm_nfs_server:$rhevm_nfs_export",
+ fstype => "nfs",
+ options => "rw",
+ require => File["$rhevm_nfs_mount_point"]}
+
+ aeolus::conductor::hwp{"rhevm-hwp":
+ memory => "512",
+ cpu => "1",
+ storage => "1",
+ architecture => "x86_64",
+ require => Aeolus::Site_admin["admin"] }
+
+ # break up aeolus::provider into its individual steps for two reasons:
+ # 1. deltacloudd expects "rhevm", imagefactory expects "rhev-m"
passed through by conductor
+ # 2. rhevm-hwp must exist before creating provider
+ aeolus::deltacloud{"rhevm":
+ provider_type => 'rhevm',
+ endpoint => "$rhevm_deltacloud_powershell_url",
+ port => $rhevm_deltacloud_port}
+
+ aeolus::conductor::provider{"rhevm":
+ type => "rhev-m",
+ url => "http://localhost:${rhevm_deltacloud_port}/api",
+ require =>
[Aeolus::Deltacloud["rhevm"],Aeolus::Conductor::Hwp["rhevm-hwp"]]}
+
+ # TODO:
+ # 1. since we have credentials, create provider account
+ # 2. create a realm and mappings
+}
+
+class aeolus::rhevm::disabled {
+ aeolus::deltacloud::disabled{"rhevm": }
+
+ mount {"$rhevm_nfs_mount_point":
+ ensure => unmounted,
+ device => "$rhevm_nfs_server:$rhevm_nfs_export"}
+}
diff --git a/recipes/aeolus/templates/iwhd-conf.js
b/recipes/aeolus/templates/iwhd-conf.js
new file mode 100644
index 0000000..6ae1465
--- /dev/null
+++ b/recipes/aeolus/templates/iwhd-conf.js
@@ -0,0 +1,7 @@
+[
+ {
+ "name": "rhevm",
+ "type": "fs-rhev-m",
+ "path": "<%= rhevm_nfs_mount_point %>"
+ }
+]
diff --git a/recipes/aeolus/templates/rhevm.json b/recipes/aeolus/templates/rhevm.json
new file mode 100644
index 0000000..c32a685
--- /dev/null
+++ b/recipes/aeolus/templates/rhevm.json
@@ -0,0 +1,12 @@
+{
+ "rhevm":
+ {
+ "api-key": "<%= rhevm_deltacloud_username %>",
+ "nfs-dir": "<%= rhevm_nfs_mount_point %>",
+ "nfs-path": "<%= rhevm_nfs_export %>",
+ "nfs-host": "<%= rhevm_nfs_server %>",
+ "api-url": "<%= rhevm_deltacloud_powershell_url %>",
+ "api-secret": "<%= rhevm_deltacloud_password %>",
+ "cluster": "_any_"
+ }
+}
\ No newline at end of file
--
1.7.4.4