mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 18:35:13 +00:00
commit
64b2d76de7
6 changed files with 18 additions and 11 deletions
|
|
@ -1,7 +1,7 @@
|
|||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
---
|
||||
- setup:
|
||||
- assert:
|
||||
name: "assert that {{ interface }} is absent"
|
||||
- name: "assert that {{ interface }} is absent"
|
||||
assert:
|
||||
that: "{{ not interface in ansible_interfaces }}"
|
||||
msg: "{{ interface }} is in ansible_interfaces: {{ ansible_interfaces }}"
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
---
|
||||
# need to run setup again when this is just a task to make sure ansible_interfaces is correct
|
||||
- setup:
|
||||
- assert:
|
||||
name: "assert that {{ interface }} is present"
|
||||
- name: "assert that {{ interface }} is present"
|
||||
assert:
|
||||
that: "{{ interface in ansible_interfaces }}"
|
||||
msg: "{{ interface }} is not in ansible_interfaces: {{ ansible_interfaces }}"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
path: "{{ profile_path }}"
|
||||
register: profile_stat
|
||||
|
||||
- assert:
|
||||
name: "assert that {{ profile }} is absent"
|
||||
- name: "assert that {{ profile }} is absent"
|
||||
assert:
|
||||
that: not profile_stat.stat.exists
|
||||
msg: "profile {{ profile_path }} does exist"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
path: "{{ profile_path }}"
|
||||
register: profile_stat
|
||||
|
||||
- assert:
|
||||
name: "assert that {{ profile }} is present"
|
||||
- name: "assert that {{ profile }} is present"
|
||||
assert:
|
||||
that: profile_stat.stat.exists
|
||||
msg: "profile {{ profile_path }} does not exist"
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
type: "{{ type }}"
|
||||
interface: "{{ interface }}"
|
||||
- include_tasks: tasks/show-interfaces.yml
|
||||
- include_tasks: tasks/manage-test-interface.yml state=present
|
||||
- include_tasks: tasks/manage-test-interface.yml
|
||||
vars:
|
||||
state: present
|
||||
- include_tasks: tasks/assert-device_present.yml
|
||||
|
||||
- name: Test static interface up
|
||||
|
|
@ -54,5 +56,7 @@
|
|||
- name: Remove interfaces
|
||||
hosts: all
|
||||
tasks:
|
||||
- include_tasks: tasks/manage-test-interface.yml state=absent
|
||||
- include_tasks: tasks/manage-test-interface.yml
|
||||
vars:
|
||||
state: absent
|
||||
- include_tasks: tasks/assert-device_absent.yml
|
||||
|
|
|
|||
|
|
@ -17,7 +17,10 @@
|
|||
|
||||
# FIXME: when: does not seem to work with include_tasks, therefore this cannot be safely tested for now
|
||||
# - name: test tap interfaces
|
||||
# include_tasks: tasks/create-and-remove-interface.yml type=tap interface=tap1298
|
||||
# include_tasks: tasks/create-and-remove-interface.yml
|
||||
# vars:
|
||||
# - type: tap
|
||||
# - interface: tap1298
|
||||
# when: ansible_distribution_major_version > 6
|
||||
# # ip tuntap does not exist on RHEL6
|
||||
# # FIXME: Maybe use some other tool to manage devices, openvpn can do this,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue