commit 967226295ede7c68c7363d0637f538ad8a900e45 Author: Your Name Date: Tue Nov 18 21:02:59 2025 +0100 init diff --git a/motd.pp b/motd.pp new file mode 100644 index 0000000..38de311 --- /dev/null +++ b/motd.pp @@ -0,0 +1,31 @@ +# motd.pp + +class modt { + file { '/etc/motd': + ensure => 'file', + owner => 'root', + group => 'root', + mode => '0644', + content => "Willkommen auf diesem Server. Er wird 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'], + } + + file { '/usr/bin/apt-get': + ensure => 'file', + owner => 'root', + group => 'root', + mode => '0755', + } +} diff --git a/nginx.pp b/nginx.pp new file mode 100644 index 0000000..b56a604 --- /dev/null +++ b/nginx.pp @@ -0,0 +1,713 @@ +class nginx { + + # 1. Software-Pakete sicherstellen + # Eine Liste von Paketen, die installiert sein sollen. + $packages = [ +adduser, +apparmor, +apport, +apport-symptoms, +apt, +apt-utils, +augeas-lenses, +base-files, +base-passwd, +bash, +bash-completion, +bc, +bcache-tools, +bind9-dnsutils, +bind9-host, +bind9-libs, +binutils, +binutils-common, +binutils-x86-64-linux-gnu, +bolt, +bsdextrautils, +bsdutils, +btrfs-progs, +build-essential, +busybox-initramfs, +busybox-static, +byobu, +bzip2, +ca-certificates, +cloud-guest-utils, +cloud-init, +cloud-initramfs-copymods, +cloud-initramfs-dyn-netconf, +command-not-found, +console-setup, +console-setup-linux, +coreutils, +cpio, +cpp, +cpp-11, +cron, +cryptsetup, +cryptsetup-bin, +cryptsetup-initramfs, +curl, +dash, +dbus, +dbus-user-session, +debconf, +debconf-i18n, +debconf-utils, +debianutils, +diffutils, +dirmngr, +distro-info, +distro-info-data, +dmeventd, +dmidecode, +dmsetup, +dosfstools, +dpkg, +dpkg-dev, +e2fsprogs, +eatmydata, +ed, +eject, +ethtool, +facter, +fakeroot, +fdisk, +file, +finalrd, +findutils, +fontconfig-config, +fonts-dejavu-core, +fonts-lato, +fonts-ubuntu-console, +friendly-recovery, +ftp, +fuse3, +fwupd-signed, +'g++', +'g++-11', +gawk, +gcc, +gcc-11, +gcc-11-base, +gcc-12-base, +gdisk, +gettext-base, +'gir1.2-glib-2.0', +'gir1.2-packagekitglib-1.0', +git, +git-man, +gnupg, +gnupg-l10n, +gnupg-utils, +gpg, +gpg-agent, +gpg-wks-client, +gpg-wks-server, +gpgconf, +gpgsm, +gpgv, +grep, +groff-base, +gzip, +hdparm, +hiera, +hostname, +htop, +info, +init, +init-system-helpers, +initramfs-tools, +initramfs-tools-bin, +initramfs-tools-core, +install-info, +iproute2, +iptables, +iputils-ping, +iputils-tracepath, +irqbalance, +isc-dhcp-client, +isc-dhcp-common, +iso-codes, +javascript-common, +kbd, +keyboard-configuration, +klibc-utils, +kmod, +kpartx, +landscape-common, +less, +libacl1, +libaio1, +libalgorithm-diff-perl, +libalgorithm-diff-xs-perl, +libalgorithm-merge-perl, +libapparmor1, +libappstream4, +'libapt-pkg6.0', +libarchive13, +libargon2-1, +libasan6, +libassuan0, +libatasmart4, +libatm1, +libatomic1, +libattr1, +libaudit-common, +libaudit1, +libaugeas0, +libbinutils, +libblkid1, +libblockdev-crypto2, +libblockdev-fs2, +libblockdev-loop2, +libblockdev-part-err2, +libblockdev-part2, +libblockdev-swap2, +libblockdev-utils2, +libblockdev2, +'libboost-filesystem1.74.0', +'libboost-locale1.74.0', +'libboost-log1.74.0', +'libboost-nowide1.74.0', +'libboost-program-options1.74.0', +'libboost-regex1.74.0', +'libboost-thread1.74.0', +libbpf0, +libbrotli1, +libbsd0, +'libbz2-1.0', +libc-bin, +libc-dev-bin, +libc-devtools, +libc6, +libc6-dev, +libcap-ng0, +libcap2, +libcap2-bin, +'libcbor0.8', +libcc1-0, +libcom-err2, +'libcpp-hocon0.3.0', +libcrypt-dev, +libcrypt1, +libcryptsetup12, +libctf-nobfd0, +libctf0, +libcurl3-gnutls, +libcurl4, +'libdb5.3', +libdbus-1-3, +libdebconfclient0, +libdeflate0, +'libdevmapper-event1.02.1', +'libdevmapper1.02.1', +libdns-export1110, +libdpkg-perl, +libdrm-common, +libdrm2, +libdw1, +libeatmydata1, +libedit2, +libefiboot1, +libefivar1, +libelf1, +liberror-perl, +libestr0, +'libevent-core-2.1-7', +libexpat1, +libext2fs2, +'libfacter3.14.12', +libfakeroot, +libfastjson4, +libfdisk1, +libffi8, +libfido2-1, +libfile-fcntllock-perl, +libflashrom1, +libfontconfig1, +libfreetype6, +libfribidi0, +libftdi1-2, +libfuse3-3, +libfwupd2, +libfwupdplugin5, +'libgcab-1.0-0', +libgcc-11-dev, +libgcc-s1, +libgcrypt20, +libgd3, +libgdbm-compat4, +libgdbm6, +'libgirepository-1.0-1', +'libglib2.0-0', +'libglib2.0-bin', +'libglib2.0-data', +libgmp10, +libgnutls30, +libgomp1, +libgpg-error0, +libgpgme11, +libgpm2, +libgssapi-krb5-2, +'libgstreamer1.0-0', +'libgudev-1.0-0', +libgusb2, +libhogweed6, +libicu70, +libidn2-0, +libinih1, +libintl-perl, +libintl-xs-perl, +libip4tc2, +libip6tc2, +libisc-export1105, +libisl23, +libisns0, +libitm1, +libjansson4, +libjbig0, +libjcat1, +libjpeg-turbo8, +libjpeg8, +libjs-jquery, +libjson-c5, +'libjson-glib-1.0-0', +'libjson-glib-1.0-common', +libk5crypto3, +libkeyutils1, +libklibc, +libkmod2, +libkrb5-3, +libkrb5support0, +libksba8, +'libldap-2.5-0', +libldap-common, +'libleatherman1.12.1', +liblmdb0, +liblocale-gettext-perl, +liblsan0, +'liblvm2cmd2.03', +liblz4-1, +liblzma5, +liblzo2-2, +libmagic-mgc, +libmagic1, +libmaxminddb0, +libmbim-glib4, +libmbim-proxy, +libmd0, +libmm-glib0, +libmnl0, +libmodule-find-perl, +libmodule-scandeps-perl, +libmount1, +libmpc3, +libmpdec3, +libmpfr6, +libmspack0, +libncurses6, +libncursesw6, +libnetfilter-conntrack3, +libnetplan0, +libnettle8, +'libnewt0.52', +libnfnetlink0, +libnftables1, +libnftnl11, +libnghttp2-14, +libnginx-mod-http-geoip2, +libnginx-mod-http-image-filter, +libnginx-mod-http-xslt-filter, +libnginx-mod-mail, +libnginx-mod-stream, +libnginx-mod-stream-geoip2, +libnl-3-200, +libnl-genl-3-200, +libnpth0, +libnsl-dev, +libnsl2, +libnspr4, +libnss-systemd, +libnss3, +libntfs-3g89, +libnuma1, +libopeniscsiusr, +libp11-kit0, +libpackagekit-glib2-18, +libpam-cap, +libpam-modules, +libpam-modules-bin, +libpam-runtime, +libpam-systemd, +libpam0g, +libparted-fs-resize0, +libparted2, +'libpcap0.8', +libpci3, +libpcre2-8-0, +libpcre3, +'libperl5.34', +libpipeline1, +libplymouth5, +libpng16-16, +libpolkit-agent-1-0, +libpolkit-gobject-1-0, +libpopt0, +libproc-processtable-perl, +libprocps8, +libpsl5, +libpython2-stdlib, +'libpython2.7-minimal', +'libpython2.7-stdlib', +'libpython3-stdlib', +'libpython3.10', +'libpython3.10-minimal', +'libpython3.10-stdlib', +libqmi-glib5, +libqmi-proxy, +libquadmath0, +libreadline8, +librtmp1, +'libruby3.0', +libsasl2-2, +libsasl2-modules, +libsasl2-modules-db, +libseccomp2, +libselinux1, +libsemanage-common, +libsemanage2, +libsepol2, +libsgutils2-2, +libsigsegv2, +libslang2, +libsmartcols1, +libsmbios-c2, +libsodium23, +libsort-naturally-perl, +libsqlite3-0, +libss2, +libssh-4, +libssl3, +'libstdc++-11-dev', +'libstdc++6', +libstemmer0d, +libsystemd0, +libtasn1-6, +'libtcl8.6', +libterm-readkey-perl, +libtext-charwidth-perl, +libtext-iconv-perl, +libtext-wrapi18n-perl, +libtiff5, +libtinfo6, +libtirpc-common, +libtirpc-dev, +libtirpc3, +libtsan0, +'libtss2-esys-3.0.2-0', +libtss2-mu0, +libtss2-sys1, +libtss2-tcti-cmd0, +libtss2-tcti-device0, +libtss2-tcti-mssim0, +libtss2-tcti-swtpm0, +libubsan1, +libuchardet0, +libudev1, +libudisks2-0, +libunistring2, +libunwind8, +liburcu8, +'libusb-1.0-0', +libutempter0, +libuuid1, +libuv1, +libvolume-key1, +libwebp7, +libwrap0, +libx11-6, +libx11-data, +libxau6, +libxcb1, +libxdmcp6, +libxext6, +libxml2, +libxmlb2, +libxmlsec1, +libxmlsec1-openssl, +libxmuu1, +libxpm4, +'libxslt1.1', +libxtables12, +libxxhash0, +libyaml-0-2, +'libyaml-cpp0.7', +libzstd1, +linux-base, +linux-libc-dev, +locales, +login, +logrotate, +logsave, +lsb-base, +lsb-release, +lshw, +lsof, +lto-disabled-list, +lvm2, +lxd-agent-loader, +make, +man-db, +manpages, +manpages-dev, +mawk, +mdadm, +media-types, +motd-news-config, +mount, +mtr-tiny, +multipath-tools, +nano, +ncurses-base, +ncurses-bin, +ncurses-term, +needrestart, +netbase, +netcat-openbsd, +'netplan.io', +networkd-dispatcher, +nftables, +nginx, +nginx-common, +nginx-core, +ntfs-3g, +open-iscsi, +open-vm-tools, +openssh-client, +openssh-server, +openssh-sftp-server, +openssl, +overlayroot, +packagekit, +packagekit-tools, +parted, +passwd, +pastebinit, +patch, +'pci.ids', +pciutils, +perl, +perl-base, +'perl-modules-5.34', +pinentry-curses, +pkexec, +plymouth, +plymouth-theme-ubuntu-text, +policykit-1, +polkitd, +pollinate, +powermgmt-base, +procps, +psmisc, +publicsuffix, +puppet, +python-apt-common, +python-babel-localedata, +python-pip, +python-pkg-resources, +python-setuptools, +python2, +python2-minimal, +'python2.7', +'python2.7-minimal', +python3, +python3-apport, +python3-apt, +python3-attr, +python3-automat, +python3-babel, +python3-bcrypt, +python3-blinker, +python3-certifi, +python3-cffi-backend, +python3-chardet, +python3-click, +python3-colorama, +python3-commandnotfound, +python3-configobj, +python3-constantly, +python3-cryptography, +python3-dbus, +python3-debconf, +python3-debian, +python3-distro, +python3-distro-info, +python3-distupgrade, +python3-distutils, +python3-gdbm, +python3-gi, +python3-hamcrest, +python3-httplib2, +python3-hyperlink, +python3-idna, +python3-importlib-metadata, +python3-incremental, +python3-jeepney, +python3-jinja2, +python3-json-pointer, +python3-jsonpatch, +python3-jsonschema, +python3-jwt, +python3-keyring, +python3-launchpadlib, +'python3-lazr.restfulclient', +'python3-lazr.uri', +python3-lib2to3, +python3-magic, +python3-markupsafe, +python3-minimal, +python3-more-itertools, +python3-netifaces, +python3-newt, +python3-oauthlib, +python3-openssl, +python3-packaging, +python3-pexpect, +python3-pkg-resources, +python3-problem-report, +python3-ptyprocess, +python3-pyasn1, +python3-pyasn1-modules, +python3-pyparsing, +python3-pyrsistent, +python3-requests, +python3-secretstorage, +python3-serial, +python3-service-identity, +python3-setuptools, +python3-six, +python3-software-properties, +python3-systemd, +python3-twisted, +python3-tz, +python3-update-manager, +python3-urllib3, +python3-wadllib, +python3-yaml, +python3-zipp, +'python3-zope.interface', +'python3.10', +'python3.10-minimal', +rake, +readline-common, +rpcsvc-proto, +rsync, +rsyslog, +ruby, +ruby-augeas, +ruby-deep-merge, +ruby-net-telnet, +ruby-rbtree, +ruby-rubygems, +ruby-selinux, +ruby-shadow, +ruby-sorted-set, +ruby-webrick, +ruby-xmlrpc, +'ruby3.0', +rubygems-integration, +run-one, +sbsigntool, +screen, +secureboot-db, +sed, +sensible-utils, +sg3-utils, +sg3-utils-udev, +shared-mime-info, +snapd, +software-properties-common, +sosreport, +squashfs-tools, +ssh-import-id, +strace, +sudo, +systemd, +systemd-hwe-hwdb, +systemd-sysv, +systemd-timesyncd, +sysvinit-utils, +tar, +tcl, +'tcl8.6', +tcpdump, +telnet, +thin-provisioning-tools, +time, +tmux, +tnftp, +tpm-udev, +tzdata, +ubuntu-advantage-tools, +ubuntu-keyring, +ubuntu-minimal, +ubuntu-pro-client, +ubuntu-pro-client-l10n, +ubuntu-release-upgrader-core, +ubuntu-server, +ubuntu-standard, +ucf, +udev, +ufw, +unattended-upgrades, +unzip, +update-manager-core, +update-notifier-common, +usb-modeswitch, +usb-modeswitch-data, +'usb.ids', +usbutils, +usrmerge, +util-linux, +uuid-runtime, +vim, +vim-common, +vim-runtime, +vim-tiny, +wget, +whiptail, +xauth, +xdg-user-dirs, +xfsprogs, +xkb-data, +xxd, +xz-utils, +zerofree, +zip, +zlib1g, +zstd, + ] + + package { $packages: + ensure => 'installed', + } + + # 2. Dienst-Zustand sicherstellen + # Stellt sicher, dass der nginx-Dienst läuft. + service { 'nginx': + ensure => 'running', + enable => true, + require => Package['nginx'], + } + + # 3. index.html-Datei erstellen und verwalten + file { '/var/www/html/index.html': + ensure => 'file', + owner => 'www-data', + group => 'www-data', + mode => '0644', + content => "

Hello World

\n

Diese Seite wird von Puppet verwaltet.

\n", + require => Package['nginx'], + } +} diff --git a/site.pp b/site.pp new file mode 100644 index 0000000..7d9d56c --- /dev/null +++ b/site.pp @@ -0,0 +1,21 @@ +# Beispiel für eine simple site.pp +node 'debian-1.lxd' { + # Konfigurationen, die nur für diesen Node gelten + include modt +} + +node 'ubuntu-2.lxd' { + + include nginx + include modt + resources { + 'package': + purge => true, + } +} + +node default { + include modt + include apt_upgrade + +}