Skip to content

Instantly share code, notes, and snippets.

@iversond
Last active March 23, 2017 15:05
Show Gist options
  • Save iversond/11bb8be1be8ea5378bb0d81748c333e6 to your computer and use it in GitHub Desktop.
Save iversond/11bb8be1be8ea5378bb0d81748c333e6 to your computer and use it in GitHub Desktop.
Deploy a favicon.zip file to PORTAL.war and signin.html to each site. Uses the PowerShell 4+ command 'Expand-Archive'.
$share_path = "//lm-d1/temp"
$pia_domain_list = hiera('pia_domain_list')
$pia_domain_list.each | $domain_name, $pia_domain_info | {
$cfg_home = $pia_domain_info['ps_cfg_home_dir']
$baseWebPath = "${cfg_home}/webserv/${domain_name}/applications/peoplesoft/PORTAL.war"
file {"io-favicons-zip-${domain_name}":
ensure => $ensure,
path => "${baseWebPath}/favicons.zip",
source => "${share_path}/favicons.zip",
source_permissions => ignore,
} ->
exec {"extract-io-favicosn-${domain_name}":
#command => "$(unzip ${baseWebPath}favicon.zip)",
command => "Expand-Archive -Path '${baseWebPath}/favicons.zip' -DestinationPath '${baseWebPath}' -force",
onlyif => "if ( test-path ${baseWebPath}/browserconfig.xml ) { exit 1 } else { exit 0 }",
provider => powershell,
logoutput => true,
}
$site_list = $pia_domain_info['site_list']
$site_list.each | $site_name, $site_info | {
file {"io-sigin-${domain_name}-${site_name}":
ensure => $ensure,
path => "${baseWebPath}/WEB-INF/psftdocs/${site_name}/signin.html",
source => "${share_path}/signin.html",
source_permissions => ignore,
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment