class bitcoind($daemon_args = '-daemon') { package { 'bitcoind': ensure => installed, } group { "bitcoin": ensure => present, allowdupe => false, } user { "bitcoin": ensure => present, allowdupe => false, shell => '/bin/bash', gid => 'bitcoin', home => '/var/lib/bitcoin', require => Group['bitcoin'], } file { '/var/lib/bitcoin': ensure => directory, owner => 'bitcoin', group => 'bitcoin', mode => 0750, require => User['bitcoin'], } file { '/var/lib/bitcoin/.bitcoin': ensure => directory, owner => 'bitcoin', group => 'bitcoin', mode => 0750, require => File['/var/lib/bitcoin'], } file { '/var/lib/bitcoin/.bitcoin/bitcoin.conf': ensure => present, owner => 'bitcoin', group => 'bitcoin', mode => 0640, content => template('bitcoind/bitcoind.conf.erb'), require => File['/var/lib/bitcoin/.bitcoin'], } file { '/etc/init.d/bitcoind': ensure => present, owner => root, group => root, mode => 0755, content => template('bitcoind/bitcoind-init.d.sh.erb'), } service { 'bitcoind': enable => true, ensure => running, hasrestart => true, hasstatus => false, require => [ Package['bitcoind'], File['/var/lib/bitcoin/.bitcoin/bitcoin.conf', '/etc/init.d/bitcoind'] ], } }