FAQ
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 (
   $radius_ip,
   $fw_ip,
   $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---
classes:
     common:
       fw_ip: '10.50.1.1'
       radius_ip: '10.50.1.12'
       zabbix_ip: '10.50.1.11'
     apache:
     ntp:
     maradns:
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 @
categoriespuppet
postedMay 3, '13 at 1:56a
activeMay 6, '13 at 12:55a
posts4
users4
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase