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

Replace opscode from folder names, hardcodes of chef-server.rb, chef-server-running.json, chef-secrets.json #3101

Closed
wants to merge 11 commits into from

Conversation

@aleksey-hariton aleksey-hariton requested review from a team as code owners January 20, 2022 12:53
@netlify
Copy link

netlify bot commented Jan 20, 2022

👷 Deploy Preview for chef-server processing.

🔨 Explore the source changes: 61f45d2

🔍 Inspect the deploy log: https://app.netlify.com/sites/chef-server/deploys/6216708bbc52e800081668a0

@@ -78,11 +81,11 @@
# The Chef User that services run as
####
# The username for the chef services user
default['private_chef']['user']['username'] = 'opscode'
default['private_chef']['user']['username'] = ChefUtils::Dist::Org::LEGACY_CONF_DIR
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a username, but we're using a dirname const. If we want to change the default username, this should have its own const.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marcparadise Would you like us to add something like ChefUtils::Dist::Server::USERNAME to chef-utils?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lbakerchef
Copy link
Contributor

At a minimum I think we need to see that the output (it can be snipped) of chef-server-ctl test or even chef-server-ctl test --all is successful. [NOTE: I tried to run an adhoc and planned to run umbrella after, but these apparently don't play nice with forks]

Copy link
Contributor

@ramereth ramereth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches what we have on the Cinc side FWIW ...

@@ -1,7 +1,7 @@
require "tempfile"
require "veil"

secrets_file = ENV['SECRETS_FILE'] || "/etc/opscode/private-chef-secrets.json"
secrets_file = ENV['SECRETS_FILE'] || "/etc/#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}/private-chef-secrets.json"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
secrets_file = ENV['SECRETS_FILE'] || "/etc/#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}/private-chef-secrets.json"
secrets_file = ENV['SECRETS_FILE'] || "/etc/#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}/private-#{ChefUtils::Dist::Infra::SHORT}-secrets.json"

@@ -334,7 +334,7 @@ def gen_api_fqdn

# TODO: 2017-02-28 mp: configurable location:
def secrets_json
'/etc/opscode/private-chef-secrets.json'
"/etc/#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}/private-chef-secrets.json"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"/etc/#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}/private-chef-secrets.json"
"/etc/#{ChefUtils::Dist::Org::LEGACY_CONF_DIR}/private-#{ChefUtils::Dist::Infra::SHORT}-secrets.json"

Signed-off-by: Aleksey Hariton <aleksey.hariton@gmail.com>
@aleksey-hariton aleksey-hariton changed the title WIP: replace opscode from folder names, remove hardcodes of chef-server.rb Replace opscode from folder names, hardcodes of chef-server.rb, chef-server-running.json, chef-secrets.json Feb 22, 2022
@jashaik
Copy link
Contributor

jashaik commented Feb 23, 2022

Pipeline Information -
Adhoc - https://buildkite.com/chef/chef-chef-server-main-omnibus-adhoc/builds/3947
Pipeline status:
Reconfigure is failing with the below error. Needs to be fixed

I am going to test this manually in dev VM
`
Error:

opscode_erchef['keygen_start_size'] = 30
  | opscode_erchef['keygen_cache_size']=60
  | nginx['ssl_dhparam']='/etc/opscode/dhparam.pem'
  | insecure_addon_compat false
  | data_collector['token'] = 'foobar'
  | profiles['root_url'] = 'http://localhost:9998'
  | -----BEGIN DH PARAMETERS-----
  | MIIBCAKCAQEAtAvx3pUHBNcK2nD58nPPlKtJzZvrFCyKEn9BSn16/BmFwBhL8rh4
  | +fkrnLflZ/k9wJjiUkU0DCi+Fy6DUohPHOmmT0BiuwgsDZAFDyTj0PeZKINpbHnQ
  | EbZENzWo5s5hsb1zVxIMEtTMRrigdHM3FQupFbzOHxonkO0JlocarOJBHGX+Crjp
  | y/8SReCpC71R+Vl6d4+Dw6GFdL+6k6W558dPfq3UeV8HPWQEaM7/jXDUKJZ0tB6a
  | 1csrekkz3gBFlSjSxececRVn8bm5dTfc86rIWJWeWQVLYdBFT6zi43AvF+nLYKYh
  | +oVnVrhWgOLYvEKX311d9SaqcdrXVFscYwIBAg==
  | -----END DH PARAMETERS-----
  | Traceback (most recent call last):
  | 7: from /usr/bin/chef-server-ctl:174:in `<main>'
  | 6: from /usr/bin/chef-server-ctl:174:in `load'
  | 5: from /opt/opscode/embedded/lib/ruby/gems/2.7.0/gems/chef-server-ctl-1.1.0/bin/chef-server-ctl:7:in `<top (required)>'
  | 4: from /opt/opscode/embedded/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
  | 3: from /opt/opscode/embedded/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:83:in `require'
  | 2: from /opt/opscode/embedded/lib/ruby/gems/2.7.0/gems/chef-server-ctl-1.1.0/lib/chef_server_ctl/config.rb:19:in `<top (required)>'
  | 1: from /opt/opscode/embedded/lib/ruby/gems/2.7.0/gems/chef-server-ctl-1.1.0/lib/chef_server_ctl/config.rb:20:in <module:ChefServerCtl>'
  | /opt/opscode/embedded/lib/ruby/gems/2.7.0/gems/chef-server-ctl-1.1.0/lib/chef_server_ctl/config.rb:28:in <module:Config>': uninitialized constant ChefUtils::Dist::Server::SERVER_DOCS (NameError)
  | 🚨 Error: The command exited with status 1

@marcparadise
Copy link
Member

Maybe that failure will be fixed if we update the Chef gem? The const is present:

https://github.com/chef/chef/blob/main/chef-utils/lib/chef-utils/dist.rb#L115

@ramereth
Copy link
Contributor

Maybe that failure will be fixed if we update the Chef gem? The const is present:

https://github.com/chef/chef/blob/main/chef-utils/lib/chef-utils/dist.rb#L115

Yes, should we go ahead and bump it in this PR or do it in a different PR? The latest 16 release should include the constant (v16.17.51)

@ramereth ramereth mentioned this pull request Feb 24, 2022
5 tasks
@ramereth
Copy link
Contributor

@aleksey-hariton @lbakerchef @marcparadise @jashaik I have created #3205 to replace this PR which should have the final fixes (hopefully). This is created from our shared repo which will make it easier for our group to push any additional fixes to.

@aleksey-hariton
Copy link
Contributor Author

Closing in favor to #3205

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants