Could not autoload puppet/type/dism Error on running puppet script

455 views Asked by At

Puppet Agent - 64 bit v4.0.0 OS- Windows Server R2 64 bit

I am trying to install IIS by using DISM module (https://forge.puppetlabs.com/puppetlabs/dism) from Puppet site.

I am trying to run the following script. Im sure it is correct.

    dism { 
        'IIS-WebServerRole': ensure => present,
    }       

    dism {
        'IIS-WebServer': ensure => present,
    }   

The module is correctly installed and I have tried re-installing it several times but I get the the error mentioned below repeatedly. How do I resolve this ?

Im using Puppet

C:\Program Files\Puppet Labs\Puppet\bin>puppet apply IIS_Install.pp Error: Could not autoload puppet/type/dism: Attempt to redefine method set_present with block Error: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/dism: Attempt to redefine method set_pesent with block at C:/Program Files/Puppet Labs/Puppet/bin/IIS_Install.pp:2:3 on node win-i73ju1hai2q.localdomain Error: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/dism: Attempt to redefine method set_pesent with block at C:/Program Files/Puppet Labs/Puppet/bin/IIS_Install.pp:2:3 on node win-i73ju1hai2q.localdomain

1

There are 1 answers

2
ferventcoder On

Try ensure => 'present'

The error isn't very helpful, but I think it might be Puppet v4 and how the parser is different and more strict.

If that doesn't work, make sure that you should be using ensure at all. Not all resources are ensurable.