You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mitogen/tests/ansible/integration/glibc_caches/resolv_conf.yml

56 lines
1.6 KiB
YAML

# This cannot run against localhost, it damages /etc
- name: integration/glibc_caches/resolv_conf.yml
gather_facts: true
become: true
hosts: test-targets
vars:
ansible_become_pass: has_sudo_pubkey_password
tasks:
- mitogen_test_gethostbyname:
name: www.google.com
register: out
when:
- ansible_facts.virtualization_type == "docker"
- ansible_facts.python.version_info[:2] >= [2, 5]
- name: Backup resolv.conf
shell: cp /etc/resolv.conf /tmp/resolv.conf
when:
- ansible_facts.virtualization_type == "docker"
- ansible_facts.python.version_info[:2] >= [2, 5]
- name: Truncate resolv.conf
shell: echo > /etc/resolv.conf
when:
- ansible_facts.virtualization_type == "docker"
- ansible_facts.python.version_info[:2] >= [2, 5]
- mitogen_test_gethostbyname:
name: www.google.com
register: out
ignore_errors: true
when:
- ansible_facts.virtualization_type == "docker"
- ansible_facts.python.version_info[:2] >= [2, 5]
- name: Restore resolv.conf
shell: cat /tmp/resolv.conf > /etc/resolv.conf
when:
- ansible_facts.virtualization_type == "docker"
- ansible_facts.python.version_info[:2] >= [2, 5]
- assert:
that:
- out.failed
- '"Name or service not known" in out.msg or
"Temporary failure in name resolution" in out.msg'
fail_msg: |
out={{ out }}
when:
- ansible_facts.virtualization_type == "docker"
- ansible_facts.python.version_info[:2] >= [2, 5]
tags:
- resolv_conf