Use a password attribute in the parity_node resource

The mainnet and testnet nodes use data from an encrypted data bag

Also fix a bug with the resource (hardcoded "dev" name instead of the
name attribute)
This commit is contained in:
Greg Karékinian
2017-05-03 19:05:43 +02:00
parent 826b008fc0
commit 37ab52902b
5 changed files with 28 additions and 4 deletions

View File

@@ -2,8 +2,9 @@ require 'toml'
provides :parity_node
property :name, String, name_property: true
property :config, Hash
property :name, String, name_property: true, required: true
property :config, Hash, required: true
property :password, String, required: true
action :enable do
include_recipe "kosmos-parity::default"
@@ -31,11 +32,11 @@ action :enable do
end
end
node_path = "#{node['kosmos-parity']['home_path']}/.local/share/io.parity.ethereum/dev"
node_path = "#{node['kosmos-parity']['home_path']}/.local/share/io.parity.ethereum/#{node_name}"
password_path = "#{node_path}/password"
file password_path do
content "parityparity"
content password
owner "parity"
group "parity"
mode 0640