Bitcoin (Core) cookbook #121

Merged
greg merged 20 commits from feature/bitcoin_cookbook into master 2020-08-20 17:17:31 +00:00
2 changed files with 20 additions and 13 deletions
Showing only changes of commit b0daa3d463 - Show all commits

View File

@ -3,7 +3,8 @@ node.default['bitcoin']['checksum'] = '4bbd62fd6acfa5e9864ebf37a24a04bc2dcfe3e3
node.default['bitcoin']['username'] = 'satoshi'
node.default['bitcoin']['usergroup'] = 'bitcoin'
node.default['bitcoin']['network'] = 'mainnet'
node.default['bitcoin']['datadir'] = '/mnt/data/bitcoin'
node.default['bitcoin']['datadir'] = '/home/satoshi/.bitcoin'
node.default['bitcoin']['walletdir'] = '/mnt/data/bitcoin'
node.default['bitcoin']['conf'] = {
irc: 1,

View File

@ -69,10 +69,11 @@ link "/usr/local/bin/bitcoin-cli" do
to "/usr/local/bitcoind/src/bitcoin-cli"
end
bitcoin_user = node['bitcoin']['username']
bitcoin_group = node['bitcoin']['usergroup']
bitcoin_datadir = node['bitcoin']['datadir']
credentials = Chef::EncryptedDataBagItem.load('credentials', 'bitcoin')
bitcoin_user = node['bitcoin']['username']
bitcoin_group = node['bitcoin']['usergroup']
bitcoin_datadir = node['bitcoin']['datadir']
bitcoin_walletdir = node['bitcoin']['walletdir']
credentials = Chef::EncryptedDataBagItem.load('credentials', 'bitcoin')
group bitcoin_group
@ -82,20 +83,25 @@ user bitcoin_user do
shell "/bin/bash"
end
directory bitcoin_datadir do
owner bitcoin_user
group bitcoin_group
mode '0750'
recursive true
action :create
[bitcoin_datadir, bitcoin_walletdir].each do |path|
directory path do
owner bitcoin_user
group bitcoin_group
mode '0750'
recursive true
action :create
end
end
config = node['bitcoin']['conf'].merge({
rpcpassword: credentials["rpcpassword"]
})
template "#{bitcoin_datadir}/bitcoin.conf" do
owner bitcoin_user
group bitcoin_group
mode '0640'
# TODO Create new in data bag and use here
variables conf: node['bitcoin']['conf'].merge({rpcpassword: credentials["rpcpassword"]}),
variables conf: config,
mainnet_conf: node['bitcoin']['mainnet_conf'],
testnet_conf: node['bitcoin']['testnet_conf'],
regtest_conf: node['bitcoin']['regtest_conf']