diff --git a/functions/get_customer.pp b/functions/get_customer.pp index aef58a1..ab67f9f 100644 --- a/functions/get_customer.pp +++ b/functions/get_customer.pp @@ -1,6 +1,6 @@ # Lets determin who the customer is by looking at the hostname function sunetdrive::get_customer() >> String { - $hostnameparts = split($facts['fqdn'],'\.') + $hostnameparts = split($facts['networking']['fqdn'],'\.') if $hostnameparts[1] == 'drive' { if $hostnameparts[0] =~ /^gss/ { return 'gss' diff --git a/functions/get_environment.pp b/functions/get_environment.pp index 42fa60f..f0556af 100644 --- a/functions/get_environment.pp +++ b/functions/get_environment.pp @@ -1,6 +1,6 @@ # Lets determin where we are by looking at the hostname function sunetdrive::get_environment() >> String { - $hostname = $facts['fqdn'] + $hostname = $facts['networking']['fqdn'] if $hostname =~ /^.*\.drive\.sunet\.se$/ { if $hostname =~ /^.*\.pilot\.drive\.sunet\.se$/ { return 'pilot' diff --git a/functions/get_node_number.pp b/functions/get_node_number.pp index 4c256fe..2b5317b 100644 --- a/functions/get_node_number.pp +++ b/functions/get_node_number.pp @@ -1,4 +1,4 @@ # Lets determin where we are by looking at the hostname function sunetdrive::get_node_number() >> Integer { - Integer(regsubst($::fqdn, /^[a-zA-Z\-]+(\d).*$/, '\\1')) + Integer(regsubst($facts['networking']['fqdn'], /^[a-zA-Z\-]+(\d).*$/, '\\1')) } diff --git a/manifests/cloudimage.pp b/manifests/cloudimage.pp index aa9cada..eeca54f 100644 --- a/manifests/cloudimage.pp +++ b/manifests/cloudimage.pp @@ -38,8 +38,8 @@ define sunetdrive::cloudimage( resolver => ['130.242.80.14', '130.242.80.99'], search => $search, # - repo => $::cosmos_repo_origin_url, - tagpattern => $::cosmos_tag_pattern, + repo => $facts['cosmos_repo_origin_url'], + tagpattern => $facts['cosmos_tag_pattern'], # cpus => $cpus, memory => $memory, diff --git a/manifests/infra_script.pp b/manifests/infra_script.pp index fac5198..be78e19 100644 --- a/manifests/infra_script.pp +++ b/manifests/infra_script.pp @@ -4,7 +4,7 @@ class sunetdrive::infra_script ( $location = undef ) { $environment = sunetdrive::get_environment() - $customer = "common" + $customer = 'common' $config = hiera_hash($environment) $gss_backup_server = $config['gss_backup_server'] $lookup_backup_server = $config['lookup_backup_server'] diff --git a/manifests/mariadb.pp b/manifests/mariadb.pp index c6356d2..3eae4d5 100644 --- a/manifests/mariadb.pp +++ b/manifests/mariadb.pp @@ -10,9 +10,9 @@ class sunetdrive::mariadb ( $quorum_id = $facts['networking']['fqdn'] $quorum_password = safe_hiera('quorum_password') $db = sunetdrive::db_type { 'base_db': - bootstrap => $bootstrap, - tag_mariadb => $tag_mariadb, - location => $location, + bootstrap => $bootstrap, + tag_mariadb => $tag_mariadb, + location => $location, } file { '/etc/quorum.conf': ensure => file, diff --git a/manifests/multinode.pp b/manifests/multinode.pp index 9620cb7..0ba70ad 100644 --- a/manifests/multinode.pp +++ b/manifests/multinode.pp @@ -5,7 +5,7 @@ class sunetdrive::multinode ( ) { include sunet::packages::yq - $myname = $facts['hostname'] + $myname = $facts['networking']['hostname'] $is_multinode = true; $environment = sunetdrive::get_environment() $lb_servers = hiera_hash($environment)['lb_servers'] @@ -278,7 +278,7 @@ MACAddressPolicy=none' $s3_host = $customer_config['s3_host'] $s3_usepath = hiera('s3_usepath') $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') if $customer_config['twofactor_enforced_groups'] { $twofactor_enforced_groups = $customer_config['twofactor_enforced_groups'] diff --git a/manifests/multinode_db.pp b/manifests/multinode_db.pp index 6841b75..8ec056e 100644 --- a/manifests/multinode_db.pp +++ b/manifests/multinode_db.pp @@ -17,7 +17,7 @@ class sunetdrive::multinode_db(){ if $facts["networking"]["fqdn"] =~ /^multinode-db1\.drive\.(test\.){1}sunet\.se$/ { $statistics_secret = safe_hiera('statistics_secret') 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| { $memo + {$value => lookup($value)} diff --git a/manifests/scriptreceiver.pp b/manifests/scriptreceiver.pp index 9c8e319..6aca740 100644 --- a/manifests/scriptreceiver.pp +++ b/manifests/scriptreceiver.pp @@ -69,7 +69,7 @@ class sunetdrive::scriptreceiver() owner => 'root', group => 'root', } - file { "/etc/sudoers.d/99-safer_reboot": + file { '/etc/sudoers.d/99-safer_reboot': ensure => file, content => "script ALL=(root) NOPASSWD: /usr/local/bin/safer_reboot\n", mode => '0440', diff --git a/manifests/sitemonitornaemon.pp b/manifests/sitemonitornaemon.pp index 4602549..e0abcd4 100644 --- a/manifests/sitemonitornaemon.pp +++ b/manifests/sitemonitornaemon.pp @@ -7,7 +7,7 @@ class sunetdrive::sitemonitornaemon() { $tls_servers_with_port = hiera_array('tls_servers_with_port') $nextcloud_version_prod = split(hiera('nextcloud_version_prod'),'[-]')[0] $nextcloud_version_test = split(hiera('nextcloud_version_test'),'[-]')[0] - $monitorhost = $::fqdn + $monitorhost = $facts['networking']['fqdn'] $environment = sunetdrive::get_environment() $influx_passwd = safe_hiera('influx_passwd') $slack_url = safe_hiera('slack_url')