diff --git a/manifests/multinode.pp b/manifests/multinode.pp index d717239..959475d 100644 --- a/manifests/multinode.pp +++ b/manifests/multinode.pp @@ -27,6 +27,9 @@ class sunetdrive::multinode ( $php_memory_limit_mb = 512 $nodenumber = $::fqdn[9,1] $customers = $tempcustomers - nil + $passwords = $customers.map | $index, $customer | { + hiera("${customer}_mysql_user_password") + } user { 'www-data': ensure => present, system => true } sunet::system_user {'mysql': username => 'mysql', group => 'mysql' } ensure_resource('file', '/opt/nextcloud' , { ensure => directory, recurse => true } ) diff --git a/templates/multinode/proxysql.cnf.erb b/templates/multinode/proxysql.cnf.erb index 97cd3fb..c16b4e7 100644 --- a/templates/multinode/proxysql.cnf.erb +++ b/templates/multinode/proxysql.cnf.erb @@ -120,6 +120,6 @@ mysql_users = ( <%- @customers.each do |index, customer| -%> - { username = "nextcloud_<%= customer %>", password = "<%= hiera(customer.to_s + '_mysql_user_password') %>", default_hostgroup = 10, transaction_persistent = <%= @transaction_persistent %>, active = 1 }, + { username = "nextcloud_<%= customer %>", password = "<%= @passwords[index] %>", default_hostgroup = 10, transaction_persistent = <%= @transaction_persistent %>, active = 1 }, <%- end -%> )