Advertisement
JWhy

Untitled

Mar 10th, 2016
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. class sap_host_agent::setup {
  2. # Create directory for SAP HA installation files
  3. file { ['/usr/sap', '/usr/sap/trans', '/usr/sap/trans/hostagent_inst', ]:
  4. ensure => 'directory',
  5. }
  6.  
  7. # Create user and group for Host Agent
  8. group { 'sapsys':
  9. ensure => 'present',
  10. }
  11.  
  12. user { 'sapadm':
  13. ensure => 'present',
  14. comment => 'SAP Local Administrator',
  15. groups => ['sapsys'],
  16. shell => '/bin/false',
  17. system => true,
  18. }
  19.  
  20. # Get Host Agent installation files
  21. file {'SAPCAR':
  22. path => "${::sap_host_agent::ha_instfiles_dir}/SAPCAR",
  23. mode => '0755',
  24. owner => root,
  25. group => root,
  26. #source => 'puppet:///modules/sap_host_agent/linux-x86_64/SAPCAR',
  27. source => '/tmp/SAPCAR',
  28. }
  29.  
  30. file {'SAPHOSTAGENT.SAR':
  31. path => "${::sap_host_agent::ha_instfiles_dir}/SAPHOSTAGENT.SAR",
  32. mode => '0600',
  33. owner => root,
  34. group => root,
  35. #source => 'puppet:///modules/sap_host_agent/linux-x86_64/SAPHOSTAGENT.SAR',
  36. source => '/tmp/SAPHOSTAGENT.SAR',
  37. }
  38.  
  39. if $::sap_hostagent_version == 0 {
  40. # install needed
  41. exec { 'hostagent_install':
  42. before => File['ha_instfiles_unpacked'],
  43. command => './SAPCAR -xvf SAPHOSTAGENT.SAR -R ./inst',
  44. cwd => $::sap_host_agent::ha_instfiles_dir,
  45. path => '/usr/local/bin/:/bin/',
  46. provider => 'shell',
  47. require => [ File['SAPCAR'], File['SAPHOSTAGENT.SAR'] ]
  48. }
  49. } elsif $::sap_hostagent_version != $::sap_host_agent::latest_ha_version {
  50. # upgrade needed
  51. }
  52.  
  53. file {'ha_instfiles_unpacked':
  54. ensure => absent,
  55. path => "${::sap_host_agent::ha_instfiles_dir}/inst",
  56. recurse => true,
  57. purge => true,
  58. force => true,
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement