Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

Commit

Permalink
extracted public_key to config
Browse files Browse the repository at this point in the history
  • Loading branch information
iigorr committed Oct 22, 2013
1 parent b620781 commit 8c92d07
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
9 changes: 8 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Vagrant::Config.run do |config|

username = 'vagrant'
password = '$6$aqzOtgCM$OxgoMP4JoqMJ1U1F3MZPo2iBefDRnRCXSfgIM36E5cfMNcE7GcNtH1P/tTC2QY3sX3BxxJ7r/9ciScIVTa55l0'
public_key= ''

if yml.has_key?('username')
username = yml['username']
Expand All @@ -16,6 +17,11 @@ Vagrant::Config.run do |config|
password = yml['password']
end

if yml.has_key?('public_key')
public_key = yml['public_key']
end


config.vm.define "gw" do |gw|
gw.vm.box = "gw"
gw.vm.host_name = "gw.dev"
Expand All @@ -30,7 +36,8 @@ Vagrant::Config.run do |config|
puppet.facter = {
"fqdn" => "box.dev",
'username' => username,
'password' => password
'password' => password,
'public_key' => public_key
}
end

Expand Down
1 change: 0 additions & 1 deletion puppet/modules/system-base/files/id_rsa_4096.pub

This file was deleted.

3 changes: 1 addition & 2 deletions puppet/modules/system-base/manifests/users.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

class system-base::users {

$password = '$6$1OK3l7RB$QPsWNzK0A9JnwBn9rGohmp58XPrg6SvKFBLrRXSO30933or6qQjd1D2DZZL/IkpkbqQYjNSyZ/liwCX3qiqVT/'
user { $username:
ensure => "present",
shell => '/bin/bash',
Expand All @@ -27,7 +26,7 @@
}

file {"/home/$username/.ssh/authorized_keys":
source => "puppet:///modules/system-base/id_rsa_4096.pub",
content => $public_key,
owner => $username,
group => $username,
mode => 600,
Expand Down

0 comments on commit 8c92d07

Please sign in to comment.