Giter VIP home page Giter VIP logo

Comments (5)

stack72 avatar stack72 commented on July 29, 2024

@hyuan-esol im not quite sure what the issue you are reporting is?

from puppet-iis.

hyuan-work avatar hyuan-work commented on July 29, 2024

The Application Pool and Physical Path is not updated for existing Virtual Application. I had done that locally. Do you need to see my changes?

from puppet-iis.

stack72 avatar stack72 commented on July 29, 2024

hi @hyuan-esol - id certainly love to see the changes

from puppet-iis.

hyuan-work avatar hyuan-work commented on July 29, 2024

Here you go:

define iis::manage_virtual_application($site_name, $site_path, $app_pool, $virtual_application_name = $title, $ensure = 'present') {
  include 'iis::param::powershell'

  validate_re($ensure, '^(present|installed|absent|purged)$', 'ensure must be one of \'present\', \'installed\', \'absent\', \'purged\'')

  if ($ensure in ['present','installed']) {
    iis::createpath { "${site_name}-${virtual_application_name}-${site_path}":
      site_path => $site_path
    }

    $cmdAppExists = "Test-Path \\\"IIS:\\Sites\\${site_name}\\${virtual_application_name}\\\""

    exec { "CreateVirtualApplication-${site_name}-${virtual_application_name}" :
      command   => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; New-WebApplication -Name ${virtual_application_name} -Site ${site_name} -PhysicalPath ${site_path} -ApplicationPool ${app_pool}\"",
      path      => "${iis::param::powershell::path};${::path}",
      onlyif    => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if((${$cmdAppExists})) { exit 1 } else { exit 0 }\"",
      require   => [ Iis::Createpath["${site_name}-${virtual_application_name}-${site_path}"], Iis::Manage_site[$site_name] ],
      logoutput => true,
    }
    exec { "UpdateVirtualApplication-${site_name}-${virtual_application_name}-PhysicalPath" :
      command   => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; Set-ItemProperty \\\"IIS:\\Sites\\${site_name}\\${virtual_application_name}\\\" -Name PhysicalPath -Value \\\"${site_path}\\\"\"",
      path      => "${iis::param::powershell::path};${::path}",
      onlyif    => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if((${$cmdAppExists})) { exit 0 } else { exit 1 }\"",
      logoutput => true,
    }
    exec { "UpdateVirtualApplication-${site_name}-${virtual_application_name}-ApplicationPool" :
      command   => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; Set-ItemProperty \\\"IIS:\\Sites\\${site_name}\\${virtual_application_name}\\\" -Name ApplicationPool -Value \\\"${app_pool}\\\"\"",
      path      => "${iis::param::powershell::path};${::path}",
      onlyif    => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if((${$cmdAppExists})) { exit 0 } else { exit 1 }\"",
      logoutput => true,
    }
  } else {
    exec { "DeleteVirtualApplication-${site_name}-${virtual_application_name}" :
      command   => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; Remove-WebApplication -Name ${virtual_application_name} -Site ${site_name}\"",
      path      => "${iis::param::powershell::path};${::path}",
      onlyif    => "${iis::param::powershell::command} -Command \"Import-Module WebAdministration; if(!(${$cmdAppExists})) { exit 1 } else { exit 0 }\"",
      logoutput => true,
    }
  }
}

from puppet-iis.

bastelfreak avatar bastelfreak commented on July 29, 2024

Hi. I'm going to close this Issue. We deprecated the module and the new version is available here: https://forge.puppet.com/puppetlabs/iis

from puppet-iis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.