Closed scalp42 closed 3 years ago
Hmm I am able to reproduce this from a quick test from master:
I will likely need to spend some more time putting debug statements in to figure out whats happening.
@scalp42 I suspect your right about if shell_out('sensuctl user list').error?
I can't say I recall why we did that my guess was that this was something that was done to detect if it was not configured at all. When I changed it to if !shell_out('sensuctl user list').error?
it did what I expected. @webframp do you recall why this was done?
I attempted to try again with default credentials and got an error with the change:
This leads me to believe this guard was likely put in to try and put a guard around some order dependency operations but that masked a problem rather than doing what it was intended.
I can do a little investigation for this one
The actual issue being obscured here is that we really only safely support initial configuration using the sensu_ctl
resource and probably don't safely support reconfiguring any options.
This gets into some of the same issues as #43 when it comes to how to safely handle not leaking the username/password if they are under management by a chef resource.
I can start a change that at least allows reconfiguring the backend url and we can have some discussion around that with ideas.
I was wondering how much of an issue this is now that sensu no longer ships with a default password. We should probably for the moment at least call this out as a known limitation in the cookbook in that it will not support reconfiguring until we get this worked out. Thoughts?
I'm unable to reproduce this with latest versions of sensu.
After running kitchen converge default-ubuntu-1804
twice on master I have these files created:
root@dokken:~# ll .config/sensu/sensuctl/
total 16
drwxr-xr-x 2 root root 4096 Oct 25 23:30 ./
drwxr-xr-x 3 root root 4096 Oct 25 23:30 ../
-rw-r--r-- 1 root root 863 Oct 25 23:30 cluster
-rw-r--r-- 1 root root 51 Oct 25 23:30 profile
Closing now as part of issue cleanup, but please re-open with any additional information as needed and I can investigate!
I seem to remember that with a vagrant kitchen, the files ended up in /home/vagrant/.config instead of /root/.config, presumably because the sudo call leaves enough of the vagrant user's environment intact for sensuctl to pick the wrong path. You would only see that when using kitchen with vagrant.
Hi folks,
Using
0.1.0
, I noticed that thesensu_ctl
resource only runs once:I see the
sensuctl user list
there https://github.com/sensu/sensu-go-chef/blob/0.1.0/resources/ctl.rb#L63 but I don't think.error?
is working:Any ideas?
Thanks!
UPDATE: I noticed that that
sensuctl
config files don't actually get created either.I just did it by hand 6 mins later (see time from Chef run):
EDIT: @majormoses updated linked code to use a permalink since the code referenced line number did not match what was on master.