26 lines
699 B
YAML
26 lines
699 B
YAML
---
|
|
# 20261002 - Hyperling
|
|
# Check whether we're connected to the internet and skip certain playbooks if not.
|
|
|
|
- name: General | Tests | Internet | Facts 01
|
|
ansible.builtin.set_fact:
|
|
internet: true
|
|
|
|
- name: General | Tests | Internet | Check
|
|
ansible.builtin.wait_for:
|
|
host: archlinux.org
|
|
port: 443
|
|
state: started
|
|
timeout: 5
|
|
register: internet_check
|
|
ignore_errors: true
|
|
|
|
- name: General | Tests | Internet | Facts 02
|
|
ansible.builtin.set_fact:
|
|
internet: "{{ internet_check is success }}"
|
|
|
|
- name: General | Tests | Internet | Message
|
|
ansible.builtin.debug:
|
|
msg: "WARNING: Not connected to the Internet, only running for offline playbooks."
|
|
when: not internet
|