Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Posting my answer and hoping someone gets a benefit of this question.

apppools.yaml

  ---
    var1 : value
    var2: value
    apppools:
      'Pool 1':
        managedpipelinemode: Integrated
        managedruntimeversion: v4.0
        processmodel_identitytype: LocalSystem
      'Pool 2':
        managedpipelinemode: Integrated
        managedruntimeversion: v4.0
        processmodel_identitytype: LocalSystem
      'Pool 3':
        managedpipelinemode: Integrated
        managedruntimeversion: v4.0
        processmodel_identitytype: LocalSystem
      'Pool n':
        managedpipelinemode: Classic
        managedruntimeversion: v2.0
        processmodel_identitytype: LocalSystem

hiera.yaml:

---
:backends:
  - yaml
:hierarchy:
  - apppools

:yaml:
  :datadir: ./hiera

somescript.pp

 $pools = hiera('apppools')
 create_resources('iis_apppool',$pools)

removeall.pp

  $pools = hiera('apppools')
  $sites = hiera('sites')


  each($pools) |$value| { iis_apppool { $value[0] : ensure => absent, } }

Rakefile:

 task :run do
  sh "puppet apply removeall.pp --modulepath=modules --hiera_config=hiera/hiera.yaml --parser future"