anpassen von git ignore
This commit is contained in:
3
code/environments/production/data/common.yaml
Normal file
3
code/environments/production/data/common.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
classes:
|
||||
- all_system
|
||||
3
code/environments/production/data/nodes/arch-2.lxd.yaml
Normal file
3
code/environments/production/data/nodes/arch-2.lxd.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
classes:
|
||||
- test
|
||||
9
code/environments/production/hiera.yaml
Normal file
9
code/environments/production/hiera.yaml
Normal 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"
|
||||
@@ -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':
|
||||
|
||||
@@ -1,4 +1 @@
|
||||
node default {
|
||||
include all_system
|
||||
|
||||
}
|
||||
lookup('classes', {merge => 'unique'}).include
|
||||
30
code/environments/production/manifests/test.pp
Normal file
30
code/environments/production/manifests/test.pp
Normal 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',
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user