Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class sap_host_agent::setup {
- # Create directory for SAP HA installation files
- file { ['/usr/sap', '/usr/sap/trans', '/usr/sap/trans/hostagent_inst', ]:
- ensure => 'directory',
- }
- # Create user and group for Host Agent
- group { 'sapsys':
- ensure => 'present',
- }
- user { 'sapadm':
- ensure => 'present',
- comment => 'SAP Local Administrator',
- groups => ['sapsys'],
- shell => '/bin/false',
- system => true,
- }
- # Get Host Agent installation files
- file {'SAPCAR':
- path => "${::sap_host_agent::ha_instfiles_dir}/SAPCAR",
- mode => '0755',
- owner => root,
- group => root,
- #source => 'puppet:///modules/sap_host_agent/linux-x86_64/SAPCAR',
- source => '/tmp/SAPCAR',
- }
- file {'SAPHOSTAGENT.SAR':
- path => "${::sap_host_agent::ha_instfiles_dir}/SAPHOSTAGENT.SAR",
- mode => '0600',
- owner => root,
- group => root,
- #source => 'puppet:///modules/sap_host_agent/linux-x86_64/SAPHOSTAGENT.SAR',
- source => '/tmp/SAPHOSTAGENT.SAR',
- }
- if $::sap_hostagent_version == 0 {
- # install needed
- exec { 'hostagent_install':
- before => File['ha_instfiles_unpacked'],
- command => './SAPCAR -xvf SAPHOSTAGENT.SAR -R ./inst',
- cwd => $::sap_host_agent::ha_instfiles_dir,
- path => '/usr/local/bin/:/bin/',
- provider => 'shell',
- require => [ File['SAPCAR'], File['SAPHOSTAGENT.SAR'] ]
- }
- } elsif $::sap_hostagent_version != $::sap_host_agent::latest_ha_version {
- # upgrade needed
- }
- file {'ha_instfiles_unpacked':
- ensure => absent,
- path => "${::sap_host_agent::ha_instfiles_dir}/inst",
- recurse => true,
- purge => true,
- force => true,
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement