|
18 | 18 | String[1] $stagingdir = '/tmp',
|
19 | 19 | ) {
|
20 | 20 |
|
| 21 | + # Retrieve and deploy a couple of modules from the Forge so that they can be |
| 22 | + # used for ensuring some configuration. |
21 | 23 | $nm_module_tarball = 'WhatsARanjit-node_manager-0.7.1.tar.gz'
|
22 | 24 | pe_xl::retrieve_and_upload(
|
23 | 25 | "https://forge.puppet.com/v3/files/${nm_module_tarball}",
|
|
38 | 40 | run_command("/opt/puppetlabs/bin/puppet module install /tmp/${pexl_module_tarball}", $primary_master_host)
|
39 | 41 | run_command('chown -R pe-puppet:pe-puppet /etc/puppetlabs/code', $primary_master_host)
|
40 | 42 |
|
| 43 | + # Set up the console node groups to configure the various hosts in their |
| 44 | + # roles |
41 | 45 | run_task('pe_xl::configure_node_groups', $primary_master_host,
|
42 | 46 | primary_master_host => $primary_master_host,
|
43 | 47 | primary_master_replica_host => $primary_master_replica_host,
|
|
46 | 50 | compile_master_pool_address => $compile_master_pool_address,
|
47 | 51 | )
|
48 | 52 |
|
| 53 | + # Run Puppet in no-op on the compile masters so that their status in PuppetDB |
| 54 | + # is updated and they can be identified by the puppet_enterprise module as |
| 55 | + # CMs |
| 56 | + run_task('pe_xl::puppet_runonce', $compile_master_hosts, |
| 57 | + noop => true, |
| 58 | + ) |
| 59 | + |
| 60 | + # Run Puppet on the PuppetDB Database hosts to update their auth |
| 61 | + # configuration to allow the compile masters to connect |
49 | 62 | run_task('pe_xl::puppet_runonce', [
|
50 |
| - $primary_master_host, |
51 | 63 | $puppetdb_database_host,
|
52 |
| - $primary_master_replica_host, |
53 | 64 | $puppetdb_database_replica_host,
|
54 | 65 | ])
|
55 | 66 |
|
56 |
| - # Run the PE Replica Provision |
57 |
| - run_task('pe_xl::provision_replica', $primary_master_host, |
58 |
| - primary_master_replica => $primary_master_replica_host, |
59 |
| - ) |
60 |
| - |
| 67 | + # Run Puppet in normal mode on compile master hosts to finish configuration |
61 | 68 | run_task('pe_xl::puppet_runonce', [
|
62 | 69 | $primary_master_host,
|
63 |
| - $primary_master_replica_host, |
| 70 | + $compile_master_hosts, |
64 | 71 | ])
|
65 | 72 |
|
66 |
| - run_task(pe_xl::configure_replica_db_node_group, $primary_master_host, |
67 |
| - puppetdb_database_replica_host => $puppetdb_database_replica_host, |
| 73 | + # Run the PE Replica Provision |
| 74 | + run_task('pe_xl::provision_replica', $primary_master_host, |
| 75 | + primary_master_replica => $primary_master_replica_host, |
68 | 76 | )
|
69 |
| - if $compile_master_hosts { |
70 |
| - run_task('pe_xl::puppet_runonce', $compile_master_hosts) |
71 |
| - } |
72 | 77 |
|
| 78 | + #run_task('pe_xl::puppet_runonce', [ |
| 79 | + # $primary_master_host, |
| 80 | + # $primary_master_replica_host, |
| 81 | + #]) |
| 82 | + |
| 83 | + #run_task(pe_xl::configure_replica_db_node_group, $primary_master_host, |
| 84 | + # puppetdb_database_replica_host => $puppetdb_database_replica_host, |
| 85 | + #) |
73 | 86 | if $load_balancer_host {
|
74 | 87 | run_task('pe_xl::puppet_runonce', $load_balancer_host)
|
75 | 88 | }
|
76 | 89 |
|
77 |
| - if $compile_master_hosts { |
78 |
| - run_task('pe_xl::puppet_runonce', $compile_master_hosts) |
79 |
| - } |
80 |
| - |
81 | 90 | return('Configuration of Puppet Enterprise with replica succeeded.')
|
82 | 91 | }
|
0 commit comments