Skip to content

Commit

Permalink
(BKR-806) Only add pe_repo classes once
Browse files Browse the repository at this point in the history
Previously, if installing multiple agents with the same platform, the
work to add the appropriate pe_repo class to the master would be
performed once for each agent. Because that requires running `puppet
agent -t` on the master, it can add a significant amount of unnecessary
overhead to the install process when installing several agents.

We now check whether the class has already been included in the Beaker
Frictionless Agent group and skip running puppet on the master if it
has.
  • Loading branch information
nicklewis authored and kevpl committed Apr 6, 2017
1 parent fe8bbc8 commit a718fbb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/beaker-pe/install/pe_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,13 @@ def deploy_frictionless_to_master(host)
node_group['classes'] ||= {}
end

# add the pe_repo platform class
node_group['classes'][klass] = {}
# add the pe_repo platform class if it's not already present
if ! node_group['classes'].include?(klass)
node_group['classes'][klass] = {}

_console_dispatcher.create_new_node_group_model(node_group)
on master, puppet("agent -t"), :acceptable_exit_codes => [0,2]
_console_dispatcher.create_new_node_group_model(node_group)
on master, puppet("agent -t"), :acceptable_exit_codes => [0,2]
end
end
end

Expand Down

0 comments on commit a718fbb

Please sign in to comment.