From ad8c3d05fc148d7eb50b8563e759bc498a87304c Mon Sep 17 00:00:00 2001 From: "christopher.lawrence" Date: Fri, 14 Feb 2020 09:30:51 +0000 Subject: [PATCH] added IIS configuration --- .../manifests/custom_windows/deploy_iis.pp | 58 ++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/site-modules/profile/manifests/custom_windows/deploy_iis.pp b/site-modules/profile/manifests/custom_windows/deploy_iis.pp index 0948a27..9837b40 100644 --- a/site-modules/profile/manifests/custom_windows/deploy_iis.pp +++ b/site-modules/profile/manifests/custom_windows/deploy_iis.pp @@ -1,8 +1,10 @@ class profile::custom_windows::deploy_iis ( + String $user_acl = $profile::custom_windows::config_server::user_name, + ) { - dsc {'iis': + dsc {'iis-web': resource_name => 'WindowsFeature', module => 'PSDesiredStateConfiguration', properties => { @@ -10,4 +12,58 @@ class profile::custom_windows::deploy_iis ( name => 'Web-Server', } } + + iis_site {'Default Web Site': + ensure => absent, + require => Dsc['iis-web'], + } + + file { 'c:\\inetpub\\complete': + ensure => 'directory' + } + + acl { 'c:\\inetpub\\complete': + permissions => [ + {'identity' => $user_acl, 'rights' => ['read', 'execute']}, + ], + } + + iis_application_pool { 'complete_site_app_pool': + ensure => 'present', + state => 'started', + managed_pipeline_mode => 'Integrated', + managed_runtime_version => 'v4.0', + } + + iis_application_pool {'test_app_pool': + ensure => 'present', + enable32_bit_app_on_win64 => true, + managed_runtime_version => '', + managed_pipeline_mode => 'Classic', + start_mode => 'AlwaysRunning' + } + + iis_site { 'complete': + ensure => 'started', + physicalpath => 'c:\\inetpub\\complete', + applicationpool => 'complete_site_app_pool', + enabledprotocols => 'https', + bindings => [ + { + 'bindinginformation' => '*:443:', + 'protocol' => 'https', + 'certificatehash' => '3598FAE5ADDB8BA32A061C5579829B359409856F', + 'certificatestorename' => 'MY', + 'sslflags' => 1, + }, + ], + require => File['c:\\inetpub\\complete'], + notify => Reboot['dsc_reboot'], + } + + reboot { 'dsc_reboot' : + message => 'DSC has requested a reboot', + when => 'pending', + onlyif => 'pending_dsc_reboot', + } }