Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Puppet IIS Module Question

Hi,

I am using the IIS Puppet Module https://forge.puppetlabs.com/simondean/iis in order to set the application provisioning and also using hiera to abstract some data out of the puppet manifest. In this case, i am not using Puppet as a classic (keep the state of the server) feature but using it a a runtime (puppet apply)

Goal:

To provision IIS Structure (Cleanup and Create)

Rakefile:

task :run do
 sh "puppet apply cleanup.pp --modulepath=modules --hiera_config=hiera/hiera.yaml"
 sh "puppet apply provision.pp --modulepath=modules --hiera_config=hiera/hiera.yaml"
end

Environment: Puppet version 3.x

I have defined the list of application pools that i need to create by using a yaml file.

---
apppools:
  - 'Pool1'
  - 'Pool2'
  - 'Pool3'
  - 'Pooln'
....

Some code of provision.pp

$apppools = hiera_array('apppools')

 iis_apppool { $apppools :
    ensure                    => present,
    managedpipelinemode       => 'Classic',
    managedruntimeversion     => 'v2.0',
    processmodel_identitytype => 'LocalSystem' 
  }

Since we have different application pools using different managedpipelinemode managedruntimeversion and processmodel_identitytype values. Is it possible to change the YAML file in order to have only one resource iis_apppool that uses this as variables?

Something Like:

 iis_apppool { $apppools :
        ensure                    => present,
        managedpipelinemode       => '$apppools::pipepilinemode,  ##not sure if it works
        managedruntimeversion     => '$apppools::runtimeversion',  ##not sure if it works
        processmodel_identitytype => '$apppools::identitytype'        ##not sure if it works
      }

The idea is to change the yaml file in order to have a much simple resource module on my .pp file.

Some Ideal YAML file...

---
apppools:
  - 'Pool1'
    pipelinemode : value
    managedruntimeversion :value
  - 'Pool2'
    pipepilinemode : value
    managedruntimeversion: value
  - 'Pool3'
    pipepilinemode : value
    managedruntimeversion : value
  - 'Pooln'

....

The other solution might be to use ruby inside my .pp file? Just looking for suggestions...