|
5 | 5 | test_key = 'AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8Hfd'\ |
6 | 6 | 'OV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9W'\ |
7 | 7 | 'hQ==' |
| 8 | +ecdsa_test_key = 'AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBNlpEm6+RwCiQXgQAb0P1asEAxCJDVtm/YYyUbdSifCbri98fjs1C/03pm9yLRQ0W/S70S8AhDCMjVFA07WzjOQ=' |
| 9 | +ecdsa_sk_test_key = 'AAAAInNrLWVjZHNhLXNoYTItbmlzdHAyNTZAb3BlbnNzaC5jb20AAAAIbmlzdHAyNTYAAABBBAjkGvdKC05udQc82xGWWSKHbmJyBoa/oCq+2FiU6udqQyx0uOEC3YZAjvygBSdIo5vCpDELqJxaNQGQEkeUyYYAAAAEc3NoOg==' |
8 | 10 |
|
9 | 11 | pp_accounts_define = <<-PUPPETCODE |
10 | 12 | file { '/test': |
11 | 13 | ensure => directory, |
12 | 14 | before => Accounts::User['hunner'], |
13 | 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 | +
|
14 | 31 | accounts::user { 'hunner': |
15 | 32 | groups => ['root'], |
16 | 33 | password => 'hi', |
|
20 | 37 | managevim => false, |
21 | 38 | bashrc_content => file('accounts/shell/bashrc'), |
22 | 39 | bash_profile_content => file('accounts/shell/bash_profile'), |
23 | | - sshkeys => [ |
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 | | - ], |
| 40 | + sshkeys => $key_test, |
27 | 41 | } |
28 | 42 | PUPPETCODE |
29 | 43 |
|
|
41 | 55 | ensure => directory, |
42 | 56 | before => Accounts::User['hunner'], |
43 | 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 | +
|
44 | 73 | accounts::user { 'hunner': |
45 | 74 | groups => ['root'], |
46 | 75 | password => 'hi', |
|
50 | 79 | managevim => true, |
51 | 80 | bashrc_content => file('accounts/shell/bashrc'), |
52 | 81 | bash_profile_content => file('accounts/shell/bash_profile'), |
53 | | - sshkeys => [ |
54 | | - 'ssh-rsa #{test_key} vagrant', |
55 | | - 'from="myhost.example.com,192.168.1.1" ssh-rsa #{test_key} vagrant2' |
56 | | - ], |
| 82 | + sshkeys => $key_test, |
57 | 83 | } |
58 | 84 | PUPPETCODE |
59 | 85 |
|
|
0 commit comments