The problem was aeolus-configure generated new uuids each time it is invoked.
Matt has created a patch for conductor to have the rpm generate and install
a oauth.json file which will be the canonical source for the keys.
This patch augments configure to read oauth.json and to produce custom facts
replacing the auto generated uuids in aeolus-configure.
---
bin/aeolus-configure | 5 ---
recipes/aeolus/lib/facter/oauth.rb | 48 +++++++++++++++++++++++++++++
recipes/aeolus/manifests/image-factory.pp | 2 +-
3 files changed, 49 insertions(+), 6 deletions(-)
create mode 100644 recipes/aeolus/lib/facter/oauth.rb
diff --git a/bin/aeolus-configure b/bin/aeolus-configure
index 7123226..16a1bc0 100755
--- a/bin/aeolus-configure
+++ b/bin/aeolus-configure
@@ -68,11 +68,6 @@ echo "Launching aeolus configuration recipe..."
export FACTER_AEOLUS_ENABLE_HTTPS=true
export FACTER_AEOLUS_ENABLE_SECURITY=false
-export FACTER_IWHD_OAUTH_USER=`uuidgen`
-export FACTER_IWHD_OAUTH_PASSWORD=`uuidgen`
-export FACTER_IMAGEFACTORY_OAUTH_USER=`uuidgen`
-export FACTER_IMAGEFACTORY_OAUTH_PASSWORD=`uuidgen`
-
NODE_ARRAY=(`echo $PUPPET_NODE | tr "," "\n"`)
for x in "${NODE_ARRAY[@]}"
do
diff --git a/recipes/aeolus/lib/facter/oauth.rb b/recipes/aeolus/lib/facter/oauth.rb
new file mode 100644
index 0000000..e5caa7d
--- /dev/null
+++ b/recipes/aeolus/lib/facter/oauth.rb
@@ -0,0 +1,48 @@
+# Copyright 2011 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.
+
+# Read oauth values from /etc/aeolus-conductor/oauth.json and create facts
+# for them. The file is generated by aeolus-conductor rpm.
+
+require 'rubygems'
+require 'json'
+
+file = File.open("/etc/aeolus-conductor/oauth.json", 'r') or raise
"Could not open file\
+"
+contents = file.read
+oauthconfig = JSON.parse(contents)
+
+Facter.add("imagefactory_oauth_user") do
+ setcode do
+ oauthconfig['factory']['consumer_key']
+ end
+end
+
+Facter.add("imagefactory_oauth_password") do
+ setcode do
+ oauthconfig['factory']['consumer_secret']
+ end
+end
+
+Facter.add("iwhd_oauth_user") do
+ setcode do
+ oauthconfig['iwhd']['consumer_key']
+ end
+end
+
+Facter.add("iwhd_oauth_password") do
+ setcode do
+ oauthconfig['iwhd']['consumer_secret']
+ end
+end
diff --git a/recipes/aeolus/manifests/image-factory.pp
b/recipes/aeolus/manifests/image-factory.pp
index c386c1c..f4b4221 100644
--- a/recipes/aeolus/manifests/image-factory.pp
+++ b/recipes/aeolus/manifests/image-factory.pp
@@ -64,7 +64,7 @@ class aeolus::image-factory inherits aeolus {
file {"/etc/imagefactory/imagefactory.conf":
content => template("aeolus/imagefactory.conf"),
mode => 755,
- require => Package['imagefactory'] }
+ require => [Package['imagefactory'],Package['aeolus-conductor']]
}
$requires = [Package['imagefactory'],
File['/var/tmp/imagefactory-mock',
--
1.7.6.4