diff --git a/Puppetfile b/Puppetfile index 3b9edb7..7633622 100644 --- a/Puppetfile +++ b/Puppetfile @@ -1,11 +1,10 @@ forge "http://forge.puppetlabs.com" -mod 'camptocamp/augeas', '0.0.1' mod 'hunner/wordpress', '0.6.0' mod 'jfryman/nginx', '0.0.9' mod 'puppetlabs/apache', '0.10.0' mod 'puppetlabs/firewall', '1.0.2' mod 'puppetlabs/mysql', '2.2.3' -mod 'saz/ssh', '1.2.0' +mod 'saz/ssh', '2.3.3' mod 'saz/sudo', '2.4.3' diff --git a/Puppetfile.lock b/Puppetfile.lock index d97d805..80f7013 100644 --- a/Puppetfile.lock +++ b/Puppetfile.lock @@ -1,7 +1,6 @@ FORGE remote: http://forge.puppetlabs.com specs: - camptocamp/augeas (0.0.1) hunner/wordpress (0.6.0) puppetlabs/concat (>= 1.0.0) puppetlabs/mysql (>= 2.1.0) @@ -21,17 +20,16 @@ FORGE puppetlabs/mysql (2.2.3) puppetlabs/stdlib (>= 3.2.0) puppetlabs/stdlib (4.1.0) - saz/ssh (1.2.0) + saz/ssh (2.3.3) puppetlabs/stdlib (>= 2.2.1) saz/sudo (2.4.3) DEPENDENCIES - camptocamp/augeas (= 0.0.1) hunner/wordpress (= 0.6.0) jfryman/nginx (= 0.0.9) puppetlabs/apache (= 0.10.0) puppetlabs/firewall (= 1.0.2) puppetlabs/mysql (= 2.2.3) - saz/ssh (= 1.2.0) + saz/ssh (= 2.3.3) saz/sudo (= 2.4.3) diff --git a/manifests/final.pp b/manifests/final.pp index a4e6c55..1acfeaa 100644 --- a/manifests/final.pp +++ b/manifests/final.pp @@ -8,15 +8,15 @@ user { 'jeff': password => '$6$.AURF9sE09Q$..S10CFY7G.AVXzSW//w6GoV6yPzBzdvyUl8a7oyYbW/XzBU.o6AdHxTgTkCSWb64zmN3QoKovoUyLJhE/MFP/', } -# Logging in with the root user must be disabled -include augeas class { '::ssh::server': - require => Class['augeas'], + storeconfigs_enabled => false, + options => { + # Logging in with the root user must be disabled + 'PermitRootLogin' => 'no', + # SSH must be enabled on a non-standard port + 'Port' => [22984], + }, } -ssh::server::configline { 'PermitRootLogin': value => 'no' } - -# SSH must be enabled on a non-standard port -ssh::server::configline { 'Port': value => '22984' } # Install a working MySQL server class { '::mysql::server': } diff --git a/manifests/site.pp b/manifests/site.pp index cc117d4..97e1ffc 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -65,8 +65,21 @@ package { 'mailutils': } include augeas include sudo +ssh::server::configline { 'Port': value => '22984' } +ssh::server::configline { 'PermitRootLogin': value => 'no' } +ssh::server::configline { 'PasswordAuthentication': value => 'yes' } +ssh::server::configline { 'AllowUsers/1': value => 'atomaka' } +ssh::server::configline { 'AllowUsers/2': value => 'jeff' } + class { '::ssh::server': - require => Class['augeas'], + storeconfigs_enabled => false, + options => { + 'Port' => [22984], + 'PermitRootLogin' => 'no', + 'PasswordAuthentication' => 'yes', + 'AllowUsers/1' => 'atomaka', + 'AllowUsers/2' => 'jeff', + }, } class { '::apache': @@ -87,12 +100,6 @@ class { '::wordpress': } # CONFIGURATIONS -ssh::server::configline { 'Port': value => '22984' } -ssh::server::configline { 'PermitRootLogin': value => 'no' } -ssh::server::configline { 'PasswordAuthentication': value => 'yes' } -ssh::server::configline { 'AllowUsers/1': value => 'atomaka' } -ssh::server::configline { 'AllowUsers/2': value => 'jeff' } - sudo::conf { 'sudo': priority => 10, content => "%sudo ALL=(ALL) NOPASSWD: ALL\n",