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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user