--- - name: stop and disable the httpd service systemd_service: state: stopped name: httpd enabled: false ignore_errors: yes - name: uninstall apache yum: name: - httpd state: removed - name: delete apache config file: dest: /etc/httpd state: absent - name: delete root apache directory file: path: "{{ item }}" state: absent with_items: - /var/www - /home/www - name: disable http port firewalld: systemd_service: http permanent: true immediate: true state: disabled