puppetlabs/puppetlabs-peadm

The add_replica does not add a replica. It replaces an existing replica

gigpacknaxe opened this issue · 7 comments

Please consider renaming peadm::add_replica to peadm::replace_replica. The name is misleading and I could not find docs easily that explained its function. I ended up reading the code to learn what it was doing.

Please consider adding a plan that will add a replica to a puppet infrastructure that is not already configured with HA. This is what I was hoping to achieve and add_replica does not add replica...lol.

ody commented

@gigpacknaxe The peadm::add_replica plan was developed to serve both purposes, addition in situations here HA/DR did not yet exist and those where a failed replica needed to be replaced. I went through the add new replica to a fresh deployment which did not already have HA/DR configured workflow and the plan completed successfully.

Did the plan return any errors when you attempted to utilize it?

@ody I spent 10 minutes writing my response only to realize I think I found the solution. First let me address your question about an error. Yes, I am getting an error message. It is unable to stop the puppet service on the replica postgres. This is because the replica postgres does not exist.

I think this is not a bug and more of a documentation issue. I cannot get the plans tab of the peadm module to load. I am relying heavily on reading code and comments for documentation. I missed the plan to add_database. I am assuming that plan will build the replica postgres. Once that is built, there will be a puppet service to stop. However, the add_database has no documentation or comments. Without documentation it will be trial and error.

I am not sure what the next step is with this issue.

ody commented

@gigpacknaxe Are you trying to add a replica to an Extra Large deployment architecture? That is the only time you should have to set the replica_postgresql_host parameter, it is not required for Large and Standard. If you would like to add the replica on an XL deployment then yes, you'll need to add a database replica first. This is done by running the following plan.

bolt plan run peadm::add_database -t <new-replica-postgres-server-fqdn> primary_host=<primary-server-fqdn>

After that finishes then you can run peadm::add_replica plan with the replica_prostgresql_host parameter.

As for the plans not being listed when you run bolt plan show, this is because peadm is not a project but instead just a normal module. To make the plans show up you'll need to create a new project and add the peadm module to it. This is described here: https://github.com/puppetlabs/puppetlabs-peadm/blob/main/documentation/install.md#bolt-3-usage.

ody commented

Oh. As for this ticket...it highlights a gap in our documentation. There is a section of the repository which outlines several things, including how to use the plans we're discussing but only in the context of recovery. We should have documentation which describes the requirements and workflow for doing things like converting from Standard to Large or for adding DR functionality to an Extra Large deployment.

@gigpacknaxe Let me know if this type of documentation would be helpful.

@ody Yes, I was trying to add a replica to an existing XL deployment. We are moving to this exact design. I was testing in the lab with adding a replica. However, I think we are going to go an entirely different route.

A new issue arose when we learned that PE does not currently "support" having a mixed os major infrastructure. We have decided to build the entire XL with HA/DR as new rhel8 then migrate the nodes from the legacy puppet inf. This path seems safer and easier.

Thank you for the link. I will read the rest of the documentation you recommended. The documentation I was referring to was on the forge and not using bolt from the cli. This is a screen shot of what I get on vpn, off vpn, and even from my cell phone. I've tried Edge and clearing my browser history.

image

BTW, I was able to work around the PE mixed os major issue.

  1. On the primary, I created a repo dir named 2019.8.11_el8 in /opt/puppetlabs/server/data/packages/public/
  2. I extracted the 2019.8.11 el8 puppet installer tarball and copied the extracted repo into the dir I created
  3. I created a puppet_enterprise symlink in the repo dir that points to the repo I copied
  4. I created a node group for my el8 servers and added this data
    • puppet_enterprise::packages::pe_ver: 2019.8.11_el8

When the peadm plan installs puppet on the new el8 servers, their puppet_enterprise.repo file is pointed to the manually created repo that only contans the el8 packages. Once they are installed and services are running puppet doesn't seem to care about the underlying os major.

This was only tested with adding a compiler pool. The adding of a replica failed as mentioned and we have since changed our direction.

ody commented

Documentation meant to address the usage of peadm::add_replica, peadm::add_compiler, and peadm::add_database plans have been committed: https://github.com/puppetlabs/puppetlabs-peadm/blob/main/documentation/expanding.md.