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:
parent
826b008fc0
commit
37ab52902b
15
data_bags/credentials/parity.json
Normal file
15
data_bags/credentials/parity.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"id": "parity",
|
||||
"testnet_password": {
|
||||
"encrypted_data": "nPYzGCz9YkH7DyyYqEVzXMTK2Wim25jgP7NvO3epMR+J9Xu3vBG2kiQ6Wx0D\ngxM7\n",
|
||||
"iv": "CuLNb2eNcBuoI1NuHf6j0g==\n",
|
||||
"version": 1,
|
||||
"cipher": "aes-256-cbc"
|
||||
},
|
||||
"mainnet_password": {
|
||||
"encrypted_data": "PqmxQnvGKVEs0/YuZB1M2VO45Zk3Hqg9bXsgrX5wvM9bFXPjg9/xv7AK215d\n3FrZEFiV9PNyqbfjTcCpPkkdbDEvuJ8n/+mnFshEH+7+T+I=\n",
|
||||
"iv": "HjNL7eKlDwWE37ZTVa62rA==\n",
|
||||
"version": 1,
|
||||
"cipher": "aes-256-cbc"
|
||||
}
|
||||
}
|
@ -8,6 +8,7 @@
|
||||
#
|
||||
|
||||
parity_node "dev" do
|
||||
password "parityparity"
|
||||
config parity: {
|
||||
chain: "dev",
|
||||
no_download: true, # Don't Download Updates
|
||||
|
@ -7,7 +7,10 @@
|
||||
# All rights reserved - Do Not Redistribute
|
||||
#
|
||||
|
||||
credentials = Chef::EncryptedDataBagItem.load('credentials', 'parity')
|
||||
|
||||
parity_node "mainnet" do
|
||||
password credentials["mainnet_password"]
|
||||
config parity: {
|
||||
chain: "homestead",
|
||||
},
|
||||
|
@ -7,7 +7,11 @@
|
||||
# All rights reserved - Do Not Redistribute
|
||||
#
|
||||
|
||||
credentials = Chef::EncryptedDataBagItem.load('credentials', 'parity')
|
||||
account_password = credentials["testnet_password"]
|
||||
|
||||
parity_node "testnet" do
|
||||
password account_password
|
||||
config parity: {
|
||||
chain: "ropsten",
|
||||
},
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user