@@ -58,20 +58,28 @@ bundle agent apachectl_patched_for_upgrade
5858 edit_template => "$(this.promise_dirname)/templates/apachectl.mustache",
5959 handle => "apachectl_content_pre_create_default_templated_files",
6060 template_method => "mustache",
61- template_data => parsejson( '{ "cfengine_enterprise_mission_portal_httpd_dir": "$(sys.workdir)/httpd" }');
61+ template_data => parsejson( '{ "cfengine_enterprise_mission_portal_httpd_dir": "$(sys.workdir)/httpd" }'),
62+ classes => results("bundle", "apachectl_file");
6263
6364 _running_cfengine_version_where_templated_files_NOT_automatically_created::
6465 "$(sys.workdir)/httpd/bin/apachectl"
6566 create => "true",
6667 edit_template => "$(this.promise_dirname)/templates/apachectl.mustache",
6768 handle => "apachectl_content_post_create_default_templated_files",
6869 template_method => "mustache",
69- template_data => parsejson( '{ "cfengine_enterprise_mission_portal_httpd_dir": "$(sys.workdir)/httpd" }');
70+ template_data => parsejson( '{ "cfengine_enterprise_mission_portal_httpd_dir": "$(sys.workdir)/httpd" }'),
71+ classes => results("bundle", "apachectl_file");
7072
7173 cfengine::
7274 "$(sys.workdir)/httpd/bin/apachectl"
7375 handle => "apachectl_perms",
7476 perms => mog( "0755", "root", "root" );
77+
78+ commands:
79+ # This only runs if apachectl touched (repaired) and restorecon path exists
80+ apachectl_file_repaired.default:_stdlib_path_exists_restorecon::
81+ "$(default:paths.restorecon) $(sys.workdir)/httpd/bin/apachectl"
82+ comment => "Ensure the templated apachectl has the correct SELinux context.";
7583}
7684
7785bundle agent cfe_internal_enterprise_mission_portal_apache
0 commit comments