Skip to content

Latest commit

 

History

History
36 lines (32 loc) · 1.56 KB

proc_restoring-manual-changes-overwritten-by-a-puppet-run.adoc

File metadata and controls

36 lines (32 loc) · 1.56 KB

Restoring manual changes overwritten by a Puppet run

If your manual configuration has been overwritten by a Puppet run, you can restore the files to the previous state.

For example, when you install and configure {Project} for the first time by using {foreman-installer}, you can use the --foreman-proxy-dns-managed=false and --foreman-proxy-dhcp-managed=false options to specify that the DNS and DHCP configuration files are not to be managed by Puppet. If you do not use these options during the initial {foreman-installer} run, rerunning {foreman-installer} overwrites all manual changes. The following example shows you how to restore a DHCP configuration file overwritten by a Puppet run.

Procedure
  1. Copy the file you intend to restore. This allows you to compare the files to check for any mandatory changes required by the upgrade. This is not common for DNS or DHCP services.

    # cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.backup
  2. Check the log files to note down the md5sum of the overwritten file. For example:

    # journalctl -xe
    ...
    /Stage[main]/Dhcp/File[/etc/dhcp/dhcpd.conf]: Filebucketed /etc/dhcp/dhcpd.conf to puppet with sum 622d9820b8e764ab124367c68f5fa3a1
    ...
  3. Restore the overwritten file:

    # puppet filebucket restore --local --bucket \
    /var/lib/puppet/clientbucket /etc/dhcp/dhcpd.conf \ 622d9820b8e764ab124367c68f5fa3a1
  4. Compare the backup file and the restored file, and edit the restored file to include any mandatory changes required by the upgrade.