Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Apress
committed
Oct 11, 2016
0 parents
commit acc6639
Showing
53 changed files
with
2,453 additions
and
0 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class administrators inherits virt_users { | ||
realize( | ||
Group["administration"] | ||
) | ||
User["jsmith"] { groups => "administration" } | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
class baseapps { | ||
|
||
$packagelist = ["joe", "perl", "rubygems"] | ||
|
||
package { $packagelist: | ||
ensure => installed } | ||
} | ||
|
||
class sshd { | ||
|
||
case $operatingsystem { | ||
fedora: { $ssh_packages = ["openssh", "openssh-server", "openssh-clients"] } | ||
debian: { $ssh_packages = ["openssh-server", "openssh-client"] } | ||
default: { $ssh_packages = ["openssh", "openssh-server"] } | ||
} | ||
|
||
package { $ssh_packages: ensure => installed } | ||
|
||
service { sshd: | ||
name => $operatingsystem ? { | ||
fedora => "sshd", | ||
debian => "ssh", | ||
default => "sshd", | ||
}, | ||
enable => true, | ||
ensure => running | ||
} | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class mail_team inherits virt_users { | ||
realize( | ||
Group["mail_team"] | ||
) | ||
User["mjones"] { groups => "mail_team" } | ||
} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class staff { | ||
include virt_users, virt_groups | ||
realize( | ||
Group["staff"], | ||
Group["administration"], | ||
User["jsmith"], | ||
User["mjones"] | ||
) | ||
} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class mysql_group { | ||
group { "mysql": | ||
gid => "501", | ||
ensure => present | ||
} | ||
} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class virt_groups { | ||
@group { "staff": | ||
gid => "1000", | ||
ensure => present, | ||
} | ||
|
||
@group { "administration": | ||
gid => "1501", | ||
ensure => present, | ||
} | ||
|
||
@group { "mail_team": | ||
gid => "1502", | ||
ensure => present, | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
node 'puppetmaster.testing.com' inherits basenode {} | ||
node 'www.testing.com' inherits webserver { | ||
virtual_host { "test1.testing.com": | ||
ip => "192.168.0.1" | ||
} | ||
virtual_host { "test2.testing.com": | ||
ip => "192.168.0.2" | ||
} | ||
} | ||
node 'db.testing.com' inherits dbserver {} | ||
node 'mail.testing.com' inherits mailserver {} | ||
|
||
|
||
node 'debian.lovedthanlost.net' inherits mailserver {} | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class debian { | ||
|
||
$disableservices = ["hplip", "avahi-daemon", "rsync", "spamassassin"] | ||
|
||
service { $disableservices: | ||
enable => false, | ||
ensure => stopped, | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class fedora { | ||
|
||
yumrepo { "testing.com-repo": | ||
baseurl => "http://repos.testing.com/fedora/$lsbdistrelease/", | ||
descr => "Testing.com's YUM repository", | ||
enabled => 1, | ||
gpgcheck => 0, | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import "templates.pp" | ||
import "nodes.pp" | ||
import "groups/*" | ||
import "users/*" | ||
import "os/*" | ||
import "classes/*" | ||
|
||
|
||
filebucket { main: server => puppet } | ||
File { backup => main } |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
node basenode { | ||
case $operatingsystem { | ||
fedora: { include fedora } | ||
debian: { include debian } | ||
default: { include fedora} | ||
} | ||
# include baseapps, sshd, | ||
include staff, administrators | ||
} | ||
|
||
node default inherits basenode {} | ||
|
||
node webserver inherits basenode { | ||
include apache | ||
} | ||
node dbserver inherits basenode { | ||
include mysql | ||
} | ||
node mailserver inherits basenode { | ||
# include postfix | ||
include mail_team | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class mysql_user { | ||
user { "mysql": | ||
ensure => "present", | ||
uid => "501", | ||
gid => "501", | ||
comment => "MySQL", | ||
home => "/var/lib/mysql", | ||
shell => "/sbin/nologin", | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
class virt_users { | ||
@user { "jsmith": | ||
ensure => "present", | ||
uid => "1001", | ||
gid => "1000", | ||
comment => "Jane Smith", | ||
home => "/nfs/IT/home/jsmith", | ||
shell => "/bin/bash", | ||
} | ||
|
||
@user { "mjones": | ||
ensure => "present", | ||
uid => "1002", | ||
gid => "1000", | ||
comment => "Mary Jones", | ||
home => "/nfs/IT/home/mjones", | ||
shell => "/bin/bash", | ||
} | ||
} |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.