28 Commits

Author SHA1 Message Date
d6ced582d2 add option to allow excluding binaries from being upgraded 2026-04-30 11:49:16 +02:00
c4a63073f8 add deepwiki badge 2026-03-31 15:48:49 +02:00
cfd45de3d8 OP#547 update Readme 2026-03-30 14:18:06 +02:00
aae0f70464 OP#547 update Readme 2026-03-30 13:54:12 +02:00
9ff9365542 OP#547 update Readme 2026-03-30 13:49:38 +02:00
bb7ee6e887 OP#547 revert array to string 2026-03-29 16:38:22 +02:00
b318fdd26c OP#547 change string to array 2026-03-29 16:29:35 +02:00
538bd8ef5a OP#547 remove unwanted things from git 2026-03-29 16:03:32 +02:00
Jenkins
668c4ab2f8 Merge branch 'jenkins-build-1' into 'master'
Auto-merge for build 1

See merge request puppet/confdroid_automatic!1
2026-03-29 13:55:28 +00:00
Jenkins Server
ef418556d3 Recommit for updates in build 1 2026-03-29 15:55:19 +02:00
b2f6565b29 OP#547 initial commit after forking 2026-03-29 15:55:19 +02:00
Jenkins
1160e843d2 Merge branch 'jenkins-build-12' into 'master'
Auto-merge for build 12

See merge request puppet/automatic_cd!1
2025-08-18 02:30:25 +00:00
Jenkins Server
8c3fe53ee3 Recommit for updates in build 12 2025-06-05 16:41:51 +02:00
Jenkins Server
15ba510e09 Merge remote-tracking branch 'origin/master' into jenkins-build-12 2025-06-05 16:41:13 +02:00
Arne Teuke
991ff23f0e add new MR approach 2025-06-05 16:40:55 +02:00
Jenkins Server
87b0365edf Recommit for updates in build 11 2025-06-03 17:15:41 +02:00
Jenkins Server
1ad2b5179e Merge remote-tracking branch 'origin/master' into jenkins-build-11 2025-06-03 17:15:02 +02:00
Jenkins Server
b3df110b36 Recommit for updates in build 10 2025-06-03 17:04:08 +02:00
Jenkins Server
653aba91ee Merge remote-tracking branch 'origin/master' into jenkins-build-10 2025-06-03 17:03:32 +02:00
Jenkins Server
475b12e640 Recommit for updates in build 8 2025-06-03 16:39:44 +02:00
Jenkins Server
cc74d3fc9b Merge remote-tracking branch 'origin/master' into jenkins-build-8 2025-06-03 16:39:08 +02:00
Jenkins Server
1b91e8c190 Recommit for updates in build 7 2025-06-03 16:17:48 +02:00
Jenkins Server
60a148c323 Merge remote-tracking branch 'origin/master' into jenkins-build-7 2025-06-03 16:17:13 +02:00
Jenkins Server
b4b7ff7e23 Recommit for updates in build 6 2025-06-02 17:03:58 +02:00
Jenkins Server
211ef92773 Merge remote-tracking branch 'origin/master' into jenkins-build-6 2025-06-02 17:03:22 +02:00
Jenkins Server
53a2612e28 Recommit for updates in build 5 2025-06-02 16:43:12 +02:00
Jenkins Server
eae61cb610 Merge remote-tracking branch 'origin/master' into jenkins-build-5 2025-06-02 16:42:42 +02:00
Jenkins Server
f222d88084 Recommit for updates in build 3 2025-06-02 16:29:44 +02:00
12 changed files with 164 additions and 89 deletions

7
.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
.yardoc
Gemfile.lock
FileList
.scannerwork
.vscode
.puppet-lint.rc
.rspec

View File

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

40
Jenkinsfile vendored
View File

@@ -1,7 +1,5 @@
pipeline {
agent {
label 'puppet'
}
agent any
post {
always {
@@ -69,7 +67,7 @@ pipeline {
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
sh '''
/opt/sonar-scanner/bin/sonar-scanner \
-Dsonar.projectKey=automatic_cd \
-Dsonar.projectKey=confdroid_automatic \
-Dsonar.sources=. \
-Dsonar.host.url=https://sonarqube.confdroid.com \
-Dsonar.token=$SONAR_TOKEN
@@ -90,11 +88,43 @@ pipeline {
sh '''
git config user.name "Jenkins Server"
git config user.email jenkins@confdroid.com
git rm -r --cached .vscode || echo "No .vscode to remove from git"
git commit --amend --no-edit --allow-empty
git add -A && git commit -am "Recommit for updates in build $BUILD_NUMBER" || echo "No changes to commit"
git push origin HEAD:master
git push -o merge_request.create \
-o merge_request.target=master \
-o merge_request.title="Auto-merge for build $BUILD_NUMBER" \
-o merge_request.description="Automated changes from Jenkins build $BUILD_NUMBER" \
-o merge_request.merge_when_pipeline_succeeds=true \
origin jenkins-build-$BUILD_NUMBER
'''
}
}
}
stage('Mirror to Gitea') {
steps {
withCredentials([usernamePassword(
credentialsId: 'Jenkins-gitea',
usernameVariable: 'GITEA_USER',
passwordVariable: 'GITEA_TOKEN')]) {
script {
// Checkout from GitLab (already done implicitly)
sh '''
git checkout master
git pull origin master
git branch -D development
git branch -D jenkins-build-$BUILD_NUMBER
git rm -f Jenkinsfile
git rm -r --cached .vscode || echo "No .vscode to remove from git"
git commit --amend --no-edit --allow-empty
git remote add master https://sourcecode.confdroid.com/confdroid/confdroid_automatic.git
git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \
push master --mirror
'''
}
}
}
}
}
}

View File

@@ -1,56 +1,89 @@
# Readme
[![Build Status](https://jenkins.confdroid.com/buildStatus/icon?job=automatic_cd)](https://jenkins.confdroid.com/job/automatic_cd/)|
[[_TOC_]]
[![Build Status](https://jenkins.confdroid.com/buildStatus/icon?job=confdroid_automatic&style=plastic)](https://jenkins.confdroid.com/job/confdroid_automatic/)
[![Security Hotspots](https://sonarqube.confdroid.com/api/project_badges/measure?project=confdroid_automatic&metric=security_hotspots&token=sqb_c40a62afc3787918ade945dbc43089bb68ea7ab1)](https://sonarqube.confdroid.com/dashboard?id=confdroid_automatic)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/grizzlycoda/puppet_collection)
- [Readme](#readme)
- [Synopsis](#synopsis)
- [WARNING](#warning)
- [Features](#features)
- [Dependencies](#dependencies)
- [Support](#support)
- [Parameter Inheritance](#parameter-inheritance)
- [SELINUX](#selinux)
- [Deployment](#deployment)
- [Tests](#tests)
- [Contact Us](#contact-us)
- [Disclaimer](#disclaimer)
## Synopsis
dnf-automatic is a mechanism to allow automatic OS updates for Rocky 9.
dnf-automatic is a mechanism to allow automatic OS updates for Rocky 9 and similar RHEL 9 based operating systems.
`automatic_cd` manages dnf-automatic installations and configurations.
`confdroid_automatic` manages dnf-automatic installations and configurations.
Choose the required update and reboot policy per host, host group, environment etc. Set the email notification about updates, that's all it needs.
## WARNING
***Attention: Never use this puppet module on systems which have been previously configured manually. It is impossible to predict how and what would have been configured, hence previous configurations outside the scope of this module may be overwritten! Automated configurations require a test environment to verify that the module suits the purpose intended by the user, as well as tune the parameters, before deploying into live production***
> **Attention: Never use this puppet module on systems which have been previously configured manually. It is impossible to predict how and what would have been configured, hence previous configurations outside the scope of this module may be overwritten! Automated configurations require a test environment to verify that the module suits the purpose intended by the user, as well as tune the parameters, before deploying into live production**
## Features
* install required binaries, files and services
* manage main configurations files via parameters
* manage service
- install required binaries,
- manage files and directories with proper selinux context
- manage main configurations files via parameters
- manage service
## Dependencies
## Support
* Rocky 9
* Puppet 8
- Rocky 9 (any RHEL 9-based OS should work)
- Puppet 8
# Parameter Inheritance
## Parameter Inheritance
All parameters are listed in `params.pp` and inherited from there. Variable parameters are in the upper section and also documented in the top. These can be overridden by the ENC. Parameters in the bottom section (curly brackets) cannot be overridden and usually are used for keeping the code in the classes more readable.
## Module Deployment
## SELINUX
ALmost every puppet setup is done in very custom ways, and hence the way the modules are deployed to nodes are different. This module assumes [Foreman][def] as ENC, so the modules just have to be present on the master node and Foreman will take care for it.
All files and directories are configured with correct selinux context. If selinux is disabled, these contexts are ignored.
## Deployment
- native Puppet deployment
via site.pp or nodes.pp
```ruby
node 'example.example.net' {
include confdroid_automatic
}
```
- through Foreman:
In order to apply parameters through Foreman, **confdroid_automatic::params**- must be added to the host or host group in question.
See [more details about class deployment on confdroid.com](https://confdroid.com/2017/05/deploying-our-puppet-modules/).
## Tests
* Puppet Lint
* excluded tests:
* `--no-variable_scope-check`: not applicable as we are inheriting parameters from params class. the lint check does not distinguish between facts and inherited parameters.
* Puppet Parser
* ERB Template Parser
* Sonar Quality Gate
- Puppet Lint
- excluded tests:
- `--no-variable_scope-check`: not applicable as we are inheriting parameters from params class. the lint check does not distinguish between facts and inherited parameters.
- Puppet Parser
- ERB Template Parser
- Sonar Quality Gate
- End-to-end deployments in Rocky-9 environments
## Contact Us
[contact Us](https://confdroid.com/contact/)
- [contact Us](https://confdroid.com/contact/)
- [Feedback Portal](https://feedback.confdroid.com/)
## Disclaimer
ConfDroid as entity is entirely independent from Puppet. We provide custom configuration modules, written for specific purposes and specific environments.
The modules are tested and supported only as documented, and require testing in designated environments (i.e. lab or development environments) for parameter tuning etc. before deploying into production environments.
[def]: https://www.theforeman.org/manuals/3.13/quickstart_guide.html

View File

@@ -1,8 +1,8 @@
## automatic_cd::init.pp
# Module name: automatic_cd
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class initializes the automatic_cd module
## confdroid_automatic::init.pp
# Module name: confdroid_automatic
# Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class initializes the confdroid_automatic module
##############################################################################
class automatic_cd {
include automatic_cd::params
class confdroid_automatic {
include confdroid_automatic::params
}

View File

@@ -1,10 +1,10 @@
## 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
## confdroid_automatic::main::config.pp
# Module name: confdroid_automatic
# Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class manages module logic for the confdroid_automatic module
##############################################################################
class automatic_cd::main::config (
class confdroid_automatic::main::config (
) inherits automatic_cd::params {
include automatic_cd::main::service
) inherits confdroid_automatic::params {
include confdroid_automatic::main::service
}

View File

@@ -1,10 +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
## confdroid_automatic::main::dirs.pp
# Module name: confdroid_automatic
# Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class manages dirs for the confdroid_automatic module
##############################################################################
class automatic_cd::main::dirs (
class confdroid_automatic::main::dirs (
) inherits automatic_cd::params {
require automatic_cd::main::install
) inherits confdroid_automatic::params {
require confdroid_automatic::main::install
}

View File

@@ -1,12 +1,12 @@
## 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
## confdroid_automatic::main::files.pp
# Module name: confdroid_automatic
# Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class manages files for the confdroid_automatic module
##############################################################################
class automatic_cd::main::files (
class confdroid_automatic::main::files (
) inherits automatic_cd::params {
require automatic_cd::main::dirs
) inherits confdroid_automatic::params {
require confdroid_automatic::main::dirs
file { $ac_main_config:
ensure => file,

View File

@@ -1,12 +1,12 @@
## 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
## confdroid_automatic::main::install.pp
# Module name: confdroid_automatic
# Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class manages installation section for the confdroid_automatic module
##############################################################################
class automatic_cd::main::install (
class confdroid_automatic::main::install (
) inherits automatic_cd::params {
package { $reqpackages:
ensure => $pkg_ensure,
) inherits confdroid_automatic::params {
package { $ac_reqpackages:
ensure => $ac_pkg_ensure,
}
}

View File

@@ -1,12 +1,12 @@
## 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
## confdroid_automatic::main::service.pp
# Module name: confdroid_automatic
# Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class manages services for the confdroid_automatic module
##############################################################################
class automatic_cd::main::service (
class confdroid_automatic::main::service (
) inherits automatic_cd::params {
require automatic_cd::main::files
) inherits confdroid_automatic::params {
require confdroid_automatic::main::files
service { $ac_service:
ensure => running,

View File

@@ -1,10 +1,11 @@
## automatic_cd::params.pp
# Module name: automatic_cd
# Author: Arne Teuke (arne_teuke@confdroid.com)
# @summary Class manages all parameters for the automatic_cd module
# @param [String] reqpackages which packages to install
# @param [String] pkg_ensure which version of packages to install
# @param [String] ac_upgrade_type what upgrades to manage
## confdroid_automatic::params.pp
# Module name: confdroid_automatic
# Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class manages all parameters for the confdroid_automatic module
# @param [String] ac_reqpackages which packages to install
# @param [String] ac_pkg_ensure which version of packages to install
# @param [String] ac_upgrade_type what upgrades to manage. Can be
# 'default', 'security', 'minimal' or 'all'
# @param [String] ac_random_sleep random sleep seconds
# @param [String] ac_network_online_timeout Maximum time until be online
# @param [String] ac_download_updates whether to download available updates
@@ -13,11 +14,13 @@
# @param [String] ac_emit_via how to inform about emitted updates
# @param [String] ac_email_to where to send the email to
# @param [String] ac_email_host which host to use to send the email
# @param [Variant[String,Array[String]]] ac_excludepkgs packages to exclude from updates
##############################################################################
class automatic_cd::params (
class confdroid_automatic::params (
String $reqpackages = 'dnf-automatic',
String $pkg_ensure = 'latest',
String $ac_reqpackages = 'dnf-automatic',
String $ac_pkg_ensure = 'latest',
Variant[String, Array[String]] $ac_excludepkgs = [],
# updates
String $ac_upgrade_type = 'default',
@@ -42,8 +45,13 @@ class automatic_cd::params (
# Files
$ac_main_config = '/etc/dnf/automatic.conf'
$ac_main_config_erb = 'automatic_cd/automatic.conf.erb'
$ac_main_config_erb = 'confdroid_automatic/automatic.conf.erb'
$ac_excludepkgs_normalized = $ac_excludepkgs ? {
Array => join($ac_excludepkgs, ','),
default => $ac_excludepkgs,
}
# includes must be last
include automatic_cd::main::config
include confdroid_automatic::main::config
}

View File

@@ -93,5 +93,9 @@ email_to = <%= @ac_email_to %>
[base]
# This section overrides dnf.conf
<% unless @ac_excludepkgs_normalized.empty? -%>
excludepkgs = <%= @ac_excludepkgs_normalized %>
<% end -%>
# Use this to filter DNF core messages
debuglevel = 1