anpassen von git ignore

This commit is contained in:
2026-01-29 18:41:59 +01:00
parent 85bcb598df
commit dc06ee04d3
13 changed files with 336 additions and 59 deletions

View File

@@ -0,0 +1,3 @@
---
classes:
- all_system

View File

@@ -0,0 +1,3 @@
---
classes:
- test

View File

@@ -0,0 +1,9 @@
version: 5
defaults:
datadir: data
data_hash: yaml_data
hierarchy:
- name: "Per-Node-Konfiguration (pro Server)"
path: "nodes/%{trusted.certname}.yaml"
- name: "Allgemeine Konfiguration (für alle)"
path: "common.yaml"

View File

@@ -4,7 +4,7 @@ class all_system {
owner => 'root',
group => 'root',
mode => '0644',
content => "<-----------------------Dieser Server wird zum Teil von Puppet verwaltet.----------------------->\n",
content => "<-----------------------Dieser Server wird zum Teil von Puppet verwaltet. Finger WEG !!!----------------------->\n",
}
@@ -23,6 +23,11 @@ class all_system {
}
schedule { 'weekly':
period => weekly,
repeat => 1,
}
case $facts['os']['name'] {
'CentOS', 'RedHat': {
# Configuration for RedHat-based systems
@@ -35,13 +40,16 @@ class all_system {
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'],
exec { 'apt-update-upgrade':
command => '/usr/bin/apt-get update && /usr/bin/apt-get -y upgrade',
provider => 'shell',
logoutput => 'on_failure',
schedule => 'weekly',
path => ['/usr/bin', '/bin'],
user => 'root',
group => 'root',
timeout => 0,
require => File['/usr/bin/apt-get'],
}
package { 'apache2':
ensure => 'present',
@@ -56,11 +64,6 @@ class all_system {
ensure => 'present',
provider => 'pacman',
}
# Configuration for Arch-based systems
schedule { 'weekly':
period => weekly,
repeat => 1,
}
# Führen Sie die Systemaktualisierung durch
exec { 'pacman-update':

View File

@@ -1,4 +1 @@
node default {
include all_system
}
lookup('classes', {merge => 'unique'}).include

View File

@@ -0,0 +1,30 @@
class test {
# Schleifen Loop möglichkeit 1
$dateinamen = [ 'datei_1.txt', 'datei_2.test' ]
$dateinamen.each |String $dateiname| {
file { "/tmp/${dateiname}":
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
content => "Dies ist eine Datei ${dateiname}\n"
}
}
# möglichkeit 2
$konfigurations_dateien = {
'/tmp/my_config' =>
"port=3306\nbind-address=127.0.0.1\n",
'/tmp/httpd.conf' =>
"Listen 80\nServerName localhost\n"
}
$konfigurations_dateien.each|String $pfad, String $inhalt| {
file { $pfad:
ensure => file,
content => $inhalt,
mode => '0640',
}
}
}