--- - name: Installing httpd hosts: node2 tasks: - name: installation yum: name: httpd state: installed - name: Creating Directory under / file: path: /website state: directory setype: httpd_sys_content_t - name: Creating a file under /website to host copy: content: Hello Testing for the SELinux and firewalld is successful through playbook dest: /website/index.html setype: httpd_sys_content_t - name: Copying configuration file from master to slave domain.configuration copy: src: /root/playbooks/web1.conf dest: /etc/httpd/conf.d/web1.conf setype: httpd_config_t - name: Adding service in the firewalld firewalld: immediate: true permanent: true state: enabled service: http - name: Adding service in the firewalld firewalld: immediate: true permanent: true state: enabled service: https - name: Restarting service firewalld and httpd service: name: "{{ item }}" enabled: true state: reloaded with_items: - httpd - firewalld ...