Puppet Windows Install Application (installation file from server)
Environment
Server: Puppet Enterprise 3.3.2 + CentOS 6.5
Client: Puppet Enterprise 3.3.2 + Windows Server 2008 R2
MSI: no parameter
Example: 7zip(7z920-x64.msi), NSClient(NSClient++-Stable-64.msi)
EXE: need to check the parameter for slience installation
Example: notepadplusplus(npp.6.5.5.Installer.exe), jre8(jre-8u25-windows-i586.exe)
Install MSI Package
Server:
A. Go to folder /etc/puppetlabs/puppet/modules
B. Create folder "install_msi"
C. Create folder "manifests" and "files"
D. Create file install_7zip.pp in manifest folder with following context:
class install_7zip{
file { "c:\\7z920-x64.msi":
ensure => present,
source => "puppet:///modules/install_package/7z920-x64.msi",
notify => Package["7z"],
}
package { "7z":
ensure => installed,
provider => "windows",
source => "c:\\7z920-x64.msi",
require => File["c:\\7z920-x64.msi"],
}
}
E. Create file install_NSClient.pp in manifest folder with following context:
class install_NSClient{
file { "c:\\NSClient++-Stable-64.msi":
ensure => present,
source => "puppet:///modules/install_msi/NSClient++-Stable-64.msi",
notify => Package["NSClient"],
}
package { "NSClient":
ensure => installed,
provider => "windows",
source => "c:\\NSClient++-Stable-64.msi",
require => File["c:\\NSClient++-Stable-64.msi"],
}
}
F. put 7z920-x64.msi, NSClient++-Stable-64.msi into files folder
G. Change privilege of the folder: chown -R root:pe-puppet install_package
Console:
A. Add class "install_7zip", "install_NSClient"
B. Edit node, add class "install_7zip" , "install_NSClient"
Client:
A. run command to apply the change: puppet agent -t
Install EXE Package
Server:
A. Go to folder /etc/puppetlabs/puppet/modules
B. Create folder "install_exe"
C. Create folder "manifests" and "files"
D. Create file install_notepadplusplus.pp in manifest folder with following context:
class install_notepadplusplus{
file { "c:\\npp.6.5.5.Installer.exe":
ensure => "file",
owner => 'Administrator',
group => 'Users',
mode => '0644',
source => "puppet:///modules/install_exe/npp.6.5.5.Installer.exe",
notify => Package["npp"],
}
package { "npp":
ensure => installed,
source => "c:\\npp.6.5.5.Installer.exe",
require => File["c:\\npp.6.5.5.Installer.exe"],
install_options => ['/S'],
}
}
E. Create file install_jre8_32.pp in manifest folder with following context:
class install_jre8_32{
file { "c:\\jre-8u25-windows-i586.exe":
ensure => "file",
owner => 'Administrator',
group => 'Users',
mode => '0644',
source => "puppet:///modules/install_exe/jre-8u25-windows-i586.exe",
notify => Package["jre8_32"],
}
package { "jre8_32":
ensure => installed,
source => "c:\\jre-8u25-windows-i586.exe",
require => File["c:\\jre-8u25-windows-i586.exe"],
install_options => ['/s'],
}
}
F. put npp.6.5.5.Installer.exe, jre-8u25-windows-i586.exe into files folder
G. Change privilege of the folder: chown -R root:pe-puppet install_package
Console:
A. Add class "install_notepadplusplus", "install_jre8_32"
B. Edit node, add class "install_notepadplusplus", "install_jre8_32"
Client:
A. run command to apply the change: puppet agent -t
Comments
Post a Comment