@@ -175,20 +175,28 @@ bundle agent apachectl_patched_for_upgrade
175175 edit_template => "$(this.promise_dirname)/templates/apachectl.mustache",
176176 handle => "apachectl_content_pre_create_default_templated_files",
177177 template_method => "mustache",
178- template_data => parsejson( '{ "cfengine_enterprise_mission_portal_httpd_dir": "$(sys.workdir)/httpd" }');
178+ template_data => parsejson( '{ "cfengine_enterprise_mission_portal_httpd_dir": "$(sys.workdir)/httpd" }'),
179+ classes => results("bundle", "apachectl_file");
179180
180181 _running_cfengine_version_where_templated_files_NOT_automatically_created::
181182 "$(sys.workdir)/httpd/bin/apachectl"
182183 create => "true",
183184 edit_template => "$(this.promise_dirname)/templates/apachectl.mustache",
184185 handle => "apachectl_content_post_create_default_templated_files",
185186 template_method => "mustache",
186- template_data => parsejson( '{ "cfengine_enterprise_mission_portal_httpd_dir": "$(sys.workdir)/httpd" }');
187+ template_data => parsejson( '{ "cfengine_enterprise_mission_portal_httpd_dir": "$(sys.workdir)/httpd" }'),
188+ classes => results("bundle", "apachectl_file");
187189
188190 cfengine::
189191 "$(sys.workdir)/httpd/bin/apachectl"
190192 handle => "apachectl_perms",
191193 perms => mog( "0755", "root", "root" );
194+
195+ commands:
196+ # This only runs if apachectl touched (repaired) and restorecon path exists
197+ apachectl_file_repaired.default:_stdlib_path_exists_restorecon::
198+ "$(default:paths.restorecon) -v $(sys.workdir)/httpd/bin/apachectl"
199+ comment => "Ensure the templated apachectl has the correct SELinux context.";
192200}
193201
194202bundle agent cfe_internal_enterprise_mission_portal_apache
0 commit comments