Advertisement
fatmcgav

puppet-java issue

Sep 5th, 2012
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. # site.pp
  2. node 'puppet-test.card.co.uk' {
  3.  
  4. # Set-up as a CMS linux server
  5. class {'act::server::linux::cms':}
  6.  
  7. }
  8.  
  9. # Module
  10. puppet]# tree modules/act/
  11. modules/act/
  12. └── manifests
  13. ├── definitions
  14. │   ├── groups.pp
  15. │   └── users.pp
  16. ├── env.pp
  17. ├── init.pp
  18. ├── lug
  19. ├── lug.pp
  20. └── products.pp
  21.  
  22. # modules/act/manifests/init.pp
  23. class act::server::linux {
  24. # Include the ACT Local User/Group manifest.
  25. class {'act::lug':}
  26.  
  27. # Modify /etc/hosts.
  28. host {'self':
  29. ensure => present,
  30. name => $fqdn,
  31. host_aliases => [$hostname],
  32. ip => $ipaddress,
  33. }
  34.  
  35. # Setup MOTD.
  36. file {'motd':
  37. ensure => file,
  38. path => '/etc/motd',
  39. mode => 0644,
  40. content => "Welcome to ${hostname},\na ${operatingsystem} island in the sea of ${domain}.\n",
  41. }
  42.  
  43. # Install ACT Yum repo RPM
  44. package { 'act-repos':
  45. ensure => latest,
  46. provider => 'rpm',
  47. source => "http://yum.card.co.uk/act-repo/act-repos-latest.${architecture}.rpm",
  48. }
  49.  
  50. # Create local users and groups.
  51. realize (
  52. Act::Lug::Groups["admins","demiadmins"],
  53. Act::Lug::Users["gavinw"],
  54. Act::Lug::Users["gavintest"],
  55. )
  56.  
  57. # Configure Sudo setup.
  58. class { 'sudo': }
  59. sudo::conf { 'admins':
  60. priority => 10,
  61. content => "# ACT Admins sudo group.\n%admins ALL=(ALL) ALL\n",
  62. }
  63.  
  64. # Configure NTP.
  65. class { "ntp":
  66. servers => [ '192.168.151.254' ],
  67. autoupdate => false,
  68. }
  69.  
  70. }
  71.  
  72. class act::server::linux::cms inherits act::server::linux {
  73.  
  74. # Include CMS config
  75. file {'cmsscheme':
  76. ensure => file,
  77. path => '/tmp/cmsscheme',
  78. mode => 0644,
  79. content => "This is a CMS host\n",
  80. }
  81.  
  82. class {'act::env::glassfish3':}
  83.  
  84. }
  85.  
  86. # modules/act/manifests/env.pp
  87. class act::env::java {
  88.  
  89. # Install Java
  90. class {'java':
  91. #distribution => 'jdk',
  92. #version => '1.6.0_31',
  93. }
  94. }
  95.  
  96. class act::env::glassfish3 {
  97.  
  98. notify {'glassfish3':
  99. message => "Setting up Glassfish3"}
  100.  
  101. # Create required users and groups
  102. realize (
  103. Act::Lug::Groups["glassfish"],
  104. )
  105.  
  106. include act::env::java
  107. }
  108.  
  109. # 'puppet agent --test'
  110. [root@puppet-test ~]# puppet agent --test
  111. notice: Ignoring --listen on onetime run
  112. err: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Class[Act::Env::Java] is already declared; cannot redeclare at /etc/puppet/modules/act/manifests/env.pp:8 on node puppet-test.card.co.uk
  113. warning: Not using cache on failed catalog
  114. err: Could not retrieve catalog; skipping run
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement