Advertisement
Guest User

Untitled

a guest
Dec 16th, 2019
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. class pasture {
  2.  
  3. $port = '80'
  4. $default_character = 'sheep'
  5. $default_message = ''
  6. $pasture_config_file = '/etc/pasture_config.yaml'
  7.  
  8. package { 'pasture':
  9. ensure => present,
  10. provider => 'gem',
  11. before => File[$pasture_config_file],
  12. }
  13. $pasture_config_hash = {
  14. 'port' => $port,
  15. 'default_character' => $default_character,
  16. 'default_message' => $default_message,
  17. }
  18. file { $pasture_config_file:
  19. content => epp('pasture/pasture_config.yaml.epp', $pasture_config_hash),
  20. notify => Service['pasture'],
  21. }
  22. $pasture_service_hash = {
  23. 'pasture_config_file' => $pasture_config_file,
  24. }
  25. file { '/etc/systemd/system/pasture.service':
  26. content => epp('pasture/pasture.service.epp', $pasture_service_hash),
  27. notify => Service['pasture'],
  28. }
  29. service { 'pasture':
  30. ensure => running,
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement