|
13 | 13 | ensure => directory, |
14 | 14 | before => Accounts::User['hunner'], |
15 | 15 | } |
| 16 | + if $facts['puppetversion'][0] == '6' { |
| 17 | + $key_test = [ |
| 18 | + 'ssh-rsa #{test_key} vagrant', |
| 19 | + 'command="/bin/echo Hello",from="myhost.example.com,192.168.1.1" ssh-rsa #{test_key} vagrant2' |
| 20 | + ] |
| 21 | + } |
| 22 | + else { |
| 23 | + $key_test = [ |
| 24 | + 'ssh-rsa #{test_key} vagrant', |
| 25 | + 'command="/bin/echo Hello",from="myhost.example.com,192.168.1.1" ssh-rsa #{test_key} vagrant2', |
| 26 | + 'ecdsa-sha2-nistp256 #{ecdsa_test_key} vagrant3', |
| 27 | + '[email protected] #{ecdsa_sk_test_key} vagrant4' |
| 28 | + ] |
| 29 | + } |
| 30 | +
|
16 | 31 | accounts::user { 'hunner': |
17 | 32 | groups => ['root'], |
18 | 33 | password => 'hi', |
|
22 | 37 | managevim => false, |
23 | 38 | bashrc_content => file('accounts/shell/bashrc'), |
24 | 39 | bash_profile_content => file('accounts/shell/bash_profile'), |
25 | | - sshkeys => [ |
26 | | - 'ssh-rsa #{test_key} vagrant', |
27 | | - 'command="/bin/echo Hello",from="myhost.example.com,192.168.1.1" ssh-rsa #{test_key} vagrant2', |
28 | | - 'ecdsa-sha2-nistp256 #{ecdsa_test_key} vagrant3', |
29 | | - '[email protected] #{ecdsa_sk_test_key} vagrant4' |
30 | | - ], |
| 40 | + sshkeys => $key_test, |
31 | 41 | } |
32 | 42 | PUPPETCODE |
33 | 43 |
|
|
45 | 55 | ensure => directory, |
46 | 56 | before => Accounts::User['hunner'], |
47 | 57 | } |
| 58 | + if $facts['puppetversion'][0] == '6' { |
| 59 | + $key_test = [ |
| 60 | + 'ssh-rsa #{test_key} vagrant', |
| 61 | + 'command="/bin/echo Hello",from="myhost.example.com,192.168.1.1" ssh-rsa #{test_key} vagrant2' |
| 62 | + ] |
| 63 | + } |
| 64 | + else { |
| 65 | + $key_test = [ |
| 66 | + 'ssh-rsa #{test_key} vagrant', |
| 67 | + 'command="/bin/echo Hello",from="myhost.example.com,192.168.1.1" ssh-rsa #{test_key} vagrant2', |
| 68 | + 'ecdsa-sha2-nistp256 #{ecdsa_test_key} vagrant3', |
| 69 | + '[email protected] #{ecdsa_sk_test_key} vagrant4' |
| 70 | + ] |
| 71 | + } |
| 72 | +
|
48 | 73 | accounts::user { 'hunner': |
49 | 74 | groups => ['root'], |
50 | 75 | password => 'hi', |
|
54 | 79 | managevim => true, |
55 | 80 | bashrc_content => file('accounts/shell/bashrc'), |
56 | 81 | bash_profile_content => file('accounts/shell/bash_profile'), |
57 | | - sshkeys => [ |
58 | | - 'ssh-rsa #{test_key} vagrant', |
59 | | - 'from="myhost.example.com,192.168.1.1" ssh-rsa #{test_key} vagrant2', |
60 | | - 'ecdsa-sha2-nistp256 #{ecdsa_test_key} vagrant3', |
61 | | - '[email protected] #{ecdsa_sk_test_key} vagrant4' |
62 | | - ], |
| 82 | + sshkeys => $key_test, |
63 | 83 | } |
64 | 84 | PUPPETCODE |
65 | 85 |
|
|
0 commit comments