first commit
This commit is contained in:
3
ansible.cfg
Normal file
3
ansible.cfg
Normal file
@@ -0,0 +1,3 @@
|
||||
[defaults]
|
||||
display_skipped_hosts = false
|
||||
|
||||
20
ipcheck.yaml
Normal file
20
ipcheck.yaml
Normal file
@@ -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"
|
||||
Reference in New Issue
Block a user