Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chef_client_config resource doesn't generate data_collector.url and data_collector.token properly in client.rb #12713

Open
nrgetik opened this issue Mar 24, 2022 · 1 comment
Assignees
Labels
Status: Untriaged An issue that has yet to be triaged.

Comments

@nrgetik
Copy link
Contributor

nrgetik commented Mar 24, 2022

Description

chef_client_config resource doesn't generate data_collector.url and data_collector.token properly in client.rb

Chef Version

Chef Client 17.9.52

Platform Version

Ubuntu 18.04.5 LTS

Replication Case

Make a resource like this

chef_client_config 'tweak client.rb' do
  chef_server_url 'https://api.chef.io/organizations/asdf_org'
  chef_license 'accept'
  data_collector_server_url 'https://chef-automate.test/data-collector/v0/'
  data_collector_token 'yDe3hNL-XIh_tcYsLgdVuOHe1nI='
end

Client Output

Your run will show

+data_collector.server_url https://chef-automate.test/data-collector/v0/
+data_collector.token yDe3hNL-XIh_tcYsLgdVuOHe1nI=

And your client.rb will have

data_collector.server_url https://chef-automate.test/data-collector/v0/
data_collector.token yDe3hNL-XIh_tcYsLgdVuOHe1nI=

And your next run will say

[2022-03-24T21:49:55+00:00] FATAL: Configuration error SyntaxError: /etc/chef/client.rb:7: unknown regexp options - chf
...llector.server_url https://chef-automate.test/data-collector...
...                          ^~~~~
/etc/chef/client.rb:8: syntax error, unexpected local variable or method, expecting end-of-input
data_collector.token yDe3hNL-XIh_tcYsLgdVuOHe1nI=
                     ^~~~~~~

[2022-03-24T21:49:55+00:00] FATAL: Aborting due to error in '/etc/chef/client.rb': /etc/chef/client.rb:7: unknown regexp options - chf
...llector.server_url https://chef-automate.test/data-collector...
...                          ^~~~~
/etc/chef/client.rb:8: syntax error, unexpected local variable or method, expecting end-of-input
data_collector.token yDe3hNL-XIh_tcYsLgdVuOHe1nI=
                     ^~~~~~~

And then you'll be distraught because you wanted to show someone something and instead it's totally broken

Stacktrace

@nrgetik nrgetik added the Status: Untriaged An issue that has yet to be triaged. label Mar 24, 2022
@johnmccrae johnmccrae self-assigned this Jan 9, 2024
@johnmccrae
Copy link
Contributor

renders correctly with Chef 18.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants