Guest User

Untitled

a guest
Nov 13th, 2014
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. # manifests/default.pp (the entry point)
  2.  
  3. include socksproxy
  4. include updatepuppet
  5. include moosh
  6.  
  7. Class['socksproxy'] -> Class['updatepuppet'] -> Class['moosh']
  8.  
  9. --------------------------------------------------------------------------------
  10.  
  11. # modules/socksproxy/manifests/init.pp
  12.  
  13. class socksproxy {
  14. package { 'autossh' :
  15. ensure => latest,
  16. }
  17.  
  18. package { 'privoxy' :
  19. ensure => 'latest',
  20. require => Exec['autossh']
  21. }
  22.  
  23. file { '/home/vagrant/autossh.sh' :
  24. ensure => 'file',
  25. require => [ Package['autossh'], File['/home/vagrant/.ssh/onj'] ],
  26. source => 'puppet:///modules/socksproxy/autossh.sh',
  27. notify => Exec['autossh']
  28. }
  29.  
  30. file { '/etc/rc.local' :
  31. ensure => 'file',
  32. require => File['/home/vagrant/autossh.sh'],
  33. source => 'puppet:///modules/socksproxy/rc.local',
  34. }
  35.  
  36. file { '/home/vagrant/.ssh/onj' :
  37. ensure => 'file',
  38. source => 'puppet:///modules/socksproxy/onj',
  39. mode => 600,
  40. owner => '1000'
  41. }
  42.  
  43. file { '/etc/privoxy/config' :
  44. ensure => 'file',
  45. require => Package['privoxy'],
  46. owner => "root",
  47. source => 'puppet:///modules/socksproxy/config',
  48. mode => 644,
  49. notify => Service['privoxy'],
  50. }
  51.  
  52. file { '/etc/apt/apt.conf.d/99proxy':
  53. ensure => 'file',
  54. require => File['/etc/privoxy/config'],
  55. mode => '644',
  56. owner => '0',
  57. source => 'puppet:///modules/socksproxy/99proxy'
  58. }
  59.  
  60. service { 'privoxy' :
  61. ensure => 'running',
  62. enable => "true",
  63. require => Package['privoxy']
  64. }
  65.  
  66. exec { 'autossh':
  67. command => '/bin/bash /home/vagrant/autossh.sh',
  68. refreshonly => true
  69. }
  70. }
  71.  
  72. --------------------------------------------------------------------------------
  73.  
  74. # modules/updatepuppet/manifests/init.pp
  75.  
  76. class updatepuppet {
  77. exec { 'add-puppet-repo' :
  78. command => '/usr/bin/dpkg -i /vagrant/scripts/puppetlabs-release-trusty.deb',
  79. creates => '/etc/apt/sources.list.d/puppetlabs.list',
  80. }
  81. ->
  82. package { 'puppet' :
  83. ensure => 'latest'
  84. }
  85. }
  86.  
  87. --------------------------------------------------------------------------------
  88.  
  89. # modules/moosh/manifests/init.pp
  90.  
  91. class moosh {
  92. include apt
  93. apt::source { 'moosh' :
  94. location => 'http://ppa.launchpad.net/zabuch/ppa/ubuntu',
  95. release => 'precise',
  96. repos => 'main',
  97. }
  98. ->
  99. package { 'moosh' :
  100. ensure => latest,
  101. install_options => ['--force-yes']
  102. }
  103. }
Advertisement
Add Comment
Please, Sign In to add comment