summaryrefslogtreecommitdiff
path: root/tests/integration/targets/vyos_interfaces
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration/targets/vyos_interfaces')
-rw-r--r--tests/integration/targets/vyos_interfaces/defaults/main.yaml2
-rw-r--r--tests/integration/targets/vyos_interfaces/tasks/cli.yaml12
-rw-r--r--tests/integration/targets/vyos_interfaces/tasks/main.yaml4
-rw-r--r--tests/integration/targets/vyos_interfaces/tests/cli/_populate.yaml16
-rw-r--r--tests/integration/targets/vyos_interfaces/tests/cli/_remove_config.yaml16
-rw-r--r--tests/integration/targets/vyos_interfaces/tests/cli/deleted.yaml25
-rw-r--r--tests/integration/targets/vyos_interfaces/tests/cli/empty_config.yaml15
-rw-r--r--tests/integration/targets/vyos_interfaces/tests/cli/merged.yaml38
-rw-r--r--tests/integration/targets/vyos_interfaces/tests/cli/overridden.yaml31
-rw-r--r--tests/integration/targets/vyos_interfaces/tests/cli/replaced.yaml34
-rw-r--r--tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml40
-rw-r--r--tests/integration/targets/vyos_interfaces/vars/main.yaml225
12 files changed, 236 insertions, 222 deletions
diff --git a/tests/integration/targets/vyos_interfaces/defaults/main.yaml b/tests/integration/targets/vyos_interfaces/defaults/main.yaml
index 164afea..852a6be 100644
--- a/tests/integration/targets/vyos_interfaces/defaults/main.yaml
+++ b/tests/integration/targets/vyos_interfaces/defaults/main.yaml
@@ -1,3 +1,3 @@
---
-testcase: "[^_].*"
+testcase: '[^_].*'
test_items: []
diff --git a/tests/integration/targets/vyos_interfaces/tasks/cli.yaml b/tests/integration/targets/vyos_interfaces/tasks/cli.yaml
index 655e51e..93eb2fe 100644
--- a/tests/integration/targets/vyos_interfaces/tasks/cli.yaml
+++ b/tests/integration/targets/vyos_interfaces/tasks/cli.yaml
@@ -1,8 +1,8 @@
---
- name: Collect all cli test cases
find:
- paths: "{{ role_path }}/tests/cli"
- patterns: "{{ testcase }}.yaml"
+ paths: '{{ role_path }}/tests/cli'
+ patterns: '{{ testcase }}.yaml'
use_regex: true
register: test_cases
delegate_to: localhost
@@ -10,10 +10,10 @@
- name: Set test_items
set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
-- name: Run test case (connection=network_cli)
- include: "{{ test_case_to_run }}"
+- name: Run test case (connection=ansible.netcommon.network_cli)
+ include: '{{ test_case_to_run }}'
vars:
- ansible_connection: network_cli
- with_items: "{{ test_items }}"
+ ansible_connection: ansible.netcommon.network_cli
+ with_items: '{{ test_items }}'
loop_control:
loop_var: test_case_to_run
diff --git a/tests/integration/targets/vyos_interfaces/tasks/main.yaml b/tests/integration/targets/vyos_interfaces/tasks/main.yaml
index d4cf26f..a3db933 100644
--- a/tests/integration/targets/vyos_interfaces/tasks/main.yaml
+++ b/tests/integration/targets/vyos_interfaces/tasks/main.yaml
@@ -1,2 +1,4 @@
---
-- {include: cli.yaml, tags: ['cli']}
+- include: cli.yaml
+ tags:
+ - cli
diff --git a/tests/integration/targets/vyos_interfaces/tests/cli/_populate.yaml b/tests/integration/targets/vyos_interfaces/tests/cli/_populate.yaml
index 4dd5f18..686236f 100644
--- a/tests/integration/targets/vyos_interfaces/tests/cli/_populate.yaml
+++ b/tests/integration/targets/vyos_interfaces/tests/cli/_populate.yaml
@@ -1,17 +1,15 @@
---
- name: Setup
- network.cli.cli_config:
- config: "{{ lines }}"
vars:
- lines: |
- set interfaces ethernet "{{ intf }}" description 'Configured by Ansible'
- set interfaces ethernet "{{ intf }}" speed 'auto'
- set interfaces ethernet "{{ intf }}" duplex 'auto'
- set interfaces ethernet "{{ intf }}" mtu '1500'
- set interfaces ethernet "{{ intf }}" vif 200
- set interfaces ethernet "{{ intf }}" vif 200 description 'VIF - 200'
+ lines: "set interfaces ethernet \"{{ intf }}\" description 'Configured by Ansible'\n\
+ set interfaces ethernet \"{{ intf }}\" speed 'auto'\nset interfaces ethernet\
+ \ \"{{ intf }}\" duplex 'auto'\nset interfaces ethernet \"{{ intf }}\" mtu\
+ \ '1500'\nset interfaces ethernet \"{{ intf }}\" vif 200\nset interfaces ethernet\
+ \ \"{{ intf }}\" vif 200 description 'VIF - 200'\n"
loop:
- eth1
- eth2
loop_control:
loop_var: intf
+ ansible.netcommon.cli_config:
+ config: '{{ lines }}'
diff --git a/tests/integration/targets/vyos_interfaces/tests/cli/_remove_config.yaml b/tests/integration/targets/vyos_interfaces/tests/cli/_remove_config.yaml
index 9157f55..298cf5d 100644
--- a/tests/integration/targets/vyos_interfaces/tests/cli/_remove_config.yaml
+++ b/tests/integration/targets/vyos_interfaces/tests/cli/_remove_config.yaml
@@ -1,17 +1,15 @@
---
- name: Remove Config
- network.cli.cli_config:
- config: "{{ lines }}"
vars:
- lines: |
- delete interfaces ethernet "{{ intf }}" description
- delete interfaces ethernet "{{ intf }}" speed
- delete interfaces ethernet "{{ intf }}" duplex
- delete interfaces ethernet "{{ intf }}" mtu
- delete interfaces ethernet "{{ intf }}" disable
- delete interfaces ethernet "{{ intf }}" vif
+ lines: "delete interfaces ethernet \"{{ intf }}\" description\ndelete interfaces\
+ \ ethernet \"{{ intf }}\" speed\ndelete interfaces ethernet \"{{ intf }}\"\
+ \ duplex\ndelete interfaces ethernet \"{{ intf }}\" mtu\ndelete interfaces\
+ \ ethernet \"{{ intf }}\" disable\ndelete interfaces ethernet \"{{ intf }}\"\
+ \ vif\n"
loop:
- eth1
- eth2
loop_control:
loop_var: intf
+ ansible.netcommon.cli_config:
+ config: '{{ lines }}'
diff --git a/tests/integration/targets/vyos_interfaces/tests/cli/deleted.yaml b/tests/integration/targets/vyos_interfaces/tests/cli/deleted.yaml
index fc86ca7..56e747a 100644
--- a/tests/integration/targets/vyos_interfaces/tests/cli/deleted.yaml
+++ b/tests/integration/targets/vyos_interfaces/tests/cli/deleted.yaml
@@ -1,17 +1,21 @@
---
- debug:
- msg: "Start vyos_interfaces deleted integration tests ansible_connection={{ ansible_connection }}"
+ msg: Start vyos_interfaces deleted integration tests ansible_connection={{ ansible_connection
+ }}
- include_tasks: _populate.yaml
- block:
+
- name: Delete attributes of given interfaces
- vyos.vyos.vyos_interfaces: &deleted
+ register: result
+ vyos.vyos.vyos_interfaces: &id001
config:
+
- name: eth1
+
- name: eth2
state: deleted
- register: result
- name: Assert that the before dicts were correctly generated
assert:
@@ -21,26 +25,29 @@
- name: Assert that the correct set of commands were generated
assert:
that:
- - "{{ deleted['commands'] | symmetric_difference(result['commands']) |length == 0 }}"
+ - "{{ deleted['commands'] | symmetric_difference(result['commands']) |length\
+ \ == 0 }}"
- name: Assert that the after dicts were correctly generated
assert:
that:
- - "{{ deleted['after'] | symmetric_difference(result['after']) |length == 0 }}"
+ - "{{ deleted['after'] | symmetric_difference(result['after']) |length\
+ \ == 0 }}"
- name: Delete attributes of given interfaces (IDEMPOTENT)
- vyos.vyos.vyos_interfaces: *deleted
register: result
+ vyos.vyos.vyos_interfaces: *id001
- name: Assert that the previous task was idempotent
assert:
that:
- - "result.changed == false"
+ - result.changed == false
- name: Assert that the before dicts were correctly generated
assert:
that:
- - "{{ deleted['after'] | symmetric_difference(result['before']) |length == 0 }}"
-
+ - "{{ deleted['after'] | symmetric_difference(result['before']) |length\
+ \ == 0 }}"
always:
+
- include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_interfaces/tests/cli/empty_config.yaml b/tests/integration/targets/vyos_interfaces/tests/cli/empty_config.yaml
index 4a72c8a..e1e154d 100644
--- a/tests/integration/targets/vyos_interfaces/tests/cli/empty_config.yaml
+++ b/tests/integration/targets/vyos_interfaces/tests/cli/empty_config.yaml
@@ -1,35 +1,36 @@
---
- debug:
- msg: "START vyos_interfaces empty_config integration tests on connection={{ ansible_connection }}"
+ msg: START vyos_interfaces empty_config integration tests on connection={{ ansible_connection
+ }}
- name: Merged with empty config should give appropriate error message
+ register: result
+ ignore_errors: true
vyos.vyos.vyos_interfaces:
config:
state: merged
- register: result
- ignore_errors: true
- assert:
that:
- result.msg == 'value of config parameter must not be empty for state merged'
- name: Replaced with empty config should give appropriate error message
+ register: result
+ ignore_errors: true
vyos.vyos.vyos_interfaces:
config:
state: replaced
- register: result
- ignore_errors: true
- assert:
that:
- result.msg == 'value of config parameter must not be empty for state replaced'
- name: Overridden with empty config should give appropriate error message
+ register: result
+ ignore_errors: true
vyos.vyos.vyos_interfaces:
config:
state: overridden
- register: result
- ignore_errors: true
- assert:
that:
diff --git a/tests/integration/targets/vyos_interfaces/tests/cli/merged.yaml b/tests/integration/targets/vyos_interfaces/tests/cli/merged.yaml
index 50e4936..e0fa0b9 100644
--- a/tests/integration/targets/vyos_interfaces/tests/cli/merged.yaml
+++ b/tests/integration/targets/vyos_interfaces/tests/cli/merged.yaml
@@ -1,59 +1,69 @@
---
- debug:
- msg: "START vyos_interfaces merged integration tests on connection={{ ansible_connection }}"
+ msg: START vyos_interfaces merged integration tests on connection={{ ansible_connection
+ }}
- include_tasks: _remove_config.yaml
- block:
+
- name: Merge the provided configuration with the exisiting running configuration
- vyos.vyos.vyos_interfaces: &merged
+ register: result
+ vyos.vyos.vyos_interfaces: &id001
config:
+
- name: eth1
- description: "Configured by Ansible - Interface 1"
+ description: Configured by Ansible - Interface 1
mtu: 1500
speed: auto
duplex: auto
vifs:
+
- vlan_id: 100
- description: "Eth1 - VIF 100"
+ description: Eth1 - VIF 100
mtu: 400
- vlan_id: 101
- description: "Eth1 - VIF 101"
+ description: Eth1 - VIF 101
- name: eth2
- description: "Configured by Ansible - Interface 2 (ADMIN DOWN)"
+ description: Configured by Ansible - Interface 2 (ADMIN DOWN)
mtu: 600
enabled: false
state: merged
- register: result
- name: Assert that before dicts were correctly generated
assert:
- that: "{{ merged['before'] | symmetric_difference(result['before']) |length == 0 }}"
+ that: "{{ merged['before'] | symmetric_difference(result['before']) |length\
+ \ == 0 }}"
- name: Assert that correct set of commands were generated
assert:
that:
- - "{{ merged['commands'] | symmetric_difference(result['commands']) |length == 0 }}"
+ - "{{ merged['commands'] | symmetric_difference(result['commands']) |length\
+ \ == 0 }}"
- name: Assert that after dicts was correctly generated
assert:
that:
- - "{{ merged['after'] | symmetric_difference(result['after']) |length == 0 }}"
+ - "{{ merged['after'] | symmetric_difference(result['after']) |length\
+ \ == 0 }}"
- - name: Merge the provided configuration with the existing running configuration (IDEMPOTENT)
- vyos.vyos.vyos_interfaces: *merged
+ - name: Merge the provided configuration with the existing running configuration
+ (IDEMPOTENT)
register: result
+ vyos.vyos.vyos_interfaces: *id001
- name: Assert that the previous task was idempotent
assert:
that:
- - "result['changed'] == false"
+ - result['changed'] == false
- name: Assert that before dicts were correctly generated
assert:
that:
- - "{{ merged['after'] | symmetric_difference(result['before']) |length == 0 }}"
+ - "{{ merged['after'] | symmetric_difference(result['before']) |length\
+ \ == 0 }}"
always:
+
- include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_interfaces/tests/cli/overridden.yaml b/tests/integration/targets/vyos_interfaces/tests/cli/overridden.yaml
index 74669f7..9921e5d 100644
--- a/tests/integration/targets/vyos_interfaces/tests/cli/overridden.yaml
+++ b/tests/integration/targets/vyos_interfaces/tests/cli/overridden.yaml
@@ -1,23 +1,27 @@
---
- debug:
- msg: "START vyos_interfaces overridden integration tests on connection={{ ansible_connection }}"
+ msg: START vyos_interfaces overridden integration tests on connection={{ ansible_connection
+ }}
- include_tasks: _remove_config.yaml
- include_tasks: _populate.yaml
- block:
+
- name: Overrides all device configuration with provided configuration
- vyos.vyos.vyos_interfaces: &overridden
+ register: result
+ vyos.vyos.vyos_interfaces: &id001
config:
+
- name: eth0
- speed: "auto"
- duplex: "auto"
+ speed: auto
+ duplex: auto
+
- name: eth2
- description: "Overridden by Ansible"
+ description: Overridden by Ansible
mtu: 1200
state: overridden
- register: result
- name: Assert that before dicts were correctly generated
assert:
@@ -27,26 +31,29 @@
- name: Assert that correct commands were generated
assert:
that:
- - "{{ overridden['commands'] | symmetric_difference(result['commands']) |length == 0 }}"
+ - "{{ overridden['commands'] | symmetric_difference(result['commands'])\
+ \ |length == 0 }}"
- name: Assert that after dicts were correctly generated
assert:
that:
- - "{{ overridden['after'] | symmetric_difference(result['after']) |length == 0 }}"
+ - "{{ overridden['after'] | symmetric_difference(result['after']) |length\
+ \ == 0 }}"
- name: Overrides all device configuration with provided configurations (IDEMPOTENT)
- vyos.vyos.vyos_interfaces: *overridden
register: result
+ vyos.vyos.vyos_interfaces: *id001
- name: Assert that the previous task was idempotent
assert:
that:
- - "result['changed'] == false"
+ - result['changed'] == false
- name: Assert that before dicts were correctly generated
assert:
that:
- - "{{ overridden['after'] | symmetric_difference(result['before']) |length == 0 }}"
-
+ - "{{ overridden['after'] | symmetric_difference(result['before']) |length\
+ \ == 0 }}"
always:
+
- include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_interfaces/tests/cli/replaced.yaml b/tests/integration/targets/vyos_interfaces/tests/cli/replaced.yaml
index 64510d7..8b68c5a 100644
--- a/tests/integration/targets/vyos_interfaces/tests/cli/replaced.yaml
+++ b/tests/integration/targets/vyos_interfaces/tests/cli/replaced.yaml
@@ -1,31 +1,36 @@
---
- debug:
- msg: "START vyos_interfaces replaced integration tests on connection={{ ansible_connection }}"
+ msg: START vyos_interfaces replaced integration tests on connection={{ ansible_connection
+ }}
- include_tasks: _remove_config.yaml
- include_tasks: _populate.yaml
- block:
+
- name: Replace device configurations of listed interfaces with provided configurations
- vyos.vyos.vyos_interfaces: &replaced
+ register: result
+ vyos.vyos.vyos_interfaces: &id001
config:
+
- name: eth1
- description: "Replaced by Ansible"
+ description: Replaced by Ansible
vifs:
+
- vlan_id: 100
- description: "VIF 100 - Replaced by Ansible"
+ description: VIF 100 - Replaced by Ansible
- name: eth2
mtu: 1400
- description: "Replaced by Ansible"
+ description: Replaced by Ansible
state: replaced
- register: result
- name: Assert that correct set of commands were generated
assert:
that:
- - "{{ replaced['commands'] | symmetric_difference(result['commands']) |length == 0 }}"
+ - "{{ replaced['commands'] | symmetric_difference(result['commands'])\
+ \ |length == 0 }}"
- name: Assert that before dicts are correctly generated
assert:
@@ -35,21 +40,24 @@
- name: Assert that after dict is correctly generated
assert:
that:
- - "{{ replaced['after'] | symmetric_difference(result['after']) |length == 0 }}"
+ - "{{ replaced['after'] | symmetric_difference(result['after']) |length\
+ \ == 0 }}"
- - name: Replace device configurations of listed interfaces with provided configurarions (IDEMPOTENT)
- vyos.vyos.vyos_interfaces: *replaced
+ - name: Replace device configurations of listed interfaces with provided configurarions
+ (IDEMPOTENT)
register: result
+ vyos.vyos.vyos_interfaces: *id001
- name: Assert that task was idempotent
assert:
that:
- - "result['changed'] == false"
+ - result['changed'] == false
- name: Assert that before dict is correctly generated
assert:
that:
- - "{{ replaced['after'] | symmetric_difference(result['before']) |length == 0 }}"
-
+ - "{{ replaced['after'] | symmetric_difference(result['before']) |length\
+ \ == 0 }}"
always:
+
- include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml b/tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml
index f947513..f003c0b 100644
--- a/tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml
+++ b/tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml
@@ -1,35 +1,39 @@
---
- debug:
- msg: "START vyos_interfaces round trip integration tests on connection={{ ansible_connection }}"
+ msg: START vyos_interfaces round trip integration tests on connection={{ ansible_connection
+ }}
- include_tasks: _remove_config.yaml
- block:
+
- name: Apply the provided configuration (base config)
+ register: base_config
vyos.vyos.vyos_interfaces:
config:
+
- name: eth0
enabled: true
- duplex: "auto"
- speed: "auto"
+ duplex: auto
+ speed: auto
- name: eth1
- description: "Interface - 1"
+ description: Interface - 1
mtu: 1500
vifs:
+
- vlan_id: 100
- description: "Eth1 - VIF 100"
+ description: Eth1 - VIF 100
mtu: 200
- vlan_id: 101
enabled: false
- name: eth2
- description: "Interface - 2"
+ description: Interface - 2
enabled: true
mtu: 900
state: merged
- register: base_config
- name: Gather interfaces facts
vyos.vyos.vyos_facts:
@@ -39,40 +43,44 @@
- interfaces
- name: Apply the provided configuration (config to be reverted)
+ register: result
vyos.vyos.vyos_interfaces:
config:
+
- name: eth1
- description: "Interface 1 - Description (WILL BE REVERTED)"
+ description: Interface 1 - Description (WILL BE REVERTED)
mtu: 1200
vifs:
+
- vlan_id: 100
- description: "Eth1 - VIF 100 (WILL BE REVERTED)"
+ description: Eth1 - VIF 100 (WILL BE REVERTED)
mtu: 400
- vlan_id: 101
- description: "Eth1 - VIF 101 (WILL BE REMOVED)"
+ description: Eth1 - VIF 101 (WILL BE REMOVED)
enabled: true
- name: eth2
- description: "Interface 2 (ADMIN DOWN) (WILL BE REVERTED)"
+ description: Interface 2 (ADMIN DOWN) (WILL BE REVERTED)
mtu: 600
enabled: false
state: merged
- register: result
- name: Assert that changes were applied
assert:
- that: "{{ round_trip['after'] | symmetric_difference(result['after']) |length == 0 }}"
+ that: "{{ round_trip['after'] | symmetric_difference(result['after']) |length\
+ \ == 0 }}"
- name: Revert back to base config using facts round trip
+ register: revert
vyos.vyos.vyos_interfaces:
config: "{{ ansible_facts['network_resources']['interfaces'] }}"
state: replaced
- register: revert
- name: Assert that config was reverted
assert:
- that: "{{ base_config['after'] | symmetric_difference(revert['after']) |length == 0 }}"
-
+ that: "{{ base_config['after'] | symmetric_difference(revert['after']) |length\
+ \ == 0 }}"
always:
+
- include_tasks: _remove_config.yaml
diff --git a/tests/integration/targets/vyos_interfaces/vars/main.yaml b/tests/integration/targets/vyos_interfaces/vars/main.yaml
index b973752..b730080 100644
--- a/tests/integration/targets/vyos_interfaces/vars/main.yaml
+++ b/tests/integration/targets/vyos_interfaces/vars/main.yaml
@@ -1,209 +1,184 @@
---
merged:
before:
- - name: "eth0"
+ - name: eth0
enabled: true
- speed: "auto"
- duplex: "auto"
-
- - name: "eth1"
+ speed: auto
+ duplex: auto
+ - name: eth1
enabled: true
-
- - name: "eth2"
+ - name: eth2
enabled: true
-
commands:
- - "set interfaces ethernet eth1 description 'Configured by Ansible - Interface 1'"
- - "set interfaces ethernet eth1 mtu '1500'"
- - "set interfaces ethernet eth1 duplex 'auto'"
- - "set interfaces ethernet eth1 speed 'auto'"
- - "set interfaces ethernet eth1 vif 100 description 'Eth1 - VIF 100'"
- - "set interfaces ethernet eth1 vif 100 mtu '400'"
- - "set interfaces ethernet eth1 vif 101 description 'Eth1 - VIF 101'"
- - "set interfaces ethernet eth2 description 'Configured by Ansible - Interface 2 (ADMIN DOWN)'"
- - "set interfaces ethernet eth2 mtu '600'"
- - "set interfaces ethernet eth2 disable"
-
+ - set interfaces ethernet eth1 description 'Configured by Ansible - Interface
+ 1'
+ - set interfaces ethernet eth1 mtu '1500'
+ - set interfaces ethernet eth1 duplex 'auto'
+ - set interfaces ethernet eth1 speed 'auto'
+ - set interfaces ethernet eth1 vif 100 description 'Eth1 - VIF 100'
+ - set interfaces ethernet eth1 vif 100 mtu '400'
+ - set interfaces ethernet eth1 vif 101 description 'Eth1 - VIF 101'
+ - set interfaces ethernet eth2 description 'Configured by Ansible - Interface
+ 2 (ADMIN DOWN)'
+ - set interfaces ethernet eth2 mtu '600'
+ - set interfaces ethernet eth2 disable
after:
- - name: "eth0"
+ - name: eth0
enabled: true
- duplex: "auto"
- speed: "auto"
-
- - name: "eth1"
- description: "Configured by Ansible - Interface 1"
+ duplex: auto
+ speed: auto
+ - name: eth1
+ description: Configured by Ansible - Interface 1
mtu: 1500
- speed: "auto"
- duplex: "auto"
+ speed: auto
+ duplex: auto
enabled: true
vifs:
- vlan_id: 100
- description: "Eth1 - VIF 100"
+ description: Eth1 - VIF 100
mtu: 400
enabled: true
-
- vlan_id: 101
- description: "Eth1 - VIF 101"
+ description: Eth1 - VIF 101
enabled: true
-
- - name: "eth2"
- description: "Configured by Ansible - Interface 2 (ADMIN DOWN)"
+ - name: eth2
+ description: Configured by Ansible - Interface 2 (ADMIN DOWN)
mtu: 600
enabled: false
-
populate:
- - name: "eth1"
+ - name: eth1
enabled: true
- speed: "auto"
- duplex: "auto"
- description: "Configured by Ansible"
+ speed: auto
+ duplex: auto
+ description: Configured by Ansible
mtu: 1500
vifs:
- vlan_id: 200
enabled: true
- description: "VIF - 200"
-
- - name: "eth2"
+ description: VIF - 200
+ - name: eth2
enabled: true
- speed: "auto"
- duplex: "auto"
- description: "Configured by Ansible"
+ speed: auto
+ duplex: auto
+ description: Configured by Ansible
mtu: 1500
vifs:
- vlan_id: 200
enabled: true
- description: "VIF - 200"
-
- - name: "eth0"
+ description: VIF - 200
+ - name: eth0
enabled: true
- duplex: "auto"
- speed: "auto"
-
+ duplex: auto
+ speed: auto
replaced:
commands:
- - "delete interfaces ethernet eth1 mtu"
- - "delete interfaces ethernet eth1 speed"
- - "delete interfaces ethernet eth1 duplex"
- - "delete interfaces ethernet eth1 vif 200 description"
- - "set interfaces ethernet eth1 description 'Replaced by Ansible'"
- - "set interfaces ethernet eth1 vif 100 description 'VIF 100 - Replaced by Ansible'"
- - "delete interfaces ethernet eth2 speed"
- - "delete interfaces ethernet eth2 duplex"
- - "delete interfaces ethernet eth2 vif 200 description"
- - "set interfaces ethernet eth2 description 'Replaced by Ansible'"
- - "set interfaces ethernet eth2 mtu '1400'"
-
+ - delete interfaces ethernet eth1 mtu
+ - delete interfaces ethernet eth1 speed
+ - delete interfaces ethernet eth1 duplex
+ - delete interfaces ethernet eth1 vif 200 description
+ - set interfaces ethernet eth1 description 'Replaced by Ansible'
+ - set interfaces ethernet eth1 vif 100 description 'VIF 100 - Replaced by Ansible'
+ - delete interfaces ethernet eth2 speed
+ - delete interfaces ethernet eth2 duplex
+ - delete interfaces ethernet eth2 vif 200 description
+ - set interfaces ethernet eth2 description 'Replaced by Ansible'
+ - set interfaces ethernet eth2 mtu '1400'
after:
- - name: "eth1"
- description: "Replaced by Ansible"
+ - name: eth1
+ description: Replaced by Ansible
enabled: true
vifs:
- vlan_id: 100
enabled: true
- description: "VIF 100 - Replaced by Ansible"
-
+ description: VIF 100 - Replaced by Ansible
- vlan_id: 200
enabled: true
-
- - name: "eth2"
+ - name: eth2
mtu: 1400
- description: "Replaced by Ansible"
+ description: Replaced by Ansible
enabled: true
vifs:
- vlan_id: 200
enabled: true
-
- - name: "eth0"
+ - name: eth0
enabled: true
- duplex: "auto"
- speed: "auto"
-
+ duplex: auto
+ speed: auto
overridden:
commands:
- - "delete interfaces ethernet eth1 description"
- - "delete interfaces ethernet eth1 speed"
- - "delete interfaces ethernet eth1 duplex"
- - "delete interfaces ethernet eth1 mtu"
- - "delete interfaces ethernet eth1 vif 200 description"
- - "delete interfaces ethernet eth2 speed"
- - "delete interfaces ethernet eth2 duplex"
- - "delete interfaces ethernet eth2 vif 200 description"
- - "set interfaces ethernet eth2 description 'Overridden by Ansible'"
- - "set interfaces ethernet eth2 mtu '1200'"
-
+ - delete interfaces ethernet eth1 description
+ - delete interfaces ethernet eth1 speed
+ - delete interfaces ethernet eth1 duplex
+ - delete interfaces ethernet eth1 mtu
+ - delete interfaces ethernet eth1 vif 200 description
+ - delete interfaces ethernet eth2 speed
+ - delete interfaces ethernet eth2 duplex
+ - delete interfaces ethernet eth2 vif 200 description
+ - set interfaces ethernet eth2 description 'Overridden by Ansible'
+ - set interfaces ethernet eth2 mtu '1200'
after:
- - name: "eth0"
+ - name: eth0
enabled: true
- speed: "auto"
- duplex: "auto"
-
- - name: "eth1"
+ speed: auto
+ duplex: auto
+ - name: eth1
enabled: true
vifs:
- vlan_id: 200
enabled: true
-
- - name: "eth2"
+ - name: eth2
enabled: true
- description: "Overridden by Ansible"
+ description: Overridden by Ansible
mtu: 1200
vifs:
- vlan_id: 200
enabled: true
-
deleted:
commands:
- - "delete interfaces ethernet eth1 description"
- - "delete interfaces ethernet eth1 speed"
- - "delete interfaces ethernet eth1 duplex"
- - "delete interfaces ethernet eth1 mtu"
- - "delete interfaces ethernet eth1 vif 200 description"
- - "delete interfaces ethernet eth2 description"
- - "delete interfaces ethernet eth2 speed"
- - "delete interfaces ethernet eth2 duplex"
- - "delete interfaces ethernet eth2 mtu"
- - "delete interfaces ethernet eth2 vif 200 description"
-
+ - delete interfaces ethernet eth1 description
+ - delete interfaces ethernet eth1 speed
+ - delete interfaces ethernet eth1 duplex
+ - delete interfaces ethernet eth1 mtu
+ - delete interfaces ethernet eth1 vif 200 description
+ - delete interfaces ethernet eth2 description
+ - delete interfaces ethernet eth2 speed
+ - delete interfaces ethernet eth2 duplex
+ - delete interfaces ethernet eth2 mtu
+ - delete interfaces ethernet eth2 vif 200 description
after:
- - name: "eth0"
+ - name: eth0
enabled: true
- speed: "auto"
- duplex: "auto"
-
- - name: "eth1"
+ speed: auto
+ duplex: auto
+ - name: eth1
enabled: true
vifs:
- vlan_id: 200
enabled: true
-
- - name: "eth2"
+ - name: eth2
enabled: true
vifs:
- vlan_id: 200
enabled: true
-
round_trip:
after:
- - name: "eth0"
+ - name: eth0
enabled: true
- speed: "auto"
- duplex: "auto"
-
- - name: "eth1"
- description: "Interface 1 - Description (WILL BE REVERTED)"
+ speed: auto
+ duplex: auto
+ - name: eth1
+ description: Interface 1 - Description (WILL BE REVERTED)
enabled: true
mtu: 1200
vifs:
- vlan_id: 100
- description: "Eth1 - VIF 100 (WILL BE REVERTED)"
+ description: Eth1 - VIF 100 (WILL BE REVERTED)
mtu: 400
enabled: true
-
- vlan_id: 101
- description: "Eth1 - VIF 101 (WILL BE REMOVED)"
+ description: Eth1 - VIF 101 (WILL BE REMOVED)
enabled: true
-
- - name: "eth2"
- description: "Interface 2 (ADMIN DOWN) (WILL BE REVERTED)"
+ - name: eth2
+ description: Interface 2 (ADMIN DOWN) (WILL BE REVERTED)
mtu: 600
enabled: false