Generate the config files using a TOML parser

Now we don't need to change both the template and the resources to add
options
This commit is contained in:
Greg Karékinian
2017-05-03 09:53:45 +02:00
parent 462e7ff858
commit e2b483eb3f
4 changed files with 52 additions and 31 deletions

View File

@@ -1,3 +1,5 @@
require 'toml'
provides :parity_node
property :name, String, name_property: true
@@ -7,6 +9,7 @@ action :enable do
node_name = name
base_path = "#{node['kosmos-parity']['home_path']}/.local/share/io.parity.ethereum/#{name}"
config[:parity][:base_path] = base_path
directory base_path do
recursive true
@@ -24,11 +27,10 @@ action :enable do
config_file = "#{base_path}/config.toml"
template config_file do
source "config.toml.erb"
file config_file do
content TOML::Generator.new(config).body
owner "parity"
group "parity"
variables config.merge(base_path: base_path)
end
execute "systemctl daemon-reload" do