Skip to content

(PUP-10670) Create serverport setting and alias #8353

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

Merged

Conversation

GabrielNagy
Copy link
Contributor

This commit creates a serverport setting which serves the same
functionality as masterport. Update the puppet code itself to use the
new setting, and add a hook to the old one to always set the new one as
well.

TBD: are we deprecating the masterport setting?

@GabrielNagy GabrielNagy force-pushed the PUP-10670/add-serverport-setting branch from 4c87fb5 to 9321786 Compare October 2, 2020 09:40
@ciprianbadescu
Copy link
Contributor

The behavior does not look right:

cbadescu@ciprian:~/puppetlabs/puppet$ bx puppet config print masterport
Warning: Setting 'masterport' is being deprecated in favor of 'serverport'.
   (location: /home/cbadescu/puppetlabs/puppet/lib/puppet/defaults.rb:1368:in `block in initialize_default_settings!')
9876
cbadescu@ciprian:~/puppetlabs/puppet$ bx puppet config print serverport
Warning: Setting 'masterport' is being deprecated in favor of 'serverport'.
   (location: /home/cbadescu/puppetlabs/puppet/lib/puppet/defaults.rb:1368:in `block in initialize_default_settings!')
9876

@puppetcla
Copy link

CLA signed by all contributors.

This commit creates a `serverport` setting which serves the same
functionality as `masterport`. Update the puppet code itself to use the
new setting, and add a hook to the old one to always set the new one as
well.

TBD: are we deprecating the `masterport` setting?
Update the existing spec tests to use the `serverport` setting instead
of `masterport`, and add tests to validate the behavior when setting
`masterport`.

Update the `can_enumerate_environments` acceptance test to use the
`serverport` setting.
@GabrielNagy GabrielNagy force-pushed the PUP-10670/add-serverport-setting branch from 9321786 to 209ee3d Compare October 2, 2020 11:18
@GabrielNagy
Copy link
Contributor Author

@ciprianbadescu I removed that warning, it's kinda noisy as it shows up for any setting you query if you have the masterport set somewhere.

We have some more masterport references in the ext/ directory. I left them as is, but something tells me these aren't used anymore:

ext/suse/server.init
45:[ -n "$PUPPETMASTER_PORTS" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS[0]}"

ext/redhat/server.init
27:[ -n "$PUPPETMASTER_PORTS" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS[0]}"

ext/debian/puppetmaster.init
53:            --startas $DAEMON -- $NAME $DAEMON_OPTS --masterport=$PORT

@GabrielNagy GabrielNagy marked this pull request as ready for review October 2, 2020 11:36
@GabrielNagy GabrielNagy requested review from a team October 2, 2020 11:36
@GabrielNagy
Copy link
Contributor Author

jenkins please test this with servertests

@ciprianbadescu
Copy link
Contributor

ciprianbadescu commented Oct 2, 2020

We have some more masterport references in the ext/ directory. I left them as is, but something tells me these aren't used anymore:

ext/suse/server.init
45:[ -n "$PUPPETMASTER_PORTS" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS[0]}"

ext/redhat/server.init
27:[ -n "$PUPPETMASTER_PORTS" ] && PUPPETMASTER_OPTS="${PUPPETMASTER_OPTS} --masterport=${PUPPETMASTER_PORTS[0]}"

ext/debian/puppetmaster.init
53:            --startas $DAEMON -- $NAME $DAEMON_OPTS --masterport=$PORT

I think they can be set from places like /etc/sysconfig/puppet, I suppose they should be adapted
But I don't k now if we package those files or similar files from puppet-agent repo

@joshcooper joshcooper closed this Oct 2, 2020
@joshcooper joshcooper reopened this Oct 2, 2020
@joshcooper
Copy link
Contributor

TBD: are we deprecating the masterport setting?

I think we shouldn't deprecate it (or other things like puppet config set external_nodes <...> --section master) because of the noise factor. At some point in the future we can deprecate (probably 7.x) and remove in 8.

ext/suse/server.init, ext/debian/puppetmaster.init

I believe those scripts are left over from the ruby puppet master (webrick & passenger) and can be removed. I'd be fine filing a separate ticket to clean up that directory.

@joshcooper
Copy link
Contributor

jenkins please test this with servertests

@GabrielNagy
Copy link
Contributor Author

Filed PUP-10685 for cleaning up the ext/ directory.

@joshcooper joshcooper merged commit a2230bc into puppetlabs:master Oct 6, 2020
GabrielNagy added a commit to GabrielNagy/puppet that referenced this pull request Oct 9, 2020
…/add-serverport-setting"

This reverts commit a2230bc, reversing
changes made to 894a8d4.

The default `masterport` value became a string (due to the interpolation
of `$serverport`), which breaks puppetserver unit tests.

Revert this change and open a new PR which also includes a `port`
setting type.
gimmyxd added a commit that referenced this pull request Oct 9, 2020
Revert "Merge pull request #8353 from GabrielNagy/PUP-10670/add-serve…
joshcooper added a commit to joshcooper/puppet that referenced this pull request Oct 9, 2020
* upstream/master:
  (PUP-8014) Return environment_ttl in environments REST API
  (PUP-8014) Dry environments API tests
  (PUP-8014) Cache most recently used environments
  (PUP-8014) Touch environments as they are retrieved from the cache
  (PUP-8014) Add environment_ttl to replace environment_timeout
  (packaging) Updating manpage file for master
  (packaging) Updating the puppet.pot file
  Revert "Merge pull request puppetlabs#8353 from GabrielNagy/PUP-10670/add-serverport-setting"
  (PUP-10671) Update setting section search path
  (packaging) Updating manpage file for 5.5.x
  (packaging) Bump to version '5.5.23' [no-promote]
  (PUP-9505) Quote facts that contain special string
  (PUP-8014) Call cache expiration service with symbolic environment name

Conflicts:
	lib/puppet/face/status.rb
	lib/puppet/indirector/request.rb
	lib/puppet/rest/route.rb
	lib/puppet/util/connection.rb
	locales/puppet.pot
	man/man5/puppet.conf.5
	man/man8/puppet-status.8
	spec/unit/indirector/request_spec.rb
	spec/unit/indirector/rest_spec.rb
	spec/unit/indirector/status/rest_spec.rb
	spec/unit/rest/route_spec.rb

The `puppet status` CLI and `Puppet::Rest::Route` class were deleted in main.

The HTTP client code was removed from `Puppet::Indirector::Request#do_request`
and `Puppet::Indirector::Rest` in main which conflicted with the masterport
changes.
joshcooper added a commit to joshcooper/puppet that referenced this pull request Oct 9, 2020
* upstream/master:
  (PUP-8014) Return environment_ttl in environments REST API
  (PUP-8014) Dry environments API tests
  (PUP-8014) Cache most recently used environments
  (PUP-8014) Touch environments as they are retrieved from the cache
  (PUP-8014) Add environment_ttl to replace environment_timeout
  (packaging) Updating manpage file for master
  (packaging) Updating the puppet.pot file
  Revert "Merge pull request puppetlabs#8353 from GabrielNagy/PUP-10670/add-serverport-setting"
  (PUP-10671) Update setting section search path
  (packaging) Updating manpage file for 5.5.x
  (packaging) Bump to version '5.5.23' [no-promote]
  (PUP-9505) Quote facts that contain special string
  (PUP-8014) Call cache expiration service with symbolic environment name

Conflicts:
	lib/puppet/face/status.rb
	lib/puppet/indirector/request.rb
	lib/puppet/rest/route.rb
	lib/puppet/util/connection.rb
	locales/puppet.pot
	man/man5/puppet.conf.5
	man/man8/puppet-status.8
	spec/unit/indirector/request_spec.rb
	spec/unit/indirector/rest_spec.rb
	spec/unit/indirector/status/rest_spec.rb
	spec/unit/rest/route_spec.rb

The `puppet status` CLI and `Puppet::Rest::Route` class were deleted in main.

The HTTP client code was removed from `Puppet::Indirector::Request#do_request`
and `Puppet::Indirector::Rest` in main which conflicted with the masterport
changes.
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.

4 participants