puppet-lint --fix

This commit is contained in:
Micke Nordin 2024-10-09 14:25:34 +02:00
parent 52869ca089
commit d7e7e260c2
10 changed files with 14 additions and 14 deletions

View file

@ -1,6 +1,6 @@
# Lets determin who the customer is by looking at the hostname # Lets determin who the customer is by looking at the hostname
function sunetdrive::get_customer() >> String { function sunetdrive::get_customer() >> String {
$hostnameparts = split($facts['fqdn'],'\.') $hostnameparts = split($facts['networking']['fqdn'],'\.')
if $hostnameparts[1] == 'drive' { if $hostnameparts[1] == 'drive' {
if $hostnameparts[0] =~ /^gss/ { if $hostnameparts[0] =~ /^gss/ {
return 'gss' return 'gss'

View file

@ -1,6 +1,6 @@
# Lets determin where we are by looking at the hostname # Lets determin where we are by looking at the hostname
function sunetdrive::get_environment() >> String { function sunetdrive::get_environment() >> String {
$hostname = $facts['fqdn'] $hostname = $facts['networking']['fqdn']
if $hostname =~ /^.*\.drive\.sunet\.se$/ { if $hostname =~ /^.*\.drive\.sunet\.se$/ {
if $hostname =~ /^.*\.pilot\.drive\.sunet\.se$/ { if $hostname =~ /^.*\.pilot\.drive\.sunet\.se$/ {
return 'pilot' return 'pilot'

View file

@ -1,4 +1,4 @@
# Lets determin where we are by looking at the hostname # Lets determin where we are by looking at the hostname
function sunetdrive::get_node_number() >> Integer { function sunetdrive::get_node_number() >> Integer {
Integer(regsubst($::fqdn, /^[a-zA-Z\-]+(\d).*$/, '\\1')) Integer(regsubst($facts['networking']['fqdn'], /^[a-zA-Z\-]+(\d).*$/, '\\1'))
} }

View file

@ -38,8 +38,8 @@ define sunetdrive::cloudimage(
resolver => ['130.242.80.14', '130.242.80.99'], resolver => ['130.242.80.14', '130.242.80.99'],
search => $search, search => $search,
# #
repo => $::cosmos_repo_origin_url, repo => $facts['cosmos_repo_origin_url'],
tagpattern => $::cosmos_tag_pattern, tagpattern => $facts['cosmos_tag_pattern'],
# #
cpus => $cpus, cpus => $cpus,
memory => $memory, memory => $memory,

View file

@ -4,7 +4,7 @@ class sunetdrive::infra_script (
$location = undef $location = undef
) { ) {
$environment = sunetdrive::get_environment() $environment = sunetdrive::get_environment()
$customer = "common" $customer = 'common'
$config = hiera_hash($environment) $config = hiera_hash($environment)
$gss_backup_server = $config['gss_backup_server'] $gss_backup_server = $config['gss_backup_server']
$lookup_backup_server = $config['lookup_backup_server'] $lookup_backup_server = $config['lookup_backup_server']

View file

@ -10,9 +10,9 @@ class sunetdrive::mariadb (
$quorum_id = $facts['networking']['fqdn'] $quorum_id = $facts['networking']['fqdn']
$quorum_password = safe_hiera('quorum_password') $quorum_password = safe_hiera('quorum_password')
$db = sunetdrive::db_type { 'base_db': $db = sunetdrive::db_type { 'base_db':
bootstrap => $bootstrap, bootstrap => $bootstrap,
tag_mariadb => $tag_mariadb, tag_mariadb => $tag_mariadb,
location => $location, location => $location,
} }
file { '/etc/quorum.conf': file { '/etc/quorum.conf':
ensure => file, ensure => file,

View file

@ -5,7 +5,7 @@ class sunetdrive::multinode (
) )
{ {
include sunet::packages::yq include sunet::packages::yq
$myname = $facts['hostname'] $myname = $facts['networking']['hostname']
$is_multinode = true; $is_multinode = true;
$environment = sunetdrive::get_environment() $environment = sunetdrive::get_environment()
$lb_servers = hiera_hash($environment)['lb_servers'] $lb_servers = hiera_hash($environment)['lb_servers']
@ -278,7 +278,7 @@ MACAddressPolicy=none'
$s3_host = $customer_config['s3_host'] $s3_host = $customer_config['s3_host']
$s3_usepath = hiera('s3_usepath') $s3_usepath = hiera('s3_usepath')
$smtpuser = hiera("smtp_user_${environment}") $smtpuser = hiera("smtp_user_${environment}")
$trusted_domains = [$site_name, $facts['fqdn'], 'localhost'] $trusted_domains = [$site_name, $facts['networking']['fqdn'], 'localhost']
$tug_office = hiera_array('tug_office') $tug_office = hiera_array('tug_office')
if $customer_config['twofactor_enforced_groups'] { if $customer_config['twofactor_enforced_groups'] {
$twofactor_enforced_groups = $customer_config['twofactor_enforced_groups'] $twofactor_enforced_groups = $customer_config['twofactor_enforced_groups']

View file

@ -17,7 +17,7 @@ class sunetdrive::multinode_db(){
if $facts["networking"]["fqdn"] =~ /^multinode-db1\.drive\.(test\.){1}sunet\.se$/ { if $facts["networking"]["fqdn"] =~ /^multinode-db1\.drive\.(test\.){1}sunet\.se$/ {
$statistics_secret = safe_hiera('statistics_secret') $statistics_secret = safe_hiera('statistics_secret')
notify { 'hostmessage': notify { 'hostmessage':
message => "We are on multinode-db1. Set up statistics environment.", message => 'We are on multinode-db1. Set up statistics environment.',
} }
$custdata=$customers.reduce({}) |$memo, $value| { $custdata=$customers.reduce({}) |$memo, $value| {
$memo + {$value => lookup($value)} $memo + {$value => lookup($value)}

View file

@ -69,7 +69,7 @@ class sunetdrive::scriptreceiver()
owner => 'root', owner => 'root',
group => 'root', group => 'root',
} }
file { "/etc/sudoers.d/99-safer_reboot": file { '/etc/sudoers.d/99-safer_reboot':
ensure => file, ensure => file,
content => "script ALL=(root) NOPASSWD: /usr/local/bin/safer_reboot\n", content => "script ALL=(root) NOPASSWD: /usr/local/bin/safer_reboot\n",
mode => '0440', mode => '0440',

View file

@ -7,7 +7,7 @@ class sunetdrive::sitemonitornaemon() {
$tls_servers_with_port = hiera_array('tls_servers_with_port') $tls_servers_with_port = hiera_array('tls_servers_with_port')
$nextcloud_version_prod = split(hiera('nextcloud_version_prod'),'[-]')[0] $nextcloud_version_prod = split(hiera('nextcloud_version_prod'),'[-]')[0]
$nextcloud_version_test = split(hiera('nextcloud_version_test'),'[-]')[0] $nextcloud_version_test = split(hiera('nextcloud_version_test'),'[-]')[0]
$monitorhost = $::fqdn $monitorhost = $facts['networking']['fqdn']
$environment = sunetdrive::get_environment() $environment = sunetdrive::get_environment()
$influx_passwd = safe_hiera('influx_passwd') $influx_passwd = safe_hiera('influx_passwd')
$slack_url = safe_hiera('slack_url') $slack_url = safe_hiera('slack_url')