July 2019

Install Oracle client using rsp file ,powerShell and puppet

Create a ps1 file for eg oracleclientInstall.ps1

#oracelclientInstall.ps1
cmd.exe
C:\MyTemp\Ora11gx32\setup.exe -responseFile "C:\MyTemp\Ora11gx32\response\runtime.rsp" -silent
exit

Calling powershell file via Puppet exec resource

#Installoracel.pp
exec { 'RegisterOracle':
  command   => file('C:\Temp\installoracleclientruntime.ps1'),
  provider  => powershell,
  logoutput => true,
}

puppet agent -t Installoracle.pp

exec{'oracle':
command  => "setup.exe -silent -responseFile E:/software/Win64_120102_client/client12c_64.rsp ",
path  => 'c:\apps',
 }

Run PS file using puppet exec command

in registerDLL.ps1 file

#registerDLL.ps1
$location=Set-Location -Path C:\Windows\SysWOW64
regsvr32.exe "C:\ProgramFiles(x86)_shiva\HashMgr\HashMgr.dll"

exec { 'RegisterDll':
  command   => file('C:\Temp\puppetcode\registerDLL.ps1'),
  provider  => powershell,
  logoutput => true,
}

Enable IIS AnonymousAuthentication using exec and puppet

exec{‘set-anon-auth’:
command => ‘Set-WebConfigurationProperty -filter /system.WebServer/security/authentication/AnonymousAuthentication -name Enabled -Value True -location mysite’,
provider => ‘powershell’,
logoutput => true
}

Install exe file using puppet

package { “Access Database Engine Component”:
ensure => installed,
source => ‘C:\shivaTemp\AccessDatabaseEngine.exe’,
install_options => [ ‘/passive’, { ‘INSTALLDIR’ => ‘C:\shivaTemp’ } ],
}

$install_dir = ‘C:\shivaTemp’
package { “Access Database Engine Component”:
ensure => installed,
provider => ‘windows’,
source => ‘C:\shivaTemp\AccessDatabaseEngine.exe’,
install_options => [ ‘/passive’, { ‘INSTALLDIR’ => $install_dir } ],

}