add basic structure

This commit is contained in:
Arne Teuke
2025-06-02 17:03:06 +02:00
parent c8d99f045e
commit 2bc5d9a1aa
8 changed files with 154 additions and 4 deletions

7
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,7 @@
{
"cSpell.words": [
"debuglevel",
"notifyonly",
"Ssendwait"
]
}

View File

@@ -1,4 +1,4 @@
## automatic_cd::config.pp
## automatic_cd::main::config.pp
# Module name: automatic_cd
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages module logic for the automatic_cd module
@@ -6,5 +6,5 @@
class automatic_cd::main::config (
) inherits automatic_cd::params {
include automatic_cd::main::install
include automatic_cd::main::service
}

10
manifests/main/dirs.pp Normal file
View File

@@ -0,0 +1,10 @@
## automatic_cd::main::dirs.pp
# Module name: automatic_cd
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages dirs for the automatic_cd module
##############################################################################
class automatic_cd::main::dirs (
) inherits automatic_cd::params {
require automatic_cd::main::install
}

10
manifests/main/files.pp Normal file
View File

@@ -0,0 +1,10 @@
## automatic_cd::main::files.pp
# Module name: automatic_cd
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages files for the automatic_cd module
##############################################################################
class automatic_cd::main::files (
) inherits automatic_cd::params {
require automatic_cd::main::dirs
}

View File

@@ -1,4 +1,4 @@
## automatic_cd::install.pp
## automatic_cd::main::install.pp
# Module name: automatic_cd
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages installation section for the automatic_cd module

17
manifests/main/service.pp Normal file
View File

@@ -0,0 +1,17 @@
## automatic_cd::main::service.pp
# Module name: automatic_cd
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages services for the automatic_cd module
##############################################################################
class automatic_cd::main::service (
) inherits automatic_cd::params {
require automatic_cd::main::files
service { $ac_service:
ensure => running,
hasstatus => true,
hasrestart => true,
enable => true,
}
}

View File

@@ -8,9 +8,18 @@
class automatic_cd::params (
String $reqpackages = 'dnf-automatic',
String $pkg_ensure = 'latest',
String $pkg_ensure = 'latest',
) {
# Facts
$fqdn = $facts['networking']['fqdn']
$domain = $facts['networking']['domain']
$os_name = $facts['os']['name']
$os_release = $facts['os']['release']['major']
# Service
$ac_service = 'dnf-automatic.timer'
# includes must be last
include automatic_cd::main::config
}

View File

@@ -0,0 +1,97 @@
###############################################################################
### automatic.conf managed by Puppet. Manual changes will be overwritten! ###
###############################################################################
[commands]
# What kind of upgrade to perform:
# default = all available upgrades
# security = only the security upgrades
upgrade_type = default
random_sleep = 0
# Maximum time in seconds to wait until the system is on-line and able to
# connect to remote repositories.
network_online_timeout = 60
# To just receive updates use dnf-automatic-notifyonly.timer
# Whether updates should be downloaded when they are available, by
# dnf-automatic.timer. notifyonly.timer, download.timer and
# install.timer override this setting.
download_updates = yes
# Whether updates should be applied when they are available, by
# dnf-automatic.timer. notifyonly.timer, download.timer and
# install.timer override this setting.
apply_updates = no
# When the system should reboot following upgrades:
# never = don't reboot after upgrades
# when-changed = reboot after any changes
# when-needed = reboot when necessary to apply changes
reboot = never
# The command that is run to trigger a system reboot.
reboot_command = "shutdown -r +5 'Rebooting after applying package updates'"
[emitters]
# Name to use for this system in messages that are emitted. Default is the
# hostname.
# system_name = my-host
# How to send messages. Valid options are stdio, email and motd. If
# emit_via includes stdio, messages will be sent to stdout; this is useful
# to have cron send the messages. If emit_via includes email, this
# program will send email itself according to the configured options.
# If emit_via includes motd, /etc/motd file will have the messages. if
# emit_via includes command_email, then messages will be send via a shell
# command compatible with sendmail.
# Default is email,stdio.
# If emit_via is None or left blank, no messages will be sent.
emit_via = stdio
[email]
# The address to send email messages from.
email_from = root@example.com
# List of addresses to send messages to.
email_to = root
# Name of the host to connect to to send email messages.
email_host = localhost
[command]
# The shell command to execute. This is a Python format string, as used in
# str.format(). The format function will pass a shell-quoted argument called
# `body`.
# command_format = "cat"
# The contents of stdin to pass to the command. It is a format string with the
# same arguments as `command_format`.
# stdin_format = "{body}"
[command_email]
# The shell command to use to send email. This is a Python format string,
# as used in str.format(). The format function will pass shell-quoted arguments
# called body, subject, email_from, email_to.
# command_format = "mail -Ssendwait -s {subject} -r {email_from} {email_to}"
# The contents of stdin to pass to the command. It is a format string with the
# same arguments as `command_format`.
# stdin_format = "{body}"
# The address to send email messages from.
email_from = root@example.com
# List of addresses to send messages to.
email_to = root
[base]
# This section overrides dnf.conf
# Use this to filter DNF core messages
debuglevel = 1