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

IIS : iis_virtual_directory is not idempotent when name contains slashes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: iis
    • Labels:
      None
    • Environment:

      Windows Server 2012 R2
      IIS Module 4.0
      Puppet 4.10

    • Template:
      MODULES Bug Template
    • Acceptance Criteria:
      Hide

      As an administrator
      I want to be able to use slashes in iis virtual directory's name and title to be idempotent
      So that puppet works consistently

      Show
      As an administrator I want to be able to use slashes in iis virtual directory's name and title to be idempotent So that puppet works consistently
    • Epic Link:
    • Team:
      Windows
    • Sprint:
      Windows Kanban
    • Method Found:
      Customer Feedback
    • QA Risk Assessment:
      Needs Assessment

      Description

      iis_virtual_directory is not idempotent when name contains slashes.
      Consider when a customer specifies an iis_virtual_directory with a name with a slash:

        iis_site { "test_site":
          name            => "test_site",
          ensure          => 'present',
          physicalpath    => 'c:\\inetpub\\test_site',
          applicationpool => 'DefaultApplicationPool',
        }
       
        iis_virtual_directory{ "test_vdir":
          ensure       => 'present',
          sitename     => "test_site",
          physicalpath => 'c:\\inetpub\\test_vdir',
        }
       
        iis_virtual_directory { 'bbbb\bbbb':
          name         => 'bbbb\bbbb',
          ensure       => 'present',
          sitename     => 'test_site',
          physicalpath => '\\\\WEBSHARE\\data\\backward',
        }
       
        iis_virtual_directory { 'ffff/ffff':
          name         => 'ffff/ffff',
          ensure       => 'present',
          sitename     => 'test_site',
          physicalpath => '\\\\WEBSHARE\\data\\forward',
        }
      

      C:\Users\Administrator> puppet agent -t
      Info: Using configured environment 'production'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Loading facts
      Info: Caching catalog for pe-201722-agent-win2012
      Info: Applying configuration version '1501179219'
      Notice: /Stage[main]/Main/Node[pe-201722-agent-win2012]/Iis_site[test_site]/ensure: defined 'ensure' as 'present'
      Notice: /Stage[main]/Main/Node[pe-201722-agent-win2012]/Iis_virtual_directory[test_vdir]/ensure: created
      Notice: /Stage[main]/Main/Node[pe-201722-agent-win2012]/Iis_virtual_directory[bbbb\bbbb]/ensure: created
      Notice: /Stage[main]/Main/Node[pe-201722-agent-win2012]/Iis_virtual_directory[ffff/ffff]/ensure: created
      Notice: Applied catalog in 14.33 seconds
       
      C:\Users\Administrator> puppet agent -t
      Info: Using configured environment 'production'
      Info: Retrieving pluginfacts
      Info: Retrieving plugin
      Info: Loading facts
      Info: Caching catalog for pe-201722-agent-win2012
      Info: Applying configuration version '1501179249'
      Notice: /Stage[main]/Main/Node[pe-201722-agent-win2012]/Iis_virtual_directory[bbbb\bbbb]/ensure: created
      Notice: /Stage[main]/Main/Node[pe-201722-agent-win2012]/Iis_virtual_directory[ffff/ffff]/ensure: created
      Notice: Applied catalog in 7.13 seconds
      

      The iis_virtual_directory provider uses the New-WebVirtualDirectory PowerShell command. The New-WebVirtualDirectory PowerShell command uses -Name to specify -Path. The VirtualDirectory path specifies the virtual path.

      The issue appears to be caused by how we parse the output of Get-WebVirtualDirectory in:

      lib/puppet/provider/templates/webadministration/_getvirtualdirectories.ps1.erb

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              james.pogran James Pogran
              Reporter:
              tom.kishel Thomas Kishel
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support