We need to refer to common variables across multiple modules. For example,
our dns module, firewall module and monitoring module need knowledge of our
radius server IP address. Is the correct approach to create a 'common'
class where these variables are defined and then reference them from each
module and create a class dependancy as below. We are using a custom ENC
which outputs the class parameters.

# modules/common/manifest/init.ppclass common (
   $zabbix_ip,) {}
# modules/common/manifest/apache.ppclass apache (
   $fw_ip = $common::fw_ip,
   $zabbix_ip =$common::zabbix_ip,) {
   class { 'common': } ->
   class { 'apache': }}
# modules/common/manifest/maradns.ppclass maradns (
   $radius_ip = $common::radius_ip,
   $fw_ip = $common::vpn_ip,){
   class { 'common': } ->
   class { 'apache': }}
# ENC ouput---
       fw_ip: ''
       radius_ip: ''
       zabbix_ip: ''
environment: production

You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 4 | next ›
Discussion Overview
grouppuppet-users @
postedMay 3, '13 at 1:56a
activeMay 6, '13 at 12:55a



site design / logo © 2022 Grokbase