Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-2966

DSC - File Resource with "ensure" Set to "absent" Does not Remove File

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: dsc
    • Labels:
    • Environment:

      Module Version: 0.8.1-b20015-b7745747
      Puppet Agent Version: 1.3.2 (Gold)
      Agent: Windows 2012 R2 x64

    • Template:
    • Epic Link:
    • Team:
      Modules

      Description

      Description

      If a user specifies "ensure" with the value "absent" for a DSC file resource the file will not be removed, but Puppet will report that the file has been successfully removed:

      Notice: Compiled catalog for w2012r2.vm in environment production in 0.09 second
      s
      Notice: /Stage[main]/Main/Dsc_file[test]/ensure: removed
      Notice: Applied catalog in 8.26 seconds

      Attachments

      • None

      Repro Steps

      1. Install Puppet Agent on the Windows agent nodes.
      2. Install DSC module from the modules staging Forge on the agent nodes:

        puppet module install puppetlabs-dsc --module_repository https://api-module-staging.puppetlabs.com --version 0.8.1-b20015-b7745747

      3. Apply the following manifest to create the file on the SUT:

        dsc_file { 'file_test':
          ensure                      => present,
          dsc_destinationpath => 'C:\test.file',
          dsc_contents            => 'Test'
        }

      4. Apply the following manifest to REMOVE the file on the SUT:

        dsc_file { 'file_test':
          ensure                      => absent,
          dsc_destinationpath => 'C:\test.file',
          dsc_contents            => 'Test'
        }

      5. Verify if file doesn't exist:

        Test-Path -Path "C:\test.file"

      Expect

      The PowerShell command should return "False".

      Actual

      The PowerShell command returns true and visual inspection of the system reveals that the file was never removed. Full debug output:

      PS C:\> puppet apply -e "dsc_file { 'test': ensure => present, dsc_destinationpath => 'c:\test.file', dsc_contents => 'T
      est'}"
      Notice: Compiled catalog for w2012r2.vm in environment production in 0.09 seconds
      Notice: /Stage[main]/Main/Dsc_file[test]/ensure: created
      Notice: Applied catalog in 8.26 seconds
      PS C:\> puppet apply --debug -e "dsc_file { 'test': ensure => absent, dsc_destinationpath => 'c:\test.file', dsc_content
      s => 'Test'}"
      Debug: Runtime environment: puppet_version=4.3.1, ruby_version=2.1.7, run_mode=user, default_encoding=IBM437
      Debug: Evicting cache entry for environment 'production'
      Debug: Caching environment 'production' (ttl = 0 sec)
      Debug: Evicting cache entry for environment 'production'
      Debug: Caching environment 'production' (ttl = 0 sec)
      Debug: Loading external facts from C:/ProgramData/PuppetLabs/puppet/cache/facts.d
      Info: Loading facts
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/aio_agent_build.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/aio_agent_version.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/custom_auth_conf.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/facter_dot_d.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/package_provider.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/pe_build.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/pe_concat_basedir.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/pe_razor_server_version.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/pe_server_version.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/pe_version.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/platform_symlink_writable.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/platform_tag.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/powershell_version.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/puppet_files_dir_present.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/puppet_vardir.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/root_home.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/service_provider.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/staging_http_get.rb
      Debug: Loading facts from C:/ProgramData/PuppetLabs/puppet/cache/lib/facter/windows.rb
      Debug: Facter: fact "facterversion" has resolved to "3.1.3".
      Debug: Facter: initializing WMI
      Debug: Facter: searching "C:/ProgramData\PuppetLabs\facter\facts.d" for external facts.
      Debug: Facter: searching "C:/ProgramData\PuppetLabs\puppet\cache\facts.d" for external facts.
      Debug: Facter: no external facts were found.
      Debug: Facter: setting fact "env_windows_installdir" based on the value of environment variable "FACTER_env_windows_inst
      alldir".
      Debug: Facter: fact "env_windows_installdir" has resolved to "C:\Program Files\Puppet Labs\Puppet".
      Debug: Facter: loading all custom facts.
      Debug: Facter: searching for custom facts in C:/ProgramData\PuppetLabs\puppet\cache\lib\facter.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\aio_agent_build.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\aio_agent_version.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\custom_auth_conf.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\facter_dot_d.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\package_provider.rb.
      Debug: Evicting cache entry for environment 'production'
      Debug: Caching environment 'production' (ttl = 0 sec)
      Debug: Evicting cache entry for environment 'production'
      Debug: Caching environment 'production' (ttl = 0 sec)
      Debug: Evicting cache entry for environment 'production'
      Debug: Caching environment 'production' (ttl = 0 sec)
      Debug: Evicting cache entry for environment 'production'
      Debug: Caching environment 'production' (ttl = 0 sec)
      Debug: Evicting cache entry for environment 'production'
      Debug: Caching environment 'production' (ttl = 0 sec)
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\pe_build.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\pe_concat_basedir.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\pe_razor_server_version.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\pe_server_version.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\pe_version.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\platform_symlink_writable.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\platform_tag.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\powershell_version.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\puppet_files_dir_present.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\puppet_vardir.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\root_home.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\service_provider.rb.
      Debug: Evicting cache entry for environment 'production'
      Debug: Caching environment 'production' (ttl = 0 sec)
      Debug: Evicting cache entry for environment 'production'
      Debug: Caching environment 'production' (ttl = 0 sec)
      Debug: Facter: searching for custom fact "operatingsystem".
      Debug: Facter: searching for operatingsystem.rb in C:/ProgramData\PuppetLabs\puppet\cache\lib\facter.
      Debug: Facter: searching for operatingsystem.rb in C:/ProgramData\PuppetLabs\puppet\cache\lib\facter.
      Debug: Facter: resolving operating system facts.
      Debug: Facter: resolving kernel facts.
      Debug: Facter: fact "kernel" has resolved to "windows".
      Debug: Facter: fact "kernelrelease" has resolved to "6.3.9600".
      Debug: Facter: fact "kernelmajversion" has resolved to "6.3".
      Debug: Facter: fact "kernelversion" has resolved to "6.3.9600".
      Debug: Facter: fact "osfamily" has resolved to "windows".
      Debug: Facter: fact "operatingsystemmajrelease" has resolved to "2012 R2".
      Debug: Facter: fact "operatingsystemrelease" has resolved to "2012 R2".
      Debug: Facter: fact "hardwaremodel" has resolved to "x86_64".
      Debug: Facter: fact "architecture" has resolved to "x64".
      Debug: Facter: fact "operatingsystem" has resolved to "windows".
      Debug: Facter: fact "system32" has resolved to "C:\Windows\system32".
      Debug: Facter: fact "os" has resolved to {
        architecture => "x64",
        family => "windows",
        hardware => "x86_64",
        name => "windows",
        release => {
          full => "2012 R2",
          major => "2012 R2"
        },
        windows => {
          system32 => "C:\Windows\system32"
        }
      }.
      Debug: Facter: searching for custom fact "osfamily".
      Debug: Facter: searching for osfamily.rb in C:/ProgramData\PuppetLabs\puppet\cache\lib\facter.
      Debug: Facter: searching for osfamily.rb in C:/ProgramData\PuppetLabs\puppet\cache\lib\facter.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\staging_http_get.rb.
      Info: Facter: loading custom facts from C:/ProgramData\PuppetLabs\puppet\cache\lib\facter\windows.rb.
      Debug: Facter: searching for custom facts in C:/ProgramData\PuppetLabs\puppet\cache\lib\facter.
      Debug: Facter: fact "agent_specified_environment" has resolved to "production".
      Debug: Facter: fact "aio_agent_build" has resolved to "1.3.2".
      Debug: Facter: fact "aio_agent_version" has resolved to "1.3.2".
      Debug: Facter: fact "common_appdata" has resolved to "C:\ProgramData".
      Debug: Facter: fact "custom_auth_conf" has resolved to false.
      Debug: Facter: fact "puppetversion" has resolved to "4.3.1".
      Debug: Facter: fact "pe_version" resolved to null and will not be added.
      Debug: Facter: fact "is_pe" has resolved to false.
      Debug: Puppet::Type::Package::ProviderAix: file /usr/bin/lslpp does not exist
      Debug: Puppet::Type::Package::ProviderDpkg: file /usr/bin/dpkg does not exist
      Debug: Puppet::Type::Package::ProviderApt: file /usr/bin/apt-get does not exist
      Debug: Puppet::Type::Package::ProviderAptitude: file /usr/bin/aptitude does not exist
      Debug: Puppet::Type::Package::ProviderRpm: file rpm does not exist
      Debug: Puppet::Type::Package::ProviderAptrpm: file apt-get does not exist
      Debug: Puppet::Type::Package::ProviderSun: file /usr/bin/pkginfo does not exist
      Debug: Puppet::Type::Package::ProviderYum: file yum does not exist
      Debug: Puppet::Type::Package::ProviderDnf: file dnf does not exist
      Debug: Puppet::Type::Package::ProviderFink: file /sw/bin/fink does not exist
      Debug: Puppet::Type::Package::ProviderOpenbsd: file pkg_info does not exist
      Debug: Puppet::Type::Package::ProviderFreebsd: file /usr/sbin/pkg_info does not exist
      Debug: Puppet::Type::Package::ProviderHpux: file /usr/sbin/swinstall does not exist
      Debug: Puppet::Type::Package::ProviderNim: file /usr/sbin/nimclient does not exist
      Debug: Puppet::Type::Package::ProviderOpkg: file opkg does not exist
      Debug: Puppet::Type::Package::ProviderPacman: file /usr/bin/pacman does not exist
      Debug: Puppet::Type::Package::ProviderPkg: file /usr/bin/pkg does not exist
      Debug: Puppet::Type::Package::ProviderPkgin: file pkgin does not exist
      Debug: Puppet::Type::Package::ProviderPkgng: file /usr/local/sbin/pkg does not exist
      Debug: Puppet::Type::Package::ProviderPortage: file /usr/bin/emerge does not exist
      Debug: Puppet::Type::Package::ProviderPorts: file /usr/local/sbin/portupgrade does not exist
      Debug: Puppet::Type::Package::ProviderPortupgrade: file /usr/local/sbin/portupgrade does not exist
      Debug: Puppet::Type::Package::ProviderRug: file /usr/bin/rug does not exist
      Debug: Puppet::Type::Package::ProviderSunfreeware: file pkg-get does not exist
      Debug: Puppet::Type::Package::ProviderUp2date: file /usr/sbin/up2date-nox does not exist
      Debug: Puppet::Type::Package::ProviderUrpmi: file urpmi does not exist
      Debug: Puppet::Type::Package::ProviderZypper: file /usr/bin/zypper does not exist
      Debug: /Package[dummy]: Provider windows does not support features virtual_packages; not managing attribute allow_virtua
      l
      Debug: Facter: fact "package_provider" has resolved to "windows".
      Debug: Facter: fact "pe_build" resolved to null and will not be added.
      Debug: Facter: fact "pe_concat_basedir" has resolved to "C:/ProgramData/PuppetLabs/puppet/cache/pe_concat".
      Debug: Facter: fact "pe_major_version" resolved to null and will not be added.
      Debug: Facter: fact "pe_minor_version" resolved to null and will not be added.
      Debug: Facter: fact "pe_patch_version" resolved to null and will not be added.
      Debug: Facter: fact "pe_razor_server_version" resolved to null and will not be added.
      Debug: Facter: fact "pe_server_version" resolved to null and will not be added.
      Debug: Facter: fact "platform_symlink_writable" has resolved to false.
      Debug: Facter: fact "platform_tag" resolved to null and will not be added.
      Debug: Facter: fact "powershell_version" has resolved to "5.0.10514.6".
      Debug: Facter: fact "puppet_files_dir_present" has resolved to false.
      Debug: Facter: fact "puppet_vardir" has resolved to "C:/ProgramData/PuppetLabs/puppet/cache".
      Debug: Facter: fact "root_home" resolved to null and will not be added.
      Debug: Puppet::Type::Service::ProviderBase: file kill does not exist
      Debug: Puppet::Type::Service::ProviderDaemontools: file /usr/bin/svc does not exist
      Debug: Puppet::Type::Service::ProviderDebian: file /usr/sbin/update-rc.d does not exist
      Debug: Puppet::Type::Service::ProviderGentoo: file /sbin/rc-update does not exist
      Debug: Puppet::Type::Service::ProviderLaunchd: file /bin/launchctl does not exist
      Debug: Puppet::Type::Service::ProviderOpenbsd: file /usr/sbin/rcctl does not exist
      Debug: Puppet::Type::Service::ProviderOpenrc: file /bin/rc-status does not exist
      Debug: Puppet::Type::Service::ProviderRedhat: file /sbin/chkconfig does not exist
      Debug: Puppet::Type::Service::ProviderRunit: file /usr/bin/sv does not exist
      Debug: Puppet::Type::Service::ProviderSystemd: file systemctl does not exist
      Debug: Puppet::Type::Service::ProviderUpstart: 0 confines (of 4) were true
      Debug: Facter: fact "service_provider" has resolved to "windows".
      Debug: Facter: fact "staging_http_get" resolved to null and will not be added.
      Debug: Facter: resolving ruby facts.
      Debug: Facter: fact "rubyplatform" has resolved to "x64-mingw32".
      Debug: Facter: fact "rubysitedir" has resolved to "C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0
      ".
      Debug: Facter: fact "rubyversion" has resolved to "2.1.7".
      Debug: Facter: fact "ruby" has resolved to {
        platform => "x64-mingw32",
        sitedir => "C:/Program Files/Puppet Labs/Puppet/sys/ruby/lib/ruby/site_ruby/2.1.0",
        version => "2.1.7"
      }.
      Debug: Facter: resolving path facts.
      Debug: Facter: fact "path" has resolved to "C:/Program Files/Puppet Labs/Puppet/facter/bin;C:\Program Files\Puppet Labs\
      Puppet\puppet\bin;C:\Program Files\Puppet Labs\Puppet\facter\bin;C:\Program Files\Puppet Labs\Puppet\hiera\bin;C:\Progra
      m Files\Puppet Labs\Puppet\mcollective\bin;C:\Program Files\Puppet Labs\Puppet\bin;C:\Program Files\Puppet Labs\Puppet\s
      ys\ruby\bin;C:\Program Files\Puppet Labs\Puppet\sys\tools\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:
      \Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Puppet Labs\Puppet\bin".
      Debug: Facter: resolving EC2 facts.
      Debug: Facter: resolving virtualization facts.
      Debug: Facter: fact "is_virtual" has resolved to true.
      Debug: Facter: fact "virtual" has resolved to "virtualbox".
      Debug: Facter: EC2 facts are unavailable: not running under an EC2 instance.
      Debug: Facter: resolving GCE facts.
      Debug: Facter: not running under a GCE instance.
      Debug: Facter: resolving augeas facts.
      Debug: Facter: executing command: augparse --version
      Debug: Facter: augparse was not found on the PATH.
      Debug: Facter: resolving id facts.
      Debug: Facter: fact "id" has resolved to "W2012R2\Administrator".
      Debug: Facter: fact "identity" has resolved to {
        user => "W2012R2\Administrator"
      }.
      Debug: Facter: resolving memory facts.
      Debug: Facter: fact "memoryfree" has resolved to "1.23 GiB".
      Debug: Facter: fact "memoryfree_mb" has resolved to 1260.95.
      Debug: Facter: fact "memorysize" has resolved to "2.00 GiB".
      Debug: Facter: fact "memorysize_mb" has resolved to 2047.55.
      Debug: Facter: fact "memory" has resolved to {
        system => {
          available => "1.23 GiB",
          available_bytes => 1322196992,
          capacity => "38.42%",
          total => "2.00 GiB",
          total_bytes => 2147016704,
          used => "786.61 MiB",
          used_bytes => 824819712
        }
      }.
      Debug: Facter: resolving networking facts.
      Debug: Facter: initializing Winsock
      Debug: Facter: fact "ipaddress_NAT" has resolved to "10.0.19.49".
      Debug: Facter: fact "ipaddress" has resolved to "10.0.19.49".
      Debug: Facter: fact "netmask_NAT" has resolved to "255.255.252.0".
      Debug: Facter: fact "netmask" has resolved to "255.255.252.0".
      Debug: Facter: fact "network_NAT" has resolved to "10.0.16.0".
      Debug: Facter: fact "network" has resolved to "10.0.16.0".
      Debug: Facter: fact "ipaddress6_NAT" has resolved to "fe80::2ca1:9211:90ae:2657%15".
      Debug: Facter: fact "ipaddress6" has resolved to "fe80::2ca1:9211:90ae:2657%15".
      Debug: Facter: fact "netmask6_NAT" has resolved to "ffff:ffff:ffff:ffff::".
      Debug: Facter: fact "netmask6" has resolved to "ffff:ffff:ffff:ffff::".
      Debug: Facter: fact "network6_NAT" has resolved to "fe80::%15".
      Debug: Facter: fact "network6" has resolved to "fe80::%15".
      Debug: Facter: fact "macaddress_NAT" has resolved to "08:00:27:62:A1:D4".
      Debug: Facter: fact "macaddress" has resolved to "08:00:27:62:A1:D4".
      Debug: Facter: fact "mtu_NAT" has resolved to 1500.
      Debug: Facter: fact "ipaddress_Host-only" has resolved to "192.168.56.103".
      Debug: Facter: fact "netmask_Host-only" has resolved to "255.255.255.0".
      Debug: Facter: fact "network_Host-only" has resolved to "192.168.56.0".
      Debug: Facter: fact "ipaddress6_Host-only" has resolved to "fe80::7973:9213:2a45:d948%12".
      Debug: Facter: fact "netmask6_Host-only" has resolved to "ffff:ffff:ffff:ffff::".
      Debug: Facter: fact "network6_Host-only" has resolved to "fe80::%12".
      Debug: Facter: fact "macaddress_Host-only" has resolved to "08:00:27:D7:27:16".
      Debug: Facter: fact "mtu_Host-only" has resolved to 1500.
      Debug: Facter: fact "hostname" has resolved to "w2012r2".
      Debug: Facter: fact "domain" has resolved to "corp.puppetlabs.net".
      Debug: Facter: fact "fqdn" has resolved to "w2012r2.corp.puppetlabs.net".
      Debug: Facter: fact "interfaces" has resolved to "NAT,Host-only".
      Debug: Facter: fact "dhcp_servers" has resolved to {
        Host-only => "192.168.56.1",
        NAT => "10.0.22.11",
        system => "10.0.22.11"
      }.
      Debug: Facter: fact "networking" has resolved to {
        dhcp => "10.0.22.11",
        domain => "corp.puppetlabs.net",
        fqdn => "w2012r2.corp.puppetlabs.net",
        hostname => "w2012r2",
        interfaces => {
          Host-only => {
            bindings => [
              {
                address => "192.168.56.103",
                netmask => "255.255.255.0",
                network => "192.168.56.0"
              }
            ],
            bindings6 => [
              {
                address => "fe80::7973:9213:2a45:d948%12",
                netmask => "ffff:ffff:ffff:ffff::",
                network => "fe80::%12"
              }
            ],
            dhcp => "192.168.56.1",
            ip => "192.168.56.103",
            ip6 => "fe80::7973:9213:2a45:d948%12",
            mac => "08:00:27:D7:27:16",
            mtu => 1500,
            netmask => "255.255.255.0",
            netmask6 => "ffff:ffff:ffff:ffff::",
            network => "192.168.56.0",
            network6 => "fe80::%12"
          },
          NAT => {
            bindings => [
              {
                address => "10.0.19.49",
                netmask => "255.255.252.0",
                network => "10.0.16.0"
              }
            ],
            bindings6 => [
              {
                address => "fe80::2ca1:9211:90ae:2657%15",
                netmask => "ffff:ffff:ffff:ffff::",
                network => "fe80::%15"
              }
            ],
            dhcp => "10.0.22.11",
            ip => "10.0.19.49",
            ip6 => "fe80::2ca1:9211:90ae:2657%15",
            mac => "08:00:27:62:A1:D4",
            mtu => 1500,
            netmask => "255.255.252.0",
            netmask6 => "ffff:ffff:ffff:ffff::",
            network => "10.0.16.0",
            network6 => "fe80::%15"
          }
        },
        ip => "10.0.19.49",
        ip6 => "fe80::2ca1:9211:90ae:2657%15",
        mac => "08:00:27:62:A1:D4",
        mtu => 1500,
        netmask => "255.255.252.0",
        netmask6 => "ffff:ffff:ffff:ffff::",
        network => "10.0.16.0",
        network6 => "fe80::%15",
        primary => "NAT"
      }.
      Debug: Facter: resolving timezone facts.
      Debug: Facter: fact "timezone" has resolved to "Pacific Standard Time".
      Debug: Facter: resolving desktop management interface facts.
      Debug: Facter: fact "productname" has resolved to "VirtualBox".
      Debug: Facter: fact "serialnumber" has resolved to "0".
      Debug: Facter: fact "manufacturer" has resolved to "innotek GmbH".
      Debug: Facter: fact "dmi" has resolved to {
        manufacturer => "innotek GmbH",
        product => {
          name => "VirtualBox",
          serial_number => "0"
        }
      }.
      Debug: Facter: resolving processor facts.
      Debug: Facter: fact "hardwareisa" has resolved to "x64".
      Debug: Facter: fact "processorcount" has resolved to 1.
      Debug: Facter: fact "physicalprocessorcount" has resolved to 1.
      Debug: Facter: fact "processor0" has resolved to "Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz".
      Debug: Facter: fact "processors" has resolved to {
        count => 1,
        isa => "x64",
        models => [
          "Intel(R) Core(TM) i7-3740QM CPU @ 2.70GHz"
        ],
        physicalcount => 1
      }.
      Debug: Facter: resolving uptime facts.
      Debug: Facter: fact "uptime_seconds" has resolved to 7553.
      Debug: Facter: fact "uptime_hours" has resolved to 2.
      Debug: Facter: fact "uptime_days" has resolved to 0.
      Debug: Facter: fact "uptime" has resolved to "2:05 hours".
      Debug: Facter: fact "system_uptime" has resolved to {
        days => 0,
        hours => 2,
        seconds => 7553,
        uptime => "2:05 hours"
      }.
      Debug: Evicting cache entry for environment 'production'
      Debug: Caching environment 'production' (ttl = 0 sec)
      Notice: Compiled catalog for w2012r2.vm in environment production in 0.09 seconds
      Debug: Creating default schedules
      Debug: Loaded state in 0.02 seconds
      Debug: Loaded state in 0.03 seconds
      Info: Applying configuration version '1452633939'
      Debug: Reloading posix reboot provider
      Debug: PowerShell Version: 5.0.10514.6
      Debug:
      $script:ErrorActionPreference = 'Stop'
      $script:WarningPreference     = 'SilentlyContinue'
       
      function new-pscredential
      {
        [CmdletBinding()]
        param (
          [parameter(Mandatory=$true,
            ValueFromPipelineByPropertyName=$true)]
          [string]
          $user,
       
          [parameter(Mandatory=$true,
            ValueFromPipelineByPropertyName=$true)]
          [string]
          $password
        )
       
        $secpasswd   = ConvertTo-SecureString $password -AsPlainText -Force
        $credentials = New-Object System.Management.Automation.PSCredential ($user, $secpasswd)
        return $credentials
      }
       
      $response = @{
        indesiredstate = $false
        rebootrequired = $false
        errormessage   = ''
      }
       
      $invokeParams = @{
        Name          = 'File'
        Method        = 'test'
        Property      = @{
          destinationpath = 'c:\test.file'
          contents = 'Test'
        }
        ModuleName = "PSDesiredStateConfiguration"
      }
       
      try{
          $result = Invoke-DscResource @invokeParams
      }catch{
        $response.errormessage   = $_.Exception.Message
        return ($response | ConvertTo-Json -Compress)
      }
       
      # keep the switch for when Test passes back changed properties
      switch ($invokeParams.Method) {
        'Test' {
          $response.indesiredstate = $result.InDesiredState
          return ($response | ConvertTo-Json -Compress)
        }
        'Set' {
          $response.indesiredstate = $true
          $response.rebootrequired = $result.RebootRequired
          return ($response | ConvertTo-Json -Compress)
        }
      }
       
      Debug: Executing: 'C:\Windows\system32\WindowsPowershell\v1.0\powershell.exe -NoProfile -NonInteractive -NoLogo -Executi
      onPolicy Bypass -Command $script:ErrorActionPreference = 'Stop'
      $script:WarningPreference     = 'SilentlyContinue'
       
      function new-pscredential
      {
        [CmdletBinding()]
        param (
          [parameter(Mandatory=$true,
            ValueFromPipelineByPropertyName=$true)]
          [string]
          $user,
       
          [parameter(Mandatory=$true,
            ValueFromPipelineByPropertyName=$true)]
          [string]
          $password
        )
       
        $secpasswd   = ConvertTo-SecureString $password -AsPlainText -Force
        $credentials = New-Object System.Management.Automation.PSCredential ($user, $secpasswd)
        return $credentials
      }
       
      $response = @{
        indesiredstate = $false
        rebootrequired = $false
        errormessage   = ''
      }
       
      $invokeParams = @{
        Name          = 'File'
        Method        = 'test'
        Property      = @{
          destinationpath = 'c:\test.file'
          contents = 'Test'
        }
        ModuleName = "PSDesiredStateConfiguration"
      }
       
      try{
          $result = Invoke-DscResource @invokeParams
      }catch{
        $response.errormessage   = $_.Exception.Message
        return ($response | ConvertTo-Json -Compress)
      }
       
      # keep the switch for when Test passes back changed properties
      switch ($invokeParams.Method) {
        'Test' {
          $response.indesiredstate = $result.InDesiredState
          return ($response | ConvertTo-Json -Compress)
        }
        'Set' {
          $response.indesiredstate = $true
          $response.rebootrequired = $result.RebootRequired
          return ($response | ConvertTo-Json -Compress)
        }
      }
      '
      Debug: Dsc Resource returned: {"rebootrequired":false,"indesiredstate":true,"errormessage":""}
       
      Debug: Dsc Resource Exists?: true
      Debug: ensure: absent
      Debug:
      $script:ErrorActionPreference = 'Stop'
      $script:WarningPreference     = 'SilentlyContinue'
       
      function new-pscredential
      {
        [CmdletBinding()]
        param (
          [parameter(Mandatory=$true,
            ValueFromPipelineByPropertyName=$true)]
          [string]
          $user,
       
          [parameter(Mandatory=$true,
            ValueFromPipelineByPropertyName=$true)]
          [string]
          $password
        )
       
        $secpasswd   = ConvertTo-SecureString $password -AsPlainText -Force
        $credentials = New-Object System.Management.Automation.PSCredential ($user, $secpasswd)
        return $credentials
      }
       
      $response = @{
        indesiredstate = $false
        rebootrequired = $false
        errormessage   = ''
      }
       
      $invokeParams = @{
        Name          = 'File'
        Method        = 'set'
        Property      = @{
          destinationpath = 'c:\test.file'
          contents = 'Test'
        }
        ModuleName = "PSDesiredStateConfiguration"
      }
       
      try{
          $result = Invoke-DscResource @invokeParams
      }catch{
        $response.errormessage   = $_.Exception.Message
        return ($response | ConvertTo-Json -Compress)
      }
       
      # keep the switch for when Test passes back changed properties
      switch ($invokeParams.Method) {
        'Test' {
          $response.indesiredstate = $result.InDesiredState
          return ($response | ConvertTo-Json -Compress)
        }
        'Set' {
          $response.indesiredstate = $true
          $response.rebootrequired = $result.RebootRequired
          return ($response | ConvertTo-Json -Compress)
        }
      }
       
      Debug: Executing: 'C:\Windows\system32\WindowsPowershell\v1.0\powershell.exe -NoProfile -NonInteractive -NoLogo -Executi
      onPolicy Bypass -Command $script:ErrorActionPreference = 'Stop'
      $script:WarningPreference     = 'SilentlyContinue'
       
      function new-pscredential
      {
        [CmdletBinding()]
        param (
          [parameter(Mandatory=$true,
            ValueFromPipelineByPropertyName=$true)]
          [string]
          $user,
       
          [parameter(Mandatory=$true,
            ValueFromPipelineByPropertyName=$true)]
          [string]
          $password
        )
       
        $secpasswd   = ConvertTo-SecureString $password -AsPlainText -Force
        $credentials = New-Object System.Management.Automation.PSCredential ($user, $secpasswd)
        return $credentials
      }
       
      $response = @{
        indesiredstate = $false
        rebootrequired = $false
        errormessage   = ''
      }
       
      $invokeParams = @{
        Name          = 'File'
        Method        = 'set'
        Property      = @{
          destinationpath = 'c:\test.file'
          contents = 'Test'
        }
        ModuleName = "PSDesiredStateConfiguration"
      }
       
      try{
          $result = Invoke-DscResource @invokeParams
      }catch{
        $response.errormessage   = $_.Exception.Message
        return ($response | ConvertTo-Json -Compress)
      }
       
      # keep the switch for when Test passes back changed properties
      switch ($invokeParams.Method) {
        'Test' {
          $response.indesiredstate = $result.InDesiredState
          return ($response | ConvertTo-Json -Compress)
        }
        'Set' {
          $response.indesiredstate = $true
          $response.rebootrequired = $result.RebootRequired
          return ($response | ConvertTo-Json -Compress)
        }
      }
      '
      Debug: Destroy Dsc Resource returned: {"rebootrequired":false,"indesiredstate":true,"errormessage":""}
       
      Notice: /Stage[main]/Main/Dsc_file[test]/ensure: removed
      Debug: /Stage[main]/Main/Dsc_file[test]: The container Class[Main] will propagate my refresh event
      Debug: Class[Main]: The container Stage[main] will propagate my refresh event
      Debug: Finishing transaction 29129920
      Debug: Storing state
      Debug: Stored state in 0.03 seconds
      Notice: Applied catalog in 8.35 seconds
      Debug: Applying settings catalog for sections main, reporting, metrics
      Debug: Using settings: adding file resource 'confdir': 'File[C:/ProgramData/PuppetLabs/puppet/etc]{:path=>"C:/ProgramDat
      a/PuppetLabs/puppet/etc", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
      Debug: Using settings: adding file resource 'codedir': 'File[C:/ProgramData/PuppetLabs/code]{:path=>"C:/ProgramData/Pupp
      etLabs/code", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
      Debug: Using settings: adding file resource 'vardir': 'File[C:/ProgramData/PuppetLabs/puppet/cache]{:path=>"C:/ProgramDa
      ta/PuppetLabs/puppet/cache", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
      Debug: Using settings: adding file resource 'logdir': 'File[C:/ProgramData/PuppetLabs/puppet/var/log]{:path=>"C:/Program
      Data/PuppetLabs/puppet/var/log", :mode=>"750", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
       
      Debug: Using settings: adding file resource 'statedir': 'File[C:/ProgramData/PuppetLabs/puppet/cache/state]{:path=>"C:/P
      rogramData/PuppetLabs/puppet/cache/state", :mode=>"1755", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :back
      up=>false}'
      Debug: Using settings: adding file resource 'rundir': 'File[C:/ProgramData/PuppetLabs/puppet/var/run]{:path=>"C:/Program
      Data/PuppetLabs/puppet/var/run", :mode=>"755", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
       
      Debug: Using settings: adding file resource 'libdir': 'File[C:/ProgramData/PuppetLabs/puppet/cache/lib]{:path=>"C:/Progr
      amData/PuppetLabs/puppet/cache/lib", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
      Debug: Using settings: adding file resource 'hiera_config': 'File[C:/ProgramData/PuppetLabs/code/hiera.yaml]{:path=>"C:/
      ProgramData/PuppetLabs/code/hiera.yaml", :ensure=>:file, :loglevel=>:debug, :links=>:follow, :backup=>false}'
      Debug: Using settings: adding file resource 'preview_outputdir': 'File[C:/ProgramData/PuppetLabs/puppet/cache/preview]{:
      path=>"C:/ProgramData/PuppetLabs/puppet/cache/preview", :mode=>"750", :ensure=>:directory, :loglevel=>:debug, :links=>:f
      ollow, :backup=>false}'
      Debug: Using settings: adding file resource 'certdir': 'File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/certs]{:path=>"C:/
      ProgramData/PuppetLabs/puppet/etc/ssl/certs", :mode=>"755", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :ba
      ckup=>false}'
      Debug: Using settings: adding file resource 'ssldir': 'File[C:/ProgramData/PuppetLabs/puppet/etc/ssl]{:path=>"C:/Program
      Data/PuppetLabs/puppet/etc/ssl", :mode=>"771", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>false}'
       
      Debug: Using settings: adding file resource 'publickeydir': 'File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/public_keys]{
      :path=>"C:/ProgramData/PuppetLabs/puppet/etc/ssl/public_keys", :mode=>"755", :ensure=>:directory, :loglevel=>:debug, :li
      nks=>:follow, :backup=>false}'
      Debug: Using settings: adding file resource 'requestdir': 'File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/certificate_req
      uests]{:path=>"C:/ProgramData/PuppetLabs/puppet/etc/ssl/certificate_requests", :mode=>"755", :ensure=>:directory, :logle
      vel=>:debug, :links=>:follow, :backup=>false}'
      Debug: Using settings: adding file resource 'privatekeydir': 'File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/private_keys
      ]{:path=>"C:/ProgramData/PuppetLabs/puppet/etc/ssl/private_keys", :mode=>"750", :ensure=>:directory, :loglevel=>:debug,
      :links=>:follow, :backup=>false}'
      Debug: Using settings: adding file resource 'privatedir': 'File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/private]{:path=
      >"C:/ProgramData/PuppetLabs/puppet/etc/ssl/private", :mode=>"750", :ensure=>:directory, :loglevel=>:debug, :links=>:foll
      ow, :backup=>false}'
      Debug: Using settings: adding file resource 'hostcert': 'File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/certs/w2012r2.vm.
      pem]{:path=>"C:/ProgramData/PuppetLabs/puppet/etc/ssl/certs/w2012r2.vm.pem", :mode=>"644", :ensure=>:file, :loglevel=>:d
      ebug, :links=>:follow, :backup=>false}'
      Debug: Using settings: adding file resource 'hostprivkey': 'File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/private_keys/w
      2012r2.vm.pem]{:path=>"C:/ProgramData/PuppetLabs/puppet/etc/ssl/private_keys/w2012r2.vm.pem", :mode=>"640", :ensure=>:fi
      le, :loglevel=>:debug, :links=>:follow, :backup=>false}'
      Debug: Using settings: adding file resource 'hostpubkey': 'File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/public_keys/w20
      12r2.vm.pem]{:path=>"C:/ProgramData/PuppetLabs/puppet/etc/ssl/public_keys/w2012r2.vm.pem", :mode=>"644", :ensure=>:file,
       :loglevel=>:debug, :links=>:follow, :backup=>false}'
      Debug: Using settings: adding file resource 'localcacert': 'File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/certs/ca.pem]{
      :path=>"C:/ProgramData/PuppetLabs/puppet/etc/ssl/certs/ca.pem", :mode=>"644", :ensure=>:file, :loglevel=>:debug, :links=
      >:follow, :backup=>false}'
      Debug: Using settings: adding file resource 'hostcrl': 'File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/crl.pem]{:path=>"C
      :/ProgramData/PuppetLabs/puppet/etc/ssl/crl.pem", :mode=>"644", :ensure=>:file, :loglevel=>:debug, :links=>:follow, :bac
      kup=>false}'
      Debug: Using settings: adding file resource 'pluginfactdest': 'File[C:/ProgramData/PuppetLabs/puppet/cache/facts.d]{:pat
      h=>"C:/ProgramData/PuppetLabs/puppet/cache/facts.d", :ensure=>:directory, :loglevel=>:debug, :links=>:follow, :backup=>f
      alse}'
      Debug: /File[C:/ProgramData/PuppetLabs/puppet/cache/state]: Adding autorequire relationship with File[C:/ProgramData/Pup
      petLabs/puppet/cache]
      Debug: /File[C:/ProgramData/PuppetLabs/puppet/cache/lib]: Adding autorequire relationship with File[C:/ProgramData/Puppe
      tLabs/puppet/cache]
      Debug: /File[C:/ProgramData/PuppetLabs/code/hiera.yaml]: Adding autorequire relationship with File[C:/ProgramData/Puppet
      Labs/code]
      Debug: /File[C:/ProgramData/PuppetLabs/puppet/cache/preview]: Adding autorequire relationship with File[C:/ProgramData/P
      uppetLabs/puppet/cache]
      Debug: /File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/certs]: Adding autorequire relationship with File[C:/ProgramData/P
      uppetLabs/puppet/etc/ssl]
      Debug: /File[C:/ProgramData/PuppetLabs/puppet/etc/ssl]: Adding autorequire relationship with File[C:/ProgramData/PuppetL
      abs/puppet/etc]
      Debug: /File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/public_keys]: Adding autorequire relationship with File[C:/Program
      Data/PuppetLabs/puppet/etc/ssl]
      Debug: /File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/certificate_requests]: Adding autorequire relationship with File[C
      :/ProgramData/PuppetLabs/puppet/etc/ssl]
      Debug: /File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/private_keys]: Adding autorequire relationship with File[C:/Progra
      mData/PuppetLabs/puppet/etc/ssl]
      Debug: /File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/private]: Adding autorequire relationship with File[C:/ProgramData
      /PuppetLabs/puppet/etc/ssl]
      Debug: /File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/certs/w2012r2.vm.pem]: Adding autorequire relationship with File[C
      :/ProgramData/PuppetLabs/puppet/etc/ssl/certs]
      Debug: /File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/private_keys/w2012r2.vm.pem]: Adding autorequire relationship with
       File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/private_keys]
      Debug: /File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/public_keys/w2012r2.vm.pem]: Adding autorequire relationship with
      File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/public_keys]
      Debug: /File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/certs/ca.pem]: Adding autorequire relationship with File[C:/Progra
      mData/PuppetLabs/puppet/etc/ssl/certs]
      Debug: /File[C:/ProgramData/PuppetLabs/puppet/etc/ssl/crl.pem]: Adding autorequire relationship with File[C:/ProgramData
      /PuppetLabs/puppet/etc/ssl]
      Debug: /File[C:/ProgramData/PuppetLabs/puppet/cache/facts.d]: Adding autorequire relationship with File[C:/ProgramData/P
      uppetLabs/puppet/cache]
      Debug: /File[C:/ProgramData/PuppetLabs/code/environments/production]: Adding autorequire relationship with File[C:/Progr
      amData/PuppetLabs/code]
      Debug: Finishing transaction 18834100
      Debug: Received report to process from w2012r2.vm
      Debug: Evicting cache entry for environment 'production'
      Debug: Caching environment 'production' (ttl = 0 sec)
      Debug: Processing report from w2012r2.vm with processor Puppet::Reports::Store
      PS C:\> Test-Path -Path "C:\test.file"
      True

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ethan Ethan Brown
              Reporter:
              ryan.gard Ryan Gard
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:

                  Zendesk Support