Initial install and setup of cfengine on a New World host

From techdocs
Jump to navigation Jump to search

The full cfengine documentation is on the cfengine web site.

Install cfengine for AWS clients

After Debian has been installed on a host (e.g., Initial setup of a Debian AMI instance) perform the following steps on the host:

  • Install the cfengine3 package:
# apt-get -y install cfengine3
# systemctl mask cf-monitord
# systemctl mask cf-serverd
# cd /var/lib/cfengine3
# mv inputs inputs.original
# mv masterfiles masterfiles.original
# rm -fr inputs masterfiles
# mkdir inputs masterfiles
  • Enable cf-execd in /etc/default/cfengine3
  • Set the host name (used by cf-agent)
  • Run: cf-agent -B <cfengine hub address> -v
  • Observe last line of output showing, hopefully, promises kept and repaired totalling 100% and promises not kept at 0%
  • cf-execd should now be running
  • Run cf-agent -K -v a few times until it stops repairing things, or just wWait and let cf-execd run cf-agent in the background. In the latter case kKeep an eye on /var/log/cfengine3/promise_summary.log

Rebooting is generally not required as the cf-agent will appropriately restart or reload any daemons or instantiate any other settings as it makes changes.