How to Deploy IIS and ASP.NET with the Puppet Module

How to Deploy IIS and ASP.NET with the Puppet Module

Puppet is a great module for automating Windows effectively. It can automate almost anything, including Chocolatey, Azure virtual machines and file system ACLs.

You have to define a set of rules for your server environment. In every 30 minutes, Puppet will check if the rules have been followed and the attempts for making unwanted changes. In this article, you will find the way of deploying IIS and ASP.NET with the Puppet module. Now, let’s dive in.

 Deploying IIS and ASP.NET with the Puppet Module

1. At first, you have to define a set of rules. Then, you will have to apply it to the windows server. You can do it by using the following codes:

class widemo::iis_enable {
    Include windemo::dotnet_enable
    Windowsfeature{'IIS_NET45':
        feature_name => [
            'Web-WebServer',
            'Web-Http-Errors',
            'Web-Http-Logging',
'Web-Asp-Net45',
'NET-Framework-45-ASPNET',
],
installmanagementtools => true, 
} ~>
# Remove default binding by removing default website
# (so it can be used by something else)
Iis::manage_site {'Default Web Site':
    ensure => absent,
site_path => 'any',
    app_pool => 'DefaultAppPool',
}
}

Here, you are enabling .NET Framework 4.5 with the Windows Feature module. You are also turning on the IIS, along with HTTP error and logging. To remove the default binding, you are removing default website with the voxopopuli IIS module.

2. Puppet provides you with a report about different events and logs. It looks like this:

How to Deploy IIS and ASP.NET with the Puppet Module

Here, Puppet is showing that it has managed to set up a basic application by executing the required commands. It also reveals that the IIS Management tools have been successfully installed. To remove the default website, it has executed Powershell codes.

3. Now, you have to install SQL Server Compact Edition. Just use these codes:

classwindemo::sqlce {
    $installer = 'SSCERuntime_x64-ENU.exe'
    package { 'Microsoft SQL Server Compact 4.0 SP1 x64 ENU':
        ensure => '4.0.8876.1',
        provider => 'windows',
        # NOTE: would like to use this Puppet style, but must have file
        # source => "puppet:///modules/widemo/${installer}",
        source => "C:/vagrant/modules/windemo/files/${installer]",
        Install_options => [  '/1',  '/passive' ] # [ '/qn' ] #/l*v install
    }
}

4. Next, you have to install a bare application, like Razor C, that utilizes the SQL server, which you have just installed.

# == Class: mvcapp
#
# This class installs the razorC MVC application
#
classwindemo::mvcapp {
    $app_zip = 'razorC_v1.1.1.zip'
    $app_zip_path = "C: WindowsTemp${app_zip}"
    $app_pool - 'mvc'
    $app_file { "${app_zip_path}":
        ensure => file,
        source => "puppet:///modules/windemo/${app_zip}",
        source_permissions => ignore,
    } ~>
    iis::manage_app_pool {"$app_pool":
ensure => present,
enable_32_bit => true,
managed_runtime_version => 'v4.0',
managed_pipeline_mode => 'Integrated',
} ~>
#NOTE: IIS is very touchy around extra slashes
Iis::manage_site {'razorC':
ensure => present,
site_path => "${app_location},
port => '80',
Ip_address => '*',

Here, you are telling Puppet to copy a zip file, which contains the full distribution of the app. You are also commanding it to extract the compressed file to c:inetpubwwwroot, which is the default path for ASP.NET applications. In addition, the application pool has been created, along with a site mapped to Port 80.

5. Now, you can view the deployed ASP.NET app with your favorite browser. It looks like this:

How to Deploy IIS and ASP.NET with the Puppet Module

Conclusion

In this article, you have learned to deploy IIS and ASP.NET with the Puppet module. You have also learned to configure Windows to run IIS. Finally, you have gone through the process of installing a CMS application, which is one of the simplest things that you can do with Puppet.

There are tons of things that you can do with the module on the Windows server. Keep in touch with us to know them.

Check out these top 3 Windows hosting services:

Ultahost
$2.90 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8
Kamatera
$4.00 /mo
Starting price
Visit Kamatera
Rating based on expert review
  • User Friendly
    3.5
  • Support
    3.0
  • Features
    3.9
  • Reliability
    4.0
  • Pricing
    4.3
IONOS
$1.00 /mo
Starting price
Visit IONOS
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.0
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.3

How to Install the WISA (Windows, IIS, SQL, ASP.NET) Stack

WISA is an acronym which stands for (Windows, IIS, SQL, and ASP.net).WISA uses W
3 min read
Vladimir Rakov
Vladimir Rakov
Hosting Expert

How to Configure, Install and Deploy ASP.NET Core to IIS

This article will discuss the way of configuring, installing and deploying ASP.N
2 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How To Migrate A Website From IIS 6 to IIS 7

This guide will teach you to migrate your website from IIS 6 to IIS 7 using the
2 min read
Idan Cohen
Idan Cohen
Marketing Expert

How To Enable mod_rewrite On IIS

This tutorial will teach you how to enable mod_rewrite function on IIS web serv
2 min read
Max Ostryzhko
Max Ostryzhko
Senior Web Developer, HostAdvice CTO
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top