Skip to content

Commit e547a55

Browse files
committed
Ensure the puppet agent is running post-provision
Previously, the agent was not started on compilers and the replica. Additionally, because the agent was running on the master and postgresql nodes during install, that could sometimes interfere with directed runs. After this commit the Puppet agent is ensured stopped on all systems during provision to ensure full control of Puppet activity, and the agent is resumed at the end of configuration.
1 parent 6e70cc1 commit e547a55

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

plans/action/configure.pp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,14 @@
146146
)
147147
}
148148

149+
# Ensure Puppet agent service is running now that configuration is complete
150+
run_command('systemctl start puppet', peadm::flatten_compact([
151+
$master_target,
152+
$master_replica_target,
153+
$puppetdb_database_target,
154+
$puppetdb_database_replica_target,
155+
$compiler_targets,
156+
]))
157+
149158
return("Configuration of Puppet Enterprise ${arch['architecture']} succeeded.")
150159
}

plans/action/install.pp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@
205205
_catch_errors => $shortcircuit_puppetdb,
206206
tarball => $upload_tarball_path,
207207
peconf => '/tmp/pe.conf',
208+
puppet_service_ensure => 'stopped',
208209
shortcircuit_puppetdb => $shortcircuit_puppetdb,
209210
)
210211
out::message("Finished: task peadm::pe_install on ${master_target[0].name}")
@@ -232,8 +233,9 @@
232233
233234
# Run the PE installer on the puppetdb database hosts
234235
run_task('peadm::pe_install', $database_targets,
235-
tarball => $upload_tarball_path,
236-
peconf => '/tmp/pe.conf',
236+
tarball => $upload_tarball_path,
237+
peconf => '/tmp/pe.conf',
238+
puppet_service_ensure => 'stopped',
237239
)
238240
239241
# Now that the main PuppetDB database node is ready, finish priming the

tasks/pe_install.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
"shortcircuit_puppetdb": {
1313
"type": "Optional[Boolean]",
1414
"description": "If true, during install, configure PuppetDB to short-circuit its startup"
15+
},
16+
"puppet_service_ensure": {
17+
"type": "Optional[Enum['stopped']]",
18+
"description": "If 'stopped', ensure the Puppet agent is not running when install completes"
1519
}
1620
},
1721
"input_method": "environment",

tasks/pe_install.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ if [ "$PT_shortcircuit_puppetdb" = "true" ]; then
3131
rm /etc/systemd/system/pe-puppetdb.service.d/10-shortcircuit.conf
3232
systemctl daemon-reload
3333
fi
34+
35+
if [ "$PT_puppet_service_ensure" = "stopped" ]; then
36+
systemctl stop puppet.service
37+
fi

0 commit comments

Comments
 (0)