Search code examples
puppetpuppet-enterprise

how to change the masterport in a puppet-enterprise monolithic installation


till now i have been using puppet-enterprise 3.8.6 and i am finally allowed to upgrade to the latest version (2018.1.3).
in puppet 3.8.6 i was able to change the masterport by

  1. setting the puppet_enterprise::puppet_master_port parameter,
  2. execute puppet agent (which fails),
  3. stopping all puppet services,
  4. looking by hand for config files under /etc/puppetlabs and /opt/puppetlabs still containing 8140, and replace that value by the new port value in all places,
  5. restarting all puppet services and
  6. executing puppet agent once more

which is not nice nor easy nor fast, but it worked.

when i try to do that with the latest version i get on step 6 that there are still some few places where the value is reverted and the agent fails, in special:

puppet:~ # find /etc/puppetlabs/ -name "*.conf" -o -name "*.yaml" | xargs grep 8140 /etc/puppetlabs/console-services/conf.d/console.conf: "url": "https://puppet:8140" /etc/puppetlabs/client-tools/services.conf: "port": 8140, /etc/puppetlabs/client-tools/services.conf: "status_url": "https://puppet:8140/status", /etc/puppetlabs/client-tools/services.conf: "url": "https://puppet:8140/"

and i figured out that those files are managed by the classes trapperkeeper/console_services.pp and cli_config.pp, respectively, and there the wrong port value comes from a "service_port" parameter, which i do not understand from which hiera value is read, but it does not default to the puppet_enterprise::puppet_master_port parameter.

Any hint how to get the service_port parameter set to a new value? Or, is not there a better way to change the master port?

many thanks
Michael

UPDATE:

i now understand that the parameter service_port a local variable is, as well as the status_port, that are read from class_parameters in an iteration.

and the relevant parameter is set a few lines above as Puppet_enterprise::Profile::Master::ssl_listen_port which defaults to puppet_enterprise::puppet_master_port. so i still do not understand why it does not work.


Solution

  • at the end i managed to run the puppet agent, shortly redirecting traffic from old port to the new one, with:

    socat tcp-listen:8140,reuseaddr,fork tcp:localhost:<newport>