commit b0a10e3011cffaa182273363f97b8e5cb51eac08 Author: 변정훈 Date: Wed Jun 28 16:06:04 2023 +0900 first commit 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"