diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-04-12 17:12:52 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-04-12 17:12:52 -0300 |
commit | 5ab9c19c8e45a067ee0880e4148b2f1492e152f7 (patch) | |
tree | 0cfaccff0a5bed4f6ece09e4ad601bbca32ac1c9 /manifests | |
download | puppet-pyroscope-5ab9c19c8e45a067ee0880e4148b2f1492e152f7.tar.gz puppet-pyroscope-5ab9c19c8e45a067ee0880e4148b2f1492e152f7.tar.bz2 |
Initial import
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..c06db0d --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,145 @@ +class pysocope($password = hiera('pyroscope::password' = '')) { + case $password { + '': { fail("You need to define torrent user password! Please set pyroscope::password in your config") } + } + + user::manage { "torrent": + password => $password, + homedir => '/var/cache/torrent', + ensure => present, + groups => [ 'incoming' ], + } + + file { '/var/cache/media/seeding': + ensure => directory, + owner => torrent, + group => torrent, + mode => 0755, + require => [ File['/var/cache/media'], User['torrent'] ], + } + + file { '/var/cache/torrent/.profile': + ensure => present, + owner => torrent, + group => torrent, + mode => 0644, + source => 'puppet:///modules/pyroscope/profile.sh', + require => User['torrent'], + } + + file { '/var/cache/torrent/.bashrc': + ensure => present, + owner => torrent, + group => torrent, + mode => 0644, + source => 'puppet:///modules/pyroscope/bashrc.sh', + require => User['torrent'], + } + + file { '/var/cache/torrent/rtorrent': + ensure => directory, + owner => torrent, + group => torrent, + mode => 0755, + require => User['torrent'], + } + + file { '/var/cache/torrent/rtorrent/done': + ensure => '/var/cache/media/incoming', + owner => torrent, + group => torrent, + require => File['/var/cache/torrent/rtorrent'], + } + + file { '/var/cache/torrent/rtorrent/seeding': + ensure => '/var/cache/media/seeding', + owner => torrent, + group => torrent, + require => File['/var/cache/torrent/rtorrent'], + } + + file { [ '/var/cache/torrent/rtorrent/log', '/var/cache/torrent/rtorrent/.session' ]: + ensure => directory, + owner => torrent, + group => torrent, + mode => 0755, + require => File['/var/cache/torrent/rtorrent'], + } + + file { '/var/cache/torrent/rtorrent/rtorrent.rc': + ensure => present, + owner => torrent, + group => torrent, + mode => 0644, + source => 'puppet:///modules/pyroscope/rtorrent.rc', + require => File['/var/cache/torrent/rtorrent'], + } + + file { '/var/cache/torrent/rtorrent/start': + ensure => present, + owner => torrent, + group => torrent, + mode => 0755, + source => 'puppet:///modules/pyroscope/start.sh', + require => File['/var/cache/torrent/rtorrent'], + } + + file { '/var/cache/torrent/.pyroscope': + ensure => directory, + owner => torrent, + group => torrent, + mode => 0755, + require => User['torrent'], + } + + file { '/var/cache/torrent/.pyroscope/run': + ensure => directory, + owner => torrent, + group => torrent, + mode => 0755, + require => File['/var/cache/torrent/.pyroscope'], + } + + file { '/var/cache/torrent/.pyroscope/run/pyrotorque': + ensure => present, + owner => torrent, + group => torrent, + mode => 0644, + require => File['/var/cache/torrent/.pyroscope/run'], + } + + file { '/var/cache/torrent/.pyroscope/torque.ini': + ensure => present, + owner => torrent, + group => torrent, + mode => 0644, + source => 'puppet:///modules/pyroscope/torque.ini', + require => File['/var/cache/torrent/.pyroscope'], + } + + file { '/var/cache/torrent/bin': + ensure => directory, + owner => torrent, + group => torrent, + mode => 0755, + require => User['torrent'], + } + + file { '/var/cache/torrent/bin/rtcron': + ensure => present, + owner => torrent, + group => torrent, + mode => 0755, + source => 'puppet:///modules/pyroscope/rtcron.sh', + require => File['/var/cache/torrent/bin'], + } + + cron { "rtcron": + command => '/var/cache/torrent/bin/rtcron &> /var/cache/torrent/rtorrent/log/rtcron.log', + user => torrent, + hour => "*", + minute => "*", + ensure => present, + require => File['/var/cache/torrent/bin/rtcron'], + } +} |