Search code examples
deploymentpuppetappfabric

How to ensure that App Fabric is installed on a Windows Puppet Agent


I am trying to setup App Fabric on a Windows Puppet Agent. I have the following configuration:

  • Linux Puppet Master (CentOS 6.5)
  • Windows Puppet Agent (Windows Server 2008 R2)
  • Puppet version 3.8.2

I am using the following manifest to insure that App Fabric is installed:

# This is the init.pp manifest file for the appfabric module

class appfabric {

    # TODO: Get the setup path from Hiera
    $setup_base_directory = 'D:/Setups/'

    $setup_path =  "${setup_base_directory}WindowsServerAppFabricSetup_x64.exe"
    $hotfix_path = "${setup_base_directory}AppFabric1.1-KB2932678-x64-ENU.exe"

    # Pull down the setup of AppFabric
    file {$setup_path:
        ensure             => file,
        source_permissions => ignore,
        source             => 'puppet:///modules/appfabric/WindowsServerAppFabricSetup_x64.exe',
    }

    ->

    # Pull down the setup of hotfix update 5
    file {$hotfix_path:
        ensure             => file,
        source_permissions => ignore,
        source             => 'puppet:///modules/appfabric/AppFabric1.1-KB2932678-x64-ENU.exe',
    }

    ->

    # Install AppFabric 1.1
    package {'AppFabric 1.1 for Windows Server':
        ensure          => present,
        source          => $setup_path,
        install_options => ['/i','/SkipUpdates'],
    }

    ->

    # Install Hotfix KB2932678
    package {'AppFabric 1.1 HotFix install':
        ensure          => present,
        source          => $hotfix_path,
        install_options => ['/q','/norestart'],
    }

    ->

    # Start the remote registry service 
    service {'Remote Registry Service': 
        ensure  => running,
        name    => 'RemoteRegistry',
        enable  => true,
    }

    ->

    # Start the app fabric service
    service {'App Fabric Service': 
        ensure  => running,
        name    => 'AppFabricCachingService',
        enable  => true,
    }
}

I am facing the following issues:

  1. I am not able to change the log on user for the AppFabricCachingService to NT Authority\System (Local System account) or any other specific user.

  2. When I run the command puppet agent --test on the Windows Puppet Agent then puppet tries to install App Fabric everytime. I am trying to write manifest with which I can make sure that in case App Fabric is already installed then puppet should not attempt to re-install.

I am new to the Puppet Configuration Management and any help would be great.

Thanks in advance.


Solution

  • For your second issue, make sure the name of the package (in your case, you are specifying "AppFabric 1.1 for Windows Server") matches the name that appears in Windows Add\Remove programs menu. Otherwise Puppet will reinstall every time.

    You might want to take a look at Package on Windows documentation page.

    According to that page:

    The easiest way to determine a package’s DisplayName is to:

    • Install the package on an example system.

    • Run puppet resource package to see a list of installed packages.

    • Locate the package you just installed, and copy the name that puppet resource reported for it.

    If the software you are installing does not show up in the programs list, my recommendation would be to not use package. Instead, use exec to install it and add a creates clause to run the installer only if a file in a specific location belonging to the software is not found, or unless to perform a free-form check (registry, attempt to execute the software and check the version, etc.)