summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2012-08-10 18:09:45 -0300
committerSilvio Rhatto <rhatto@riseup.net>2012-08-10 18:09:45 -0300
commit9a00be3fd82f4343780b81762a1b67b16ac0070e (patch)
tree2cda27a500f38a8b01926219a3d102386ad63e3b /manifests
downloadpuppet-bitcoind-9a00be3fd82f4343780b81762a1b67b16ac0070e.tar.gz
puppet-bitcoind-9a00be3fd82f4343780b81762a1b67b16ac0070e.tar.bz2
Initial version
Diffstat (limited to 'manifests')
-rw-r--r--manifests/init.pp41
1 files changed, 41 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
new file mode 100644
index 0000000..9c0b97c
--- /dev/null
+++ b/manifests/init.pp
@@ -0,0 +1,41 @@
+class bitcoind($daemon_args = '') {
+ package { 'bitcoind':
+ ensure => installed,
+ }
+
+ group { "bitcoin":
+ ensure => present,
+ allowdupe => false,
+ }
+
+ user { "bitcoin":
+ ensure => present,
+ allowdupe => false,
+ gid => 'bitcoin',
+ home => '/var/lib/bitcoin',
+ require => Group['bitcoin'],
+ }
+
+ file { '/var/lib/bitcoin':
+ ensure => directory,
+ owner => 'bitcoin',
+ group => 'bitcoin',
+ require => User['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', '/etc/init.d/bitcoind'] ],
+ }
+}