|
| 1 | +# Add Compilers |
| 2 | + |
| 3 | +- [Add Compilers](#Add-Compilers) |
| 4 | + - [Introduction](#Introduction) |
| 5 | + - [Add compilers to an existing PE cluster](#Add-compilers-to-an-existing-PE-cluster) |
| 6 | + - [Running the `add_compilers` plan](#running-the-add_compilers-plan) |
| 7 | + - [Optional Parameters](#optional-parameters) |
| 8 | + |
| 9 | +## Introduction |
| 10 | + |
| 11 | +The `peadm::add_compilers` plan can be used to add new compilers to a PE cluster or replace an existing with new configuration. |
| 12 | + |
| 13 | +## Add compilers to an existing PE cluster |
| 14 | + |
| 15 | +As seen in the example below, this is the minimal parameters required to add a compiler to an existing PE cluster. These can be passed as command line variables to the plan, or in this case added to a params.json file. |
| 16 | + |
| 17 | +```json |
| 18 | +{ |
| 19 | + "compiler_hosts": "pe-xl-compiler-0.lab1.puppet.vm", |
| 20 | + "primary_host": "pe-xl-core-0.lab1.puppet.vm" |
| 21 | +} |
| 22 | +``` |
| 23 | + |
| 24 | +And for multiple compilers, this is the minimal parameters required. |
| 25 | + |
| 26 | +```json |
| 27 | +{ |
| 28 | + "compiler_hosts": [ |
| 29 | + "pe-xl-compiler-0.lab1.puppet.vm", |
| 30 | + "pe-xl-compiler-1.lab1.puppet.vm" |
| 31 | + ], |
| 32 | + "primary_host": "pe-xl-core-0.lab1.puppet.vm" |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +## Running the `add_compiler` plan |
| 37 | + |
| 38 | +``` |
| 39 | +bolt plan run peadm::add_compilers --params @params.json |
| 40 | +``` |
| 41 | + |
| 42 | +This command will retrieve the current PEADM configuration to determine the setup rules needed for a compiler's secondary PuppetDB instances. The plan will configure the primary with appropriate rules for allowing access from the new compiler. On the primary, the `puppet` service is stopped and the `pe-postgresql` service is reloaded. If required, a puppet agent will be installed on the new compiler host. The compiler agent's certificate is regenerated to include data required by the `peadm::subplans::component_install` plan. A subsequent Puppet agent run will happen on the following components. |
| 43 | + |
| 44 | +- _\<compiler-host\>_ |
| 45 | +- _\<primary_postgresql_host\>_ |
| 46 | +- _\<replica host\>_ |
| 47 | +- _\<primary_postgresql_host\>_ |
| 48 | + |
| 49 | +The `puppet` service is then restarted. |
| 50 | + |
| 51 | +## Optional Parameters |
| 52 | + |
| 53 | +As well as `compiler_hosts` and `primary_host`, the `add_compiler` plan has a number of optional parameters. These can be viewed in the following params example. |
| 54 | + |
| 55 | +```json |
| 56 | +{ |
| 57 | + "avail_group_letter": "B", |
| 58 | + "compiler_hosts": "pe-xl-compiler-0.lab1.puppet.vm", |
| 59 | + "dns_alt_names": ["puppet,puppet.lab1.puppet.vm"], |
| 60 | + "primary_host": "pe-xl-core-0.lab1.puppet.vm", |
| 61 | + "primary_postgresql_host": "pe-psql-6251cd-0.us-west1-a.c.slice-cody.internal" |
| 62 | +} |
| 63 | +``` |
| 64 | + |
| 65 | +for multiple compilers. |
| 66 | + |
| 67 | +```json |
| 68 | +{ |
| 69 | + "avail_group_letter": "B", |
| 70 | + "compiler_hosts": [ |
| 71 | + "pe-xl-compiler-0.lab1.puppet.vm", |
| 72 | + "pe-xl-compiler-1.lab1.puppet.vm" |
| 73 | + ], |
| 74 | + "dns_alt_names": [ |
| 75 | + "puppet,puppet.lab1.puppet.vm", |
| 76 | + "puppet2,puppet.lab2.puppet.vm" |
| 77 | + ], |
| 78 | + "primary_host": "pe-xl-core-0.lab1.puppet.vm", |
| 79 | + "primary_postgresql_host": "pe-psql-6251cd-0.us-west1-a.c.slice-cody.internal" |
| 80 | +} |
| 81 | +``` |
| 82 | + |
| 83 | +Please note, the optional parameters and values of the plan are as follows. |
| 84 | + |
| 85 | +<!-- table --> |
| 86 | + |
| 87 | +| Parameter | Default value | Description | |
| 88 | +| ------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------ | |
| 89 | +| `avail_group_letter` | `A` | By default, each compiler will be added to the primary group A. | |
| 90 | +| `dns_alt_names` | `undef` | | |
| 91 | +| `primary_postgresql_host` | `undef` | By default, this will pre-populate to the required value depending if your architecture contains HA and or external databases. | |
| 92 | + |
| 93 | +For more information around adding compilers to your infrastructure [Expanding Your Deployment](expanding.md#adding-compilers-with-peadmadd_compiler) |
0 commit comments