blob: 1b062d4c7a732c5ada78bb6f8e58e79b4bdf3364 [file] [log] [blame]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
- name: Install tcpdump
yum: name=tcpdump
- set_fact:
sniff_cmd: "tcpdump -i {{ pcap_replay_interface }} -c 10"
- name: "Attempting to sniff packet(s)"
shell: "{{ sniff_cmd }}"
async: 30
register: sniffer
- name: Waiting to receive packet(s)
async_status: jid={{ sniffer.ansible_job_id }}
register: job
until: job.finished
retries: 60
- fail:
msg: "No packets received from pcap-replay within timeout: {{ sniff_cmd }}"
when: job.finished != 1
- debug: var=job
- debug: msg="Successfully received packets sent from pcap-replay!"