run super
This commit is contained in:
@@ -4,26 +4,79 @@ class all_system {
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
content => "Willkommen auf diesem Server von JonnyBravo ein neuer Nerd am Himmel DANIEL. Er wird von Puppet verwaltet.\n",
|
||||
content => "<-----------------------Dieser Server wird zum Teil von Puppet verwaltet.----------------------->\n",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class apt_upgrade {
|
||||
cron { 'apt_update_upgrade':
|
||||
command => '/usr/bin/apt-get update && /usr/bin/apt-get -y upgrade',
|
||||
user => 'root',
|
||||
weekday => 0, # 0 = Sonntag
|
||||
hour => '2',
|
||||
minute => '0',
|
||||
require => File['/usr/bin/apt-get'],
|
||||
user { 'jonnybravo':
|
||||
ensure => present, # Der Benutzer soll vorhanden sein
|
||||
managehome => true, # Stellt sicher, dass das Home-Verzeichnis erstellt wird
|
||||
purge_ssh_keys => true,
|
||||
shell => '/bin/fish', # Setzt die Standard-Shell für den Benutzer
|
||||
}
|
||||
|
||||
file { '/usr/bin/apt-get':
|
||||
ensure => 'file',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
ssh_authorized_key { 'jonnybravo_root':
|
||||
ensure => present,
|
||||
user => 'jonnybravo',
|
||||
type => 'ssh-rsa',
|
||||
key => 'AAAAB3NzaC1yc2EAAAADAQABAAABgQC0N6XKCM67FFpM0VRlEjZXIVROWNOPV1xDDA5VW4VAhe9II+rLnAg4KMNaJZgutANh1pQGh2Yv6SUPTmgjxi+uBv+HLNvJ41NWrPMH0w7XUSzvOXJbYx8GdebvhuurBiH+3kjyubE8YCq6xZHDqpuhZaZySc9AEp8QFgtN86jUD1U5pMpMKmw7tTLtZK9WWIktFzLjjqk+xnLHVsN4mS0VaJRWzLIqwI5AT38CMpuBTZEhY2ySORY0bUvEpxU6oqcNwHEJ3KLCOPZrtOtmUAo8s8NEN+cgxd6m9DkkU2x/jFVdnfNlfIG1Qk2XvkLPrakBy8czQvBsdlPoaRg+qawEl9PlE0p5G1fMbUKQjqSPUfcnkKjdQThOIU632Az3XnOQ4T9xXyXPzMwTRaI51uUnwCkIRKq3EuSG83PFTCPTMZ31P0mT9+Nm4lTAfzBbuO4rV58tPL4+zNe1HJt6pq+GI4Swe76xE588iWgFbCmJHKPHHOxDUnCK5afJwvs/4tE=',
|
||||
}
|
||||
|
||||
|
||||
case $facts['os']['name'] {
|
||||
'CentOS', 'RedHat': {
|
||||
# Configuration for RedHat-based systems
|
||||
}
|
||||
'Ubuntu', 'Debian': {
|
||||
# Configuration for Debian-based systems
|
||||
file { '/usr/bin/apt-get':
|
||||
ensure => 'file',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
}
|
||||
cron { 'apt_update_upgrade':
|
||||
command => '/usr/bin/apt-get update && /usr/bin/apt-get -y upgrade',
|
||||
user => 'root',
|
||||
weekday => 0, # 0 = Sonntag
|
||||
hour => '2',
|
||||
minute => '0',
|
||||
require => File['/usr/bin/apt-get'],
|
||||
}
|
||||
package { 'apache2':
|
||||
ensure => 'present',
|
||||
provider => 'apt',
|
||||
}
|
||||
}
|
||||
'Archlinux' : {
|
||||
# Configuration for Arch-based systems
|
||||
$basic_package_list = ['fish', 'tmux', 'python']
|
||||
|
||||
package { $basic_package_list:
|
||||
ensure => 'present',
|
||||
provider => 'pacman',
|
||||
}
|
||||
# Configuration for Arch-based systems
|
||||
schedule { 'weekly':
|
||||
period => weekly,
|
||||
repeat => 1,
|
||||
}
|
||||
|
||||
# Führen Sie die Systemaktualisierung durch
|
||||
exec { 'pacman-update':
|
||||
command => '/usr/bin/pacman -Syu --noconfirm',
|
||||
provider => 'shell',
|
||||
logoutput => 'on_failure',
|
||||
schedule => 'weekly',
|
||||
path => ['/usr/bin', '/bin'],
|
||||
user => 'root',
|
||||
group => 'root',
|
||||
timeout => 0,
|
||||
}
|
||||
}
|
||||
default: {
|
||||
fail("Unsupported operating system ${facts['os']['name']}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user