- name: Fetch webpages and check response hosts: localhost gather_facts: false vars: hosts: - "mail.ps.develcow.de" - "mail.np.develcow.de" tasks: - name: Fetch webpage uri: url: "https://{{ item }}" return_content: yes register: webpage_response loop: "{{ hosts }}" - name: Fail if mailcow UI is not working - Skipping = OK fail: msg: "UI not OK" loop: "{{ webpage_response.results }}" when: "'showVersionModal' not in item.content" no_log: true ignore_errors: yes - name: Check SMTP Port 25 connection wait_for: host: "{{ item }}" port: 25 state: started delay: 0 timeout: 3 loop: "{{ hosts }}" ignore_errors: yes - name: Check SUBMISSION Port 587 connection wait_for: host: "{{ item }}" port: 587 state: started delay: 0 timeout: 3 loop: "{{ hosts }}" ignore_errors: yes - name: Check IMAP Port 143 connection wait_for: host: "{{ item }}" port: 143 state: started delay: 0 timeout: 3 loop: "{{ hosts }}" ignore_errors: yes - name: Check IMAPS Port 993 connection wait_for: host: "{{ item }}" port: 993 state: started delay: 0 timeout: 3 loop: "{{ hosts }}" ignore_errors: yes