diff --git a/packstack/plugins/puppet_950.py b/packstack/plugins/puppet_950.py index 474d772ec..add1ba3a8 100644 --- a/packstack/plugins/puppet_950.py +++ b/packstack/plugins/puppet_950.py @@ -78,7 +78,7 @@ def copyPuppetModules(): tar_opts += "--exclude create_resources " for hostname in gethostlist(controller.CONF): server.append("cd %s/puppet" % basedefs.DIR_PROJECT_DIR) - server.append("tar %s --dereference -czf - modules | ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@%s tar -C %s -xzf -" % (tar_opts, hostname, basedefs.VAR_DIR)) + server.append("tar %s --dereference -czf - modules facts | ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@%s tar -C %s -xzf -" % (tar_opts, hostname, basedefs.VAR_DIR)) server.append("cd %s" % basedefs.PUPPET_MANIFEST_DIR) server.append("tar %s --dereference -czf - ../manifests | ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@%s tar -C %s -xzf -" % (tar_opts, hostname, basedefs.VAR_DIR)) server.execute() @@ -132,6 +132,7 @@ def applyPuppetManifest(): logfile = "%s.log" % manifest currently_running.append((hostname, logfile)) command = "( flock %s/ps.lock puppet apply --modulepath %s/modules %s > %s_ 2>&1 < /dev/null ; mv %s_ %s ) > /dev/null 2>&1 < /dev/null &" % (basedefs.VAR_DIR, basedefs.VAR_DIR, manifest, logfile, logfile, logfile) + server.append("export FACTERLIB=%s/facts"%basedefs.VAR_DIR) server.append(command) server.execute() diff --git a/packstack/puppet/facts/home_dir.rb b/packstack/puppet/facts/home_dir.rb new file mode 100644 index 000000000..1e2745264 --- /dev/null +++ b/packstack/puppet/facts/home_dir.rb @@ -0,0 +1,8 @@ + +# Current users home directory + +Facter.add("home_dir") do + setcode do + Facter::Util::Resolution.exec('/bin/echo $HOME') + end +end diff --git a/packstack/puppet/templates/openstack_client.pp b/packstack/puppet/templates/openstack_client.pp index 2e0ade96c..da3e1562f 100644 --- a/packstack/puppet/templates/openstack_client.pp +++ b/packstack/puppet/templates/openstack_client.pp @@ -7,7 +7,7 @@ package {"clientlibs": name => ["python-novaclient", "python-keystoneclient", "python-glanceclient", "python-swiftclient", "python-cinderclient"] } -file {"/root/keystonerc_admin": +file {"${::home_dir}/keystonerc_admin": ensure => "present", mode => '0600', content => "export OS_USERNAME=admin