Skip to content

Commit

Permalink
tests: improve scenario initialization
Browse files Browse the repository at this point in the history
fix

    Odd number of elements in anonymous hash at /thruk/script/../lib/Thruk/Utils/Cluster.pm line 326

when there is no secret yet,
  • Loading branch information
sni committed Aug 29, 2024
1 parent 6ac346a commit 6ca3b3b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Thruk/Utils/Cluster.pm
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ sub run_cluster {

# run function on each cluster node
my $res = [];
my $secret_key = Thruk::Config::secret_key();
for my $n (@nodeids) {
next unless $self->{'nodes_by_id'}->{$n};
next if($type eq 'others' && $self->is_it_me($n));
Expand All @@ -324,7 +325,7 @@ sub run_cluster {
my $http = Thruk::Backend::Provider::HTTP->new({
options => {
peer => $node->{'node_url'},
auth => Thruk::Config::secret_key(),
auth => $secret_key,
},
}, $c->config);
my $t1 = [gettimeofday];
Expand Down
8 changes: 8 additions & 0 deletions t/scenarios/cluster_e2e/thruk/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
stdin: |
APACHE_MODE=own
- shell: rm /omd/sites/demo/etc/naemon/conf.d/*.cfg
- name: "create secret.key"
shell: echo "testkey" > /omd/sites/demo/var/thruk/secret.key
- name: "set permissions on secret.key"
file:
path: /omd/sites/demo/var/thruk/secret.key
mode: 0600
owner: demo
group: demo
- shell: ln -sfn /thruk/support/thruk_templates.cfg /omd/sites/demo/etc/naemon/conf.d/thruk_templates.cfg
- shell: "rsync -avu /omd/sites/demo/{{item}}/thruk/. /mnt/{{item}}/. ; rm -rf /omd/sites/demo/{{item}}/thruk ; ln -sfn /mnt/{{item}} /omd/sites/demo/{{item}}/thruk; chown demo: /mnt/{{item}}/."
with_items: ['etc', 'var']
Expand Down

0 comments on commit 6ca3b3b

Please sign in to comment.