Puppet agent disabled after build process

I am still not able to find the issue here :frowning:

But a workaround is to clone both templates and modify them. The finish template to call the new snippet, and the second one to run different commands:

In the new finish template, instead of:

<% if puppet_enabled %>
<% if host_param_true?('enable-puppetlabs-repo') || host_param_true?('enable-puppetlabs-puppet6-repo') || host_param_true?('enable-puppetlabs-puppet5-repo') -%>
<%= snippet 'puppetlabs_repo' %>
<% end -%>
<%= snippet 'puppet_setup' %>
<% end -%>

Use

<% if puppet_enabled %>
<% if host_param_true?('enable-puppetlabs-repo') || host_param_true?('enable-puppetlabs-puppet6-repo') || host_param_true?('enable-puppetlabs-puppet5-repo') -%>
<%= snippet 'puppetlabs_repo' %>
<% end -%>
<%= snippet 'puppet_setup_NEWNAME' %>
<% end -%>

And in the puppet_config_NEWNAME:
Instead of:

<%= bin_path %>/puppet resource service puppet enable=true

now:

/bin/systemctl enable puppet
<%= bin_path %>/puppet agent -t

Additionally, I’ve changed the names in both new templates in row 3 accordingly since I think it is required.

Old:

<%#
kind: finish
name: Preseed default finish 
model: ProvisioningTemplate
oses:
...
...

New:

<%#
kind: finish
name: Preseed default finish NEWNAME
model: ProvisioningTemplate
oses:
...
...

Also the operating system configuration needs to point the the new finish template.