Ask Your Question
0

Puppet IIS Module Question

asked 2013-08-15 15:19:24 -0500

louis gravatar image

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 ... (more)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-08-16 00:15:52 -0500

there are many ways to do this. You can also iterate through defines. or use hiera to lookup values that are just keynames for other values.

I might do this:

in your manifest

$apppools = hiera('apppools', [])
create_resources('iis_apppool',$apppools)

in your yaml

apppools:
  pool1:
     managedpipelinemode:   'Classic'
     managedruntimeversion:  'v2.0'
  pool2:
     managedpipelinemode:   'Classic'
     managedruntimeversion:  'v2.0'
edit flag offensive delete link more

Comments

you can probably use yaml merge keys and have a single set of defaults ... see some usage here http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/ or visit the yaml spec docs

rismoney gravatar imagerismoney ( 2013-08-16 00:25:45 -0500 )edit

The hiera create_resources helped a lot. Posting my answer to this problem in a few.

louis gravatar imagelouis ( 2013-08-16 10:37:27 -0500 )edit
0

answered 2013-08-16 12:44:51 -0500

louis gravatar image

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"
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-08-15 15:19:24 -0500

Seen: 800 times

Last updated: Aug 16 '13