--- - hosts: all become: yes vars_files: - vars.yml tasks: - name: ensure the service is stopped service: name: "{{ service }}" state: stopped enabled: no when: service != None ignore_errors: true - name: ensure the firewall ports are closed firewalld: service: "{{ fwsvc }}" state: disabled immediate: true permanent: true when: fwsvc != None ignore_errors: true - name: remove the packages yum: name: "{{ packages }}" state: absent - name: remove any published templates file: path: "{{ item.dest }}" state: absent loop: "{{ configs }}" when: configs is defined - name: remove any static files file: path: "{{ item.dest }}" state: absent loop: "{{ staticfiles }}" when: staticfiles is defined ...