From b0a10e3011cffaa182273363f97b8e5cb51eac08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B3=80=EC=A0=95=ED=9B=88?= Date: Wed, 28 Jun 2023 16:06:04 +0900 Subject: [PATCH] first commit --- ansible.cfg | 3 +++ ipcheck.yaml | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 ansible.cfg create mode 100644 ipcheck.yaml diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..ec16538 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,3 @@ +[defaults] +display_skipped_hosts = false + diff --git a/ipcheck.yaml b/ipcheck.yaml new file mode 100644 index 0000000..ad01ba3 --- /dev/null +++ b/ipcheck.yaml @@ -0,0 +1,20 @@ +--- +- hosts: localhost + gather_facts: false + tasks: + - name: Check IP address availability + shell: ping -c 1 10.10.43.{{ item }} + register: ping_result + failed_when: false + changed_when: false + with_sequence: start=170 end=174 + + - name: Print IP address status + failed_when: false + changed_when: false + debug: + msg: "10.10.43.{{ item.item }} 이용 가능" + with_items: "{{ ping_result.results }}" + loop_control: + label: "{{ item.item }}" + when: "'100.0% packet loss' in item.stdout"