Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Arrays and hiera data

Hi,

I am trying to reorganize a large monolithic hiera data file. What I have been doing is this:

controller_node_ips: &CONTROLLER_NODE_IPS
  - 10.29.103.28
  - 10.29.103.29
  - 10.29.103.30
.
.
.
galera::bind_address: "%{::ipaddress}"
galera::status_password: 'status_password'
galera::galera_servers: *CONTROLLER_NODE_IPS
galera::configure_repo: false
galera::galera_master: "%{hiera('galera_master')}"
galera::root_password: 'XXXX123'
galera::vendor_type: 'IT'
galera::override_options:
   mysqld: 
      'max_connections': 9000
galera::validate::host: 'localhost'

I tried to move the galera parameters to their own file, galera.yaml, so I couldn't use the reference *CONTROLLER_NODE_IPS. My galera.yaml looks like this:

---
galera::bind_address: "%{::ipaddress}"
galera::status_password: 'status_password'
galera::galera_servers: "%{hiera('controller_node_ips')}"
galera::configure_repo: false
galera::galera_master: "%{hiera('galera_master')}"
galera::root_password: 'XXXX123'
galera::vendor_type: 'IT'
galera::override_options:
   mysqld:
      'max_connections': 9000
galera::validate::host: 'localhost'

I can run this on the puppet master.

# hiera galera::galera_servers "::prefix=svl-ost-kilo"
["10.29.103.28", "10.29.103.29", "10.29.103.30"]

but on my puppet agent node I get this error:

Error while evaluating a Function Call, join(): Requires array to work with at /etc/puppetlabs/code/environments/production/modules/galera/manifests/params.pp:6:17 on node