Skip to content

Commit

Permalink
Merge pull request #1334 from skazi0/chef-splay-attribute
Browse files Browse the repository at this point in the history
provisioner: Make chef splay configurable
  • Loading branch information
Mate Lakat authored Sep 25, 2017
2 parents adf1459 + 2d66cb1 commit 9bb08f0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions chef/cookbooks/provisioner/recipes/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,15 @@
config_file = "/etc/sysconfig/chef-client"

chef_client_runs = node[:provisioner][:chef_client_runs] || 900
chef_splay = node[:provisioner][:chef_splay] || 20

template config_file do
owner "root"
group "root"
mode "0644"
source "chef_client.erb"
variables(
chef_splay: chef_splay,
chef_client_runs: chef_client_runs
)
notifies :restart, "service[chef-client]", :delayed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LOGFILE=/var/log/chef/client.log
CONFIG=/etc/chef/client.rb
INTERVAL=<%= @chef_client_runs %>
SPLAY=20
SPLAY=<%= @chef_splay %>
9 changes: 9 additions & 0 deletions chef/data_bags/crowbar/migrate/provisioner/201_chef_splay.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def upgrade(ta, td, a, d)
a["chef_splay"] = ta["chef_splay"] unless a.key? "chef_splay"
return a, d
end

def downgrade(ta, td, a, d)
a.delete("chef_splay")
return a, d
end
3 changes: 2 additions & 1 deletion chef/data_bags/crowbar/template-provisioner.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,15 @@
"debug": "debug"
}
},
"chef_splay": 20,
"chef_client_runs": 900
}
},
"deployment": {
"provisioner": {
"crowbar-revision": 0,
"crowbar-applied": false,
"schema-revision": 200,
"schema-revision": 201,
"element_states": {
"provisioner-server": [ "readying", "ready", "applying" ],
"provisioner-base": [ "hardware-installing", "readying", "ready", "applying" ]
Expand Down
1 change: 1 addition & 0 deletions chef/data_bags/crowbar/template-provisioner.schema
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
}
}
},
"chef_splay": { "type": "int", "required": true },
"chef_client_runs": { "type": "int", "required": true }
}
}
Expand Down

0 comments on commit 9bb08f0

Please sign in to comment.