Compare commits
28 Commits
1.0.0
...
1.1.0-04.2
| Author | SHA1 | Date | |
|---|---|---|---|
| d6ced582d2 | |||
| c4a63073f8 | |||
| cfd45de3d8 | |||
| aae0f70464 | |||
| 9ff9365542 | |||
| bb7ee6e887 | |||
| b318fdd26c | |||
| 538bd8ef5a | |||
|
|
668c4ab2f8 | ||
|
|
ef418556d3 | ||
| b2f6565b29 | |||
|
|
1160e843d2 | ||
|
|
8c3fe53ee3 | ||
|
|
15ba510e09 | ||
|
|
991ff23f0e | ||
|
|
87b0365edf | ||
|
|
1ad2b5179e | ||
|
|
b3df110b36 | ||
|
|
653aba91ee | ||
|
|
475b12e640 | ||
|
|
cc74d3fc9b | ||
|
|
1b91e8c190 | ||
|
|
60a148c323 | ||
|
|
b4b7ff7e23 | ||
|
|
211ef92773 | ||
|
|
53a2612e28 | ||
|
|
eae61cb610 | ||
|
|
f222d88084 |
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
.yardoc
|
||||||
|
Gemfile.lock
|
||||||
|
FileList
|
||||||
|
.scannerwork
|
||||||
|
.vscode
|
||||||
|
.puppet-lint.rc
|
||||||
|
.rspec
|
||||||
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"cSpell.words": [
|
|
||||||
"debuglevel",
|
|
||||||
"notifyonly",
|
|
||||||
"Ssendwait"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
40
Jenkinsfile
vendored
40
Jenkinsfile
vendored
@@ -1,7 +1,5 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent any
|
||||||
label 'puppet'
|
|
||||||
}
|
|
||||||
|
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
@@ -69,7 +67,7 @@ pipeline {
|
|||||||
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
|
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
|
||||||
sh '''
|
sh '''
|
||||||
/opt/sonar-scanner/bin/sonar-scanner \
|
/opt/sonar-scanner/bin/sonar-scanner \
|
||||||
-Dsonar.projectKey=automatic_cd \
|
-Dsonar.projectKey=confdroid_automatic \
|
||||||
-Dsonar.sources=. \
|
-Dsonar.sources=. \
|
||||||
-Dsonar.host.url=https://sonarqube.confdroid.com \
|
-Dsonar.host.url=https://sonarqube.confdroid.com \
|
||||||
-Dsonar.token=$SONAR_TOKEN
|
-Dsonar.token=$SONAR_TOKEN
|
||||||
@@ -90,11 +88,43 @@ pipeline {
|
|||||||
sh '''
|
sh '''
|
||||||
git config user.name "Jenkins Server"
|
git config user.name "Jenkins Server"
|
||||||
git config user.email jenkins@confdroid.com
|
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 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
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
79
README.md
79
README.md
@@ -1,56 +1,89 @@
|
|||||||
# Readme
|
# Readme
|
||||||
|
|
||||||
[](https://jenkins.confdroid.com/job/automatic_cd/)|
|
[](https://jenkins.confdroid.com/job/confdroid_automatic/)
|
||||||
|
[](https://sonarqube.confdroid.com/dashboard?id=confdroid_automatic)
|
||||||
[[_TOC_]]
|
[](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
|
## 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
|
## 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
|
## Features
|
||||||
|
|
||||||
* install required binaries, files and services
|
- install required binaries,
|
||||||
* manage main configurations files via parameters
|
- manage files and directories with proper selinux context
|
||||||
* manage service
|
- manage main configurations files via parameters
|
||||||
|
- manage service
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
* Rocky 9
|
- Rocky 9 (any RHEL 9-based OS should work)
|
||||||
* Puppet 8
|
- 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.
|
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
|
## Tests
|
||||||
|
|
||||||
* Puppet Lint
|
- Puppet Lint
|
||||||
* excluded tests:
|
- 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.
|
- `--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
|
- Puppet Parser
|
||||||
* ERB Template Parser
|
- ERB Template Parser
|
||||||
* Sonar Quality Gate
|
- Sonar Quality Gate
|
||||||
|
- End-to-end deployments in Rocky-9 environments
|
||||||
|
|
||||||
## Contact Us
|
## Contact Us
|
||||||
|
|
||||||
[contact Us](https://confdroid.com/contact/)
|
- [contact Us](https://confdroid.com/contact/)
|
||||||
|
- [Feedback Portal](https://feedback.confdroid.com/)
|
||||||
|
|
||||||
## Disclaimer
|
## Disclaimer
|
||||||
|
|
||||||
ConfDroid as entity is entirely independent from Puppet. We provide custom configuration modules, written for specific purposes and specific environments.
|
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.
|
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
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
## automatic_cd::init.pp
|
## confdroid_automatic::init.pp
|
||||||
# Module name: automatic_cd
|
# Module name: confdroid_automatic
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||||
# @summary Class initializes the automatic_cd module
|
# @summary Class initializes the confdroid_automatic module
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class automatic_cd {
|
class confdroid_automatic {
|
||||||
include automatic_cd::params
|
include confdroid_automatic::params
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
## automatic_cd::main::config.pp
|
## confdroid_automatic::main::config.pp
|
||||||
# Module name: automatic_cd
|
# Module name: confdroid_automatic
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||||
# @summary Class manages module logic for the automatic_cd module
|
# @summary Class manages module logic for the confdroid_automatic module
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class automatic_cd::main::config (
|
class confdroid_automatic::main::config (
|
||||||
|
|
||||||
) inherits automatic_cd::params {
|
) inherits confdroid_automatic::params {
|
||||||
include automatic_cd::main::service
|
include confdroid_automatic::main::service
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
## automatic_cd::main::dirs.pp
|
## confdroid_automatic::main::dirs.pp
|
||||||
# Module name: automatic_cd
|
# Module name: confdroid_automatic
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||||
# @summary Class manages dirs for the automatic_cd module
|
# @summary Class manages dirs for the confdroid_automatic module
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class automatic_cd::main::dirs (
|
class confdroid_automatic::main::dirs (
|
||||||
|
|
||||||
) inherits automatic_cd::params {
|
) inherits confdroid_automatic::params {
|
||||||
require automatic_cd::main::install
|
require confdroid_automatic::main::install
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
## automatic_cd::main::files.pp
|
## confdroid_automatic::main::files.pp
|
||||||
# Module name: automatic_cd
|
# Module name: confdroid_automatic
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||||
# @summary Class manages files for the automatic_cd module
|
# @summary Class manages files for the confdroid_automatic module
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class automatic_cd::main::files (
|
class confdroid_automatic::main::files (
|
||||||
|
|
||||||
) inherits automatic_cd::params {
|
) inherits confdroid_automatic::params {
|
||||||
require automatic_cd::main::dirs
|
require confdroid_automatic::main::dirs
|
||||||
|
|
||||||
file { $ac_main_config:
|
file { $ac_main_config:
|
||||||
ensure => file,
|
ensure => file,
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
## automatic_cd::main::install.pp
|
## confdroid_automatic::main::install.pp
|
||||||
# Module name: automatic_cd
|
# Module name: confdroid_automatic
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||||
# @summary Class manages installation section for the automatic_cd module
|
# @summary Class manages installation section for the confdroid_automatic module
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class automatic_cd::main::install (
|
class confdroid_automatic::main::install (
|
||||||
|
|
||||||
) inherits automatic_cd::params {
|
) inherits confdroid_automatic::params {
|
||||||
package { $reqpackages:
|
package { $ac_reqpackages:
|
||||||
ensure => $pkg_ensure,
|
ensure => $ac_pkg_ensure,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
## automatic_cd::main::service.pp
|
## confdroid_automatic::main::service.pp
|
||||||
# Module name: automatic_cd
|
# Module name: confdroid_automatic
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||||
# @summary Class manages services for the automatic_cd module
|
# @summary Class manages services for the confdroid_automatic module
|
||||||
##############################################################################
|
##############################################################################
|
||||||
class automatic_cd::main::service (
|
class confdroid_automatic::main::service (
|
||||||
|
|
||||||
) inherits automatic_cd::params {
|
) inherits confdroid_automatic::params {
|
||||||
require automatic_cd::main::files
|
require confdroid_automatic::main::files
|
||||||
|
|
||||||
service { $ac_service:
|
service { $ac_service:
|
||||||
ensure => running,
|
ensure => running,
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
## automatic_cd::params.pp
|
## confdroid_automatic::params.pp
|
||||||
# Module name: automatic_cd
|
# Module name: confdroid_automatic
|
||||||
# Author: Arne Teuke (arne_teuke@confdroid.com)
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
||||||
# @summary Class manages all parameters for the automatic_cd module
|
# @summary Class manages all parameters for the confdroid_automatic module
|
||||||
# @param [String] reqpackages which packages to install
|
# @param [String] ac_reqpackages which packages to install
|
||||||
# @param [String] pkg_ensure which version of packages to install
|
# @param [String] ac_pkg_ensure which version of packages to install
|
||||||
# @param [String] ac_upgrade_type what upgrades to manage
|
# @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_random_sleep random sleep seconds
|
||||||
# @param [String] ac_network_online_timeout Maximum time until be online
|
# @param [String] ac_network_online_timeout Maximum time until be online
|
||||||
# @param [String] ac_download_updates whether to download available updates
|
# @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_emit_via how to inform about emitted updates
|
||||||
# @param [String] ac_email_to where to send the email to
|
# @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 [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 $ac_reqpackages = 'dnf-automatic',
|
||||||
String $pkg_ensure = 'latest',
|
String $ac_pkg_ensure = 'latest',
|
||||||
|
Variant[String, Array[String]] $ac_excludepkgs = [],
|
||||||
|
|
||||||
# updates
|
# updates
|
||||||
String $ac_upgrade_type = 'default',
|
String $ac_upgrade_type = 'default',
|
||||||
@@ -42,8 +45,13 @@ class automatic_cd::params (
|
|||||||
|
|
||||||
# Files
|
# Files
|
||||||
$ac_main_config = '/etc/dnf/automatic.conf'
|
$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
|
# includes must be last
|
||||||
include automatic_cd::main::config
|
include confdroid_automatic::main::config
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,5 +93,9 @@ email_to = <%= @ac_email_to %>
|
|||||||
[base]
|
[base]
|
||||||
# This section overrides dnf.conf
|
# This section overrides dnf.conf
|
||||||
|
|
||||||
|
<% unless @ac_excludepkgs_normalized.empty? -%>
|
||||||
|
excludepkgs = <%= @ac_excludepkgs_normalized %>
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
# Use this to filter DNF core messages
|
# Use this to filter DNF core messages
|
||||||
debuglevel = 1
|
debuglevel = 1
|
||||||
|
|||||||
Reference in New Issue
Block a user