no parameter named 'ensure' on File resource using puppet-xmlfile module

asked 2016-03-22 08:50:12 -0600

Seb gravatar image

When using the puppet-xmlfile module on puppetserver version: 2.2.1 with a Windows 2012 R2 node with Puppet 4.3.2 I receive the following error when trying to perform a puppet run:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: no parameter named 'ensure' at 
/etc/puppetlabs/code/environments/my_environment/manifests/default.pp:12 
on File[C:/tmp/] at /etc/puppetlabs/code/environments/my_environment/manifests/default.pp:12 on node xxx

However it runs successfully on the first run after restarting the puppetserver. Every subsequent run fails.

Puppet manifest:

$staging_windir = 'C:/tmp/'
file { $staging_windir:
  ensure => directory,
}

xmlfile { "C:/Path To Existing XML File/config.xml":
    ensure            => present,
    use_existing_file => true,
}

xmlfile_modification { "test" :
    file       => "C:/Path To Existing XML File/config.xml",
    changes  => 'set /Someconfig/State "Enabled"',
}

I cannot see any reason why the build-in Puppet File Type would suddenly loose it's ensure parameter. When I remove the xmlfile types from the manifest the File['C:/tmp/'] works fine again. Any ideas much appreciated.

edit retag flag offensive close merge delete