path of ip
command is system dependent
- on centos: /usr/sbin/ip - on ubuntu: /sbin/ip
This commit is contained in:
parent
cb50ef288a
commit
9ccf17a1da
@ -1,4 +1,15 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
|
- name: Gather os specific variables
|
||||||
|
include_vars: "{{ item }}"
|
||||||
|
with_first_found:
|
||||||
|
- files:
|
||||||
|
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version}}.yml"
|
||||||
|
- "{{ ansible_distribution }}.yml"
|
||||||
|
- "{{ ansible_os_family }}.yml"
|
||||||
|
skip: true
|
||||||
|
tags: vars
|
||||||
|
|
||||||
- name: Fail if source interface does not exist
|
- name: Fail if source interface does not exist
|
||||||
fail:
|
fail:
|
||||||
msg: >
|
msg: >
|
||||||
@ -13,8 +24,8 @@
|
|||||||
source_type: direct
|
source_type: direct
|
||||||
|
|
||||||
- name: Get source interface details
|
- name: Get source interface details
|
||||||
# NOTE(w-miller): The `ip` command may not be in $PATH, so use the full path.
|
command: >
|
||||||
command: /usr/sbin/ip -details link show {{ source_interface }}
|
{{ tenks_ip_path }} -details link show {{ source_interface }}
|
||||||
register: if_details
|
register: if_details
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
|
4
ansible/vars/Debian.yml
Normal file
4
ansible/vars/Debian.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# path to `ip` from the `iproute2` package
|
||||||
|
tenks_ip_path: /sbin/ip
|
4
ansible/vars/RedHat.yml
Normal file
4
ansible/vars/RedHat.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
|
||||||
|
# path to `ip` from the `iproute2` package
|
||||||
|
tenks_ip_path: /usr/bin/ip
|
Loading…
x
Reference in New Issue
Block a user