Compare commits

..

1 Commits

Author SHA1 Message Date
0b60a31cc9 chore: testing a simple data_hash hiera plugin
testing testing ....
2025-12-24 21:51:40 +11:00
11 changed files with 54 additions and 64 deletions

View File

@ -4,6 +4,8 @@ defaults:
datadir: "hieradata"
data_hash: "yaml_data"
hierarchy:
- name: Custom Hiera Plugin
data_hash: custom_hiera_plugin::data_hash
- name: Consolidated Data
paths:
- "nodes/%{trusted.certname}.yaml"

View File

@ -1,6 +1,6 @@
---
profiles::accounts::sysadmin::password: ENC[PKCS7,MIIBqQYJKoZIhvcNAQcDoIIBmjCCAZYCAQAxggEhMIIBHQIBADAFMAACAQEwDQYJKoZIhvcNAQEBBQAEggEAoS7GyofFaXBNTWU+GtSiz4eCX/9j/sh3fDDRgOgNv1qpcQ87ZlTTenbHo9lxeURxKQ2HVVt7IsrBo/SC/WgipAKnliRkkIvo7nfAs+i+kEE8wakjAs0DcB4mhqtIZRuBkLG2Nay//DcG6cltVkbKEEKmKLMkDFZgTWreOZal8nDljpVe1S8QwtwP4/6hKTef5xsOnrisxuffWTXvwYJhj/VXrjdoH7EhtHGLybzEalglkVHEGft/WrrD/0bwJpmR0RegWI4HTsSvGiHgvf5DZJx8fXPZNPnicGtlfA9ccQPuVo17bY4Qf/WIc1A8Ssv4kHSbNIYJKRymI3UFb0Z4wzBsBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBBBxDLb6pCGbittkcX6asd/gEBmMcUNupDjSECq5H09YA70eVwWWe0fBqxTxrr2cXCXtRKFvOk8SJmL0xHAWodaLN9+krTWHJcWbAK8JXEPC7rn]
profiles::accounts::root::password: ENC[PKCS7,MIIB2gYJKoZIhvcNAQcDoIIByzCCAccCAQAxggEhMIIBHQIBADAFMAACAQEwDQYJKoZIhvcNAQEBBQAEggEAIgzGQLoHrm7JSnWG4vdAtxSuETmnqbV7kUsQS8WCRUwFGenDFkps+OGMnOGEHLzMJzXihLfgfdWwTAI4fp48M+zhTMo9TQkdzZqtbFk3+RjV2jDF0wf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Is+yRQH8laB4=]
profiles::consul::server::acl_tokens_initial_management: ENC[PKCS7,MIIBmQYJKoZIhvcNAQcDoIIBijCCAYYCAQAxggEhMIIBHQIBADAFMAACAQEwDQYJKoZIhvcNAQEBBQAEggEAi1UH7AZirJ1PdxWy+KEgS5ufm0wbn2xy9rkg14hKYpcVjBa4pOZpSLMGMiiUpBIqBytDMZM4ezYa/luktpkBImJbM/TE16beGtsacQGA+9eZk2Tihs9GR2qbAQiu5lLITiDlwNnf0GeWdqHM8CTeD68DczQF320d9U14/k6pG/7z+w/MGLcjsQoSuOFTm42JVn1BI46t1CYSCHMXQc/9Tfs+FzI+vumohI8DxAYBIuyzU5HBX/MntAsvD/yixMJS1pZL9WwgqZJC/wK34rVRB39DpxWf/WROrI+WLuSJwr7WBjaeF9Ju+89WKCgsI53EWhFTj8GgDZm/jqPoE478NjBcBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBAoACRzJdQKNYXZv6cghFIIgDAzB81DMcuY815nb8POtZpiA06jT/068AoZmSctHoFK/zW9tY229N5r1Tb+WHElqLk=]

View File

@ -38,7 +38,7 @@ profiles::nginx::simpleproxy::nginx_aliases:
- radosgw.service.au-syd1.consul
profiles::nginx::simpleproxy::proxy_port: 7480
profiles::nginx::simpleproxy::proxy_path: '/'
nginx::client_max_body_size: 5000M
nginx::client_max_body_size: 100M
# manage consul service
consul::services:

View File

@ -8,9 +8,9 @@ docker::version: latest
docker::curl_ensure: false
docker::root_dir: /data/docker
profiles::gitea::runner::instance: https://git.unkin.net
profiles::gitea::runner::home: /data/runner
profiles::gitea::runner::version: '0.2.12'
profiles::gitea::runner::version: '0.2.10'
profiles::gitea::runner::source: "https://gitea.com/gitea/act_runner/releases/download/v%{hiera('profiles::gitea::runner::version')}/act_runner-%{hiera('profiles::gitea::runner::version')}-linux-amd64"
profiles::gitea::runner::config:
log:
level: info

View File

@ -71,7 +71,7 @@ profiles::nginx::simpleproxy::nginx_aliases:
profiles::nginx::simpleproxy::proxy_port: 3000
profiles::nginx::simpleproxy::proxy_path: '/'
nginx::client_max_body_size: 5144M
nginx::client_max_body_size: 1024M
# enable external access via haproxy
profiles::gitea::haproxy::enable: true

View File

@ -3,41 +3,6 @@ profiles::packages::include:
createrepo: {}
profiles::reposync::repos_list:
almalinux_9.7_baseos:
repository: 'baseos'
description: 'AlmaLinux 9.7 BaseOS'
osname: 'almalinux'
release: '9.7'
mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/9.7/baseos'
gpgkey: 'http://mirror.aarnet.edu.au/pub/almalinux/RPM-GPG-KEY-AlmaLinux-9'
almalinux_9.7_appstream:
repository: 'appstream'
description: 'AlmaLinux 9.7 AppStream'
osname: 'almalinux'
release: '9.7'
mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/9.7/appstream'
gpgkey: 'http://mirror.aarnet.edu.au/pub/almalinux/RPM-GPG-KEY-AlmaLinux-9'
almalinux_9.7_crb:
repository: 'crb'
description: 'AlmaLinux 9.7 CRB'
osname: 'almalinux'
release: '9.7'
mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/9.7/crb'
gpgkey: 'http://mirror.aarnet.edu.au/pub/almalinux/RPM-GPG-KEY-AlmaLinux-9'
almalinux_9.7_ha:
repository: 'ha'
description: 'AlmaLinux 9.7 HighAvailability'
osname: 'almalinux'
release: '9.7'
mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/9.7/highavailability'
gpgkey: 'http://mirror.aarnet.edu.au/pub/almalinux/RPM-GPG-KEY-AlmaLinux-9'
almalinux_9.7_extras:
repository: 'extras'
description: 'AlmaLinux 9.7 extras'
osname: 'almalinux'
release: '9.7'
mirrorlist: 'https://mirrors.almalinux.org/mirrorlist/9.7/extras'
gpgkey: 'http://mirror.aarnet.edu.au/pub/almalinux/RPM-GPG-KEY-AlmaLinux-9'
almalinux_9.6_baseos:
repository: 'baseos'
description: 'AlmaLinux 9.6 BaseOS'

View File

@ -0,0 +1,16 @@
# frozen_string_literal: true
require 'socket'
# Custom Hiera Plugin
# This plugin returns static data for testing purposes
Puppet::Functions.create_function(:'custom_hiera_plugin::data_hash') do
# :reek:UtilityFunction
def data_hash(_options, _context)
# Return a simple hash with the required key-value pairs
{
'custom_hiera_plugin::var1' => 'foo',
'custom_hiera_plugin::hostname' => Socket.gethostname
}
end
end

View File

@ -1,12 +1,12 @@
# manage the root user
class profiles::accounts::root (
String $password,
Optional[Array[String]] $sshkeys = undef,
) {
accounts::user { 'root':
sshkeys => $sshkeys,
password => $password,
if $sshkeys {
accounts::user { 'root':
sshkeys => $sshkeys,
}
}
file {'/root/.config':

View File

@ -1,6 +1,15 @@
# this is the base class, which will be used by all servers
class profiles::base () {
# Test custom hiera plugin
notify { 'custom_hiera_plugin_test':
message => "Custom hiera plugin value: ${lookup('custom_hiera_plugin::var1')}",
}
notify { 'custom_hiera_plugin_hostname':
message => "Custom hiera plugin hostname: ${lookup('custom_hiera_plugin::hostname')}",
}
# run a limited set of classes on the first run aimed at bootstrapping the new node
if $facts['firstrun'] {
include profiles::firstrun::init

View File

@ -1,12 +1,13 @@
# profiles::gitea::init
class profiles::gitea::runner (
String $registration_token,
Stdlib::HTTPSUrl $source,
String $user = 'runner',
String $group = 'runner',
Stdlib::Absolutepath $home = '/data/runner',
Hash $config = {},
Stdlib::HTTPSUrl $instance = 'https://git.query.consul',
String $version = 'latest',
String $version = '0.2.10',
) {
group { $group:
@ -31,27 +32,24 @@ class profiles::gitea::runner (
require => User[$user],
}
unless $version in ['latest', 'present'] {
# versionlock act
yum::versionlock{ 'act_runner':
ensure => present,
version => $version,
before => Package['act_runner'],
}
archive { '/usr/local/bin/act_runner':
ensure => present,
extract => false,
source => $source,
creates => '/usr/local/bin/act_runner',
cleanup => true,
}
# install act
package { 'act_runner':
ensure => $version,
}
# remove manually installed act_runner
file { '/usr/local/bin/act_runner':
ensure => absent,
ensure => 'file',
mode => '0755',
owner => 'root',
group => 'root',
require => Archive['/usr/local/bin/act_runner'],
}
exec { 'register_act_runner':
command => "/usr/bin/act_runner register \
exec {'register_act_runner':
command => "/usr/local/bin/act_runner register \
--no-interactive \
--instance ${instance} \
--token ${registration_token} \
@ -62,12 +60,12 @@ class profiles::gitea::runner (
user => $user,
group => $group,
require => [
Package['act_runner'],
File['/usr/local/bin/act_runner'],
File["${home}/config.yaml"],
],
}
systemd::unit_file { 'act_runner.service':
systemd::unit_file {'act_runner.service':
enable => true,
active => true,
content => template('profiles/gitea/act_runner.service.erb'),

View File

@ -4,7 +4,7 @@ Documentation=https://gitea.com/gitea/act_runner
After=docker.service
[Service]
ExecStart=/usr/bin/act_runner daemon --config <%= @home %>/config.yaml
ExecStart=/usr/local/bin/act_runner daemon --config <%= @home %>/config.yaml
ExecReload=/bin/kill -s HUP $MAINPID
WorkingDirectory=<%= @home %>
TimeoutSec=0