diff --git a/manifests/auth.pp b/manifests/auth.pp index a217dec454b6da5c5ba9efba98912b4f2993f842..fae4da6870c814e1f6b510171b713ddbf0ee3cd5 100644 --- a/manifests/auth.pp +++ b/manifests/auth.pp @@ -14,9 +14,11 @@ class aes::auth( if $facts[fqdn] == 'aes.edu.liu.se' { # The AD service account for this key is: ida_sys002_srv $auth_keytab_data = $keytab_production + $server_type = "production" } elsif $facts[fqdn] == 'aes-devel.edu.liu.se' { # The AD service account for this key is: ida_sys004_srv $auth_keytab_data = $keytab_devel + $server_type = "devel" } else { $auth_keytab_data = undef } @@ -107,7 +109,7 @@ class aes::auth( } exec { 'update-auth-repo' : - command => "/opt/utils/update_repo.sh ${auth_home}/src https://oauth2:F-agHaRXCdyFy38q4c-N@gitlab.liu.se/upp-aes/communication.git production", + command => "/opt/utils/update_repo.sh ${auth_home}/src https://oauth2:F-agHaRXCdyFy38q4c-N@gitlab.liu.se/upp-aes/communication.git ${server_type}", environment => [ "REPO_USER=${auth_user}", "REPO_GROUP=${auth_group}", "REPO_ON_UPDATE=${auth_home}/on_update.sh" ], # This command will need to run "on_update" as root in order to restart the service. user => root, diff --git a/manifests/auth_keydb.pp b/manifests/auth_keydb.pp index 559a87bc0f7936084d0e967a45bdd20eafef21f0..d56a745ec9a6e11452b80bc625c0f503b50007c1 100644 --- a/manifests/auth_keydb.pp +++ b/manifests/auth_keydb.pp @@ -5,6 +5,15 @@ class aes::auth_keydb { $keydb_home = "/srv/${keydb_user}" $keydb_service = "aes_auth_keydb" + # Figure out which certificate to use based on the hostname. + if $facts[fqdn] == 'aes.edu.liu.se' { + $server_type = "production" + } elsif $facts[fqdn] == 'aes-devel.edu.liu.se' { + $server_type = "devel" + } else { + $server_type = undef + } + user { "${keydb_user}" : ensure => present, home => "${keydb_home}", @@ -40,7 +49,7 @@ class aes::auth_keydb { } exec { 'update-keydb-repo' : - command => "/opt/utils/update_repo.sh ${keydb_home}/src https://oauth2:F-agHaRXCdyFy38q4c-N@gitlab.liu.se/upp-aes/communication.git production", + command => "/opt/utils/update_repo.sh ${keydb_home}/src https://oauth2:F-agHaRXCdyFy38q4c-N@gitlab.liu.se/upp-aes/communication.git ${server_type}", environment => [ "REPO_USER=${keydb_user}", "REPO_GROUP=${keydb_group}", "REPO_ON_UPDATE=${keydb_home}/on_update.sh" ], # This command will need to run "on_update" as root in order to restart the service. user => root, diff --git a/manifests/broker.pp b/manifests/broker.pp index 381fc4edc0d3e1197d032aa960eaa6cf15916776..685314359d8e28c0549bd0ee1209dccdb7875a31 100644 --- a/manifests/broker.pp +++ b/manifests/broker.pp @@ -17,11 +17,11 @@ class aes::broker { # Figure out which certificate to use based on the hostname. if $facts[fqdn] == 'aes.edu.liu.se' { - $key_prefix = "production" + $server_type = "production" } elsif $facts[fqdn] == 'aes-devel.edu.liu.se' { - $key_prefix = "devel" + $server_type = "devel" } else { - $key_prefix = undef + $server_type = undef } user { "${broker_user}" : @@ -69,7 +69,7 @@ class aes::broker { owner => "${broker_user}", group => "${broker_group}", mode => '0700', - source => "puppet:///modules/${module_name}/broker/cert/${key_prefix}_cert.pem" + source => "puppet:///modules/${module_name}/broker/cert/${server_type}_cert.pem" } file { "${broker_home}/ssl/key.pem" : @@ -77,7 +77,7 @@ class aes::broker { owner => "${broker_user}", group => "${broker_group}", mode => '0700', - source => "puppet:///modules/${module_name}/broker/cert/${key_prefix}_key.pem" + source => "puppet:///modules/${module_name}/broker/cert/${server_type}_key.pem" } file { "${broker_home}/ssl/password" : @@ -85,11 +85,11 @@ class aes::broker { owner => "${broker_user}", group => "${broker_group}", mode => '0700', - source => "puppet:///modules/${module_name}/broker/cert/${key_prefix}_password" + source => "puppet:///modules/${module_name}/broker/cert/${server_type}_password" } exec { 'update-broker-repo' : - command => "/opt/utils/update_repo.sh ${broker_home}/src https://oauth2:F-agHaRXCdyFy38q4c-N@gitlab.liu.se/upp-aes/communication.git production", + command => "/opt/utils/update_repo.sh ${broker_home}/src https://oauth2:F-agHaRXCdyFy38q4c-N@gitlab.liu.se/upp-aes/communication.git ${server_type}", environment => [ "REPO_USER=${broker_user}", "REPO_GROUP=${broker_group}", "REPO_ON_UPDATE=${broker_home}/on_update.sh" ], # This command will need to run "on_update" as root in order to restart the service. user => root,