Created
January 26, 2014 10:31
-
-
Save php-coder/8630975 to your computer and use it in GitHub Desktop.
Setting up a server with Puppet: part I (http://slava-semushin.blogspot.ru/2014/01/provisioning-with-puppet-step-1.html)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class my::server { | |
include my::server::user | |
include my::server::sudo | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class my::server::sudo { | |
$sudo_package = 'sudo' | |
$user_login = 'coder' | |
package { $sudo_package: | |
ensure => 'installed' | |
} | |
file { "/etc/sudoers.d/01_${user_login}": | |
ensure => 'file', | |
content => "${user_login} ALL=(ALL) NOPASSWD: ALL\n", | |
owner => 'root', | |
group => 'root', | |
mode => '0440', | |
require => [ | |
Package[$sudo_package], | |
Class['my::server::user'] | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment