intnernet, sleep after the output so the user may read it if running manually.
This commit is contained in:
@@ -5,13 +5,14 @@
|
|||||||
- name: General | Tests | Internet | Facts 01
|
- name: General | Tests | Internet | Facts 01
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
internet: true
|
internet: true
|
||||||
|
internet_time: 10
|
||||||
|
|
||||||
- name: General | Tests | Internet | Check
|
- name: General | Tests | Internet | Check
|
||||||
ansible.builtin.wait_for:
|
ansible.builtin.wait_for:
|
||||||
host: archlinux.org
|
host: archlinux.org
|
||||||
port: 443
|
port: 443
|
||||||
state: started
|
state: started
|
||||||
timeout: 5
|
timeout: "{{ internet_time }}"
|
||||||
register: internet_check
|
register: internet_check
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
@@ -23,3 +24,9 @@
|
|||||||
ansible.builtin.debug:
|
ansible.builtin.debug:
|
||||||
msg: "WARNING: Not connected to the Internet, only running for offline playbooks."
|
msg: "WARNING: Not connected to the Internet, only running for offline playbooks."
|
||||||
when: not internet
|
when: not internet
|
||||||
|
|
||||||
|
- name: General | Tests | Internet | Sleep
|
||||||
|
ansible.builtin.command: "sleep {{ internet_time }}"
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
when: not internet
|
||||||
|
|||||||
Reference in New Issue
Block a user