Skip to content

Commit

Permalink
Adding /etc/puppetlabs/enterprise/conf.d/pe.conf (puppetlabs#346)
Browse files Browse the repository at this point in the history
* Adding /etc/puppetlabs/enterprise/conf.d/pe.conf

When a database is added outside of the peadm::install plan, the /etc/puppetlabs/enterprise/conf.d/ directory structure is not created. When the peadm::upgrade plan is run, it fails because it can't write the pe.conf file because the directory doesn't exist. The contents of the file aren't that important, they get rewritten when the upgrade runs. This change just ensures the directory is there for it.

* Update add_database.pp

* Fix spec test

---------

Co-authored-by: Dimitri Tischenko <dimitri@puppet.com>
  • Loading branch information
Andrew Jones and timidri authored May 3, 2023
1 parent ac34985 commit afb3b41
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions plans/add_database.pp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,18 @@
}
}

# The pe.conf file needs to be in place or future upgrades will fail.
$pe_conf = peadm::generate_pe_conf({
'console_admin_password' => 'not used',
'puppet_enterprise::puppet_master_host' => $primary_host.peadm::certname(),
'puppet_enterprise::database_host' => $postgresql_target.peadm::certname(),
})

run_task('peadm::mkdir_p_file', $postgresql_target,
path => '/etc/puppetlabs/enterprise/conf.d/pe.conf',
content => ($pe_conf.parsejson()).to_json_pretty(),
)

# Start frontend compiler services so catalogs can once again be compiled by
# agents
run_command('systemctl start pe-puppetserver.service pe-puppetdb.service', $compilers)
Expand Down
2 changes: 1 addition & 1 deletion plans/status.pp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
$summary_json = {
'summary' => {
'status' => $overall_status,
'stacks' => $stack_table_rows.hash,
'stacks' => Hash($stack_table_rows),
},
'failed' => $failed,
'operational' => $passed,
Expand Down

0 comments on commit afb3b41

Please sign in to comment.