diff options
84 files changed, 937 insertions, 928 deletions
diff --git a/tests/integration/targets/prepare_vyos_tests/tasks/main.yaml b/tests/integration/targets/prepare_vyos_tests/tasks/main.yaml index 1a81fb1..5813284 100644 --- a/tests/integration/targets/prepare_vyos_tests/tasks/main.yaml +++ b/tests/integration/targets/prepare_vyos_tests/tasks/main.yaml @@ -10,4 +10,4 @@ set interfaces ethernet eth1 set interfaces ethernet eth2 delete interfaces loopback lo - ignore_errors: yes + ignore_errors: true diff --git a/tests/integration/targets/vyos_banner/tasks/main.yaml b/tests/integration/targets/vyos_banner/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_banner/tasks/main.yaml +++ b/tests/integration/targets/vyos_banner/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_command/tasks/main.yaml b/tests/integration/targets/vyos_command/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_command/tasks/main.yaml +++ b/tests/integration/targets/vyos_command/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_command/tests/cli/bad_operator.yaml b/tests/integration/targets/vyos_command/tests/cli/bad_operator.yaml index bf3334f..5ff72fa 100644 --- a/tests/integration/targets/vyos_command/tests/cli/bad_operator.yaml +++ b/tests/integration/targets/vyos_command/tests/cli/bad_operator.yaml @@ -9,7 +9,7 @@ wait_for: - result[0] is 'VyOS' register: result - ignore_errors: yes + ignore_errors: true - assert: that: diff --git a/tests/integration/targets/vyos_command/tests/cli/cli_command.yaml b/tests/integration/targets/vyos_command/tests/cli/cli_command.yaml index 08a7675..a10f2bc 100644 --- a/tests/integration/targets/vyos_command/tests/cli/cli_command.yaml +++ b/tests/integration/targets/vyos_command/tests/cli/cli_command.yaml @@ -3,39 +3,39 @@ msg: "START cli/cli_command.yaml on connection={{ ansible_connection }}" - block: - - name: get output for single command - network.cli.cli_command: - command: show version - register: result + - name: get output for single command + network.cli.cli_command: + command: show version + register: result - - assert: - that: - - "result.changed == false" - - "result.stdout is defined" + - assert: + that: + - "result.changed == false" + - "result.stdout is defined" - - name: send invalid command - network.cli.cli_command: - command: 'show foo' - register: result - ignore_errors: yes + - name: send invalid command + network.cli.cli_command: + command: 'show foo' + register: result + ignore_errors: true - - assert: - that: - - "result.failed == true" - - "result.msg is defined" + - assert: + that: + - "result.failed == true" + - "result.msg is defined" when: "ansible_connection == 'network_cli'" - block: - - name: test failure for local connection - network.cli.cli_command: - command: show version - register: result - ignore_errors: yes + - name: test failure for local connection + network.cli.cli_command: + command: show version + register: result + ignore_errors: true - - assert: - that: - - 'result.failed == true' - - "'Connection type local is not valid for this module' in result.msg" + - assert: + that: + - 'result.failed == true' + - "'Connection type local is not valid for this module' in result.msg" when: "ansible_connection == 'local'" - debug: msg="END cli/cli_command.yaml on connection={{ ansible_connection }}" diff --git a/tests/integration/targets/vyos_command/tests/cli/invalid.yaml b/tests/integration/targets/vyos_command/tests/cli/invalid.yaml index 672f6e8..04d203d 100644 --- a/tests/integration/targets/vyos_command/tests/cli/invalid.yaml +++ b/tests/integration/targets/vyos_command/tests/cli/invalid.yaml @@ -5,9 +5,9 @@ vyos.vyos.vyos_command: commands: show foo register: result - ignore_errors: yes + ignore_errors: true -- assert: { that: result.failed } +- assert: {that: result.failed} - name: run commands that include invalid command vyos.vyos.vyos_command: @@ -15,8 +15,8 @@ - show version - show foo register: result - ignore_errors: yes + ignore_errors: true -- assert: { that: result.failed } +- assert: {that: result.failed} - debug: msg="END cli/invalid.yaml on connection={{ ansible_connection }}" diff --git a/tests/integration/targets/vyos_command/tests/cli/output.yaml b/tests/integration/targets/vyos_command/tests/cli/output.yaml index bdc8b2a..1bc0dc6 100644 --- a/tests/integration/targets/vyos_command/tests/cli/output.yaml +++ b/tests/integration/targets/vyos_command/tests/cli/output.yaml @@ -28,8 +28,8 @@ - name: Get output for multiple commands that call less explicitly vyos.vyos.vyos_command: commands: - # NOTE: We only test show commands that will output <ANSIBLE_VYOS_TERMINAL_LENGTH - # Otherwise you will get ": "command timeout triggered" + # NOTE: We only test show commands that will output <ANSIBLE_VYOS_TERMINAL_LENGTH + # Otherwise you will get ": "command timeout triggered" - show hardware cpu detail - show hardware mem - show license diff --git a/tests/integration/targets/vyos_command/tests/cli/timeout.yaml b/tests/integration/targets/vyos_command/tests/cli/timeout.yaml index e4716ed..57120ac 100644 --- a/tests/integration/targets/vyos_command/tests/cli/timeout.yaml +++ b/tests/integration/targets/vyos_command/tests/cli/timeout.yaml @@ -8,7 +8,7 @@ wait_for: - result[0] contains bad_value_string register: result - ignore_errors: yes + ignore_errors: true - assert: that: diff --git a/tests/integration/targets/vyos_config/tasks/main.yaml b/tests/integration/targets/vyos_config/tasks/main.yaml index 5e327e8..13977a4 100644 --- a/tests/integration/targets/vyos_config/tasks/main.yaml +++ b/tests/integration/targets/vyos_config/tasks/main.yaml @@ -1,3 +1,3 @@ --- -- { include: cli.yaml, tags: ['cli'] } -- { include: cli_config.yaml, tags: ['cli_config'] } +- {include: cli.yaml, tags: ['cli']} +- {include: cli_config.yaml, tags: ['cli_config']} diff --git a/tests/integration/targets/vyos_config/tests/cli/backup.yaml b/tests/integration/targets/vyos_config/tests/cli/backup.yaml index 0ef0986..af6a772 100644 --- a/tests/integration/targets/vyos_config/tests/cli/backup.yaml +++ b/tests/integration/targets/vyos_config/tests/cli/backup.yaml @@ -16,7 +16,7 @@ - name: take configure backup vyos.vyos.vyos_config: - backup: yes + backup: true register: result - assert: @@ -44,11 +44,11 @@ - name: take configuration backup in custom filename and directory path vyos.vyos.vyos_config: - backup: yes + backup: true backup_options: filename: backup.cfg dir_path: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}" - become: yes + become: true register: result - assert: @@ -67,10 +67,10 @@ - name: take configuration backup in custom filename vyos.vyos.vyos_config: - backup: yes + backup: true backup_options: filename: backup.cfg - become: yes + become: true register: result - assert: @@ -89,10 +89,10 @@ - name: take configuration backup in custom path and default filename vyos.vyos.vyos_config: - backup: yes + backup: true backup_options: dir_path: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}" - become: yes + become: true register: result - assert: diff --git a/tests/integration/targets/vyos_config/tests/cli/check_config.yaml b/tests/integration/targets/vyos_config/tests/cli/check_config.yaml index b90ec7b..f1ddc71 100644 --- a/tests/integration/targets/vyos_config/tests/cli/check_config.yaml +++ b/tests/integration/targets/vyos_config/tests/cli/check_config.yaml @@ -49,11 +49,11 @@ - name: check multiple line config filter is working vyos.vyos.vyos_config: - lines: - - set system login user esa level admin - - set system login user esa authentication encrypted-password '!abc!' - - set system login user vyos level admin - - set system login user vyos authentication encrypted-password 'abc' + lines: + - set system login user esa level admin + - set system login user esa authentication encrypted-password '!abc!' + - set system login user vyos level admin + - set system login user vyos authentication encrypted-password 'abc' register: result - assert: diff --git a/tests/integration/targets/vyos_config/tests/cli_config/cli_backup.yaml b/tests/integration/targets/vyos_config/tests/cli_config/cli_backup.yaml index 8057705..a573d6c 100644 --- a/tests/integration/targets/vyos_config/tests/cli_config/cli_backup.yaml +++ b/tests/integration/targets/vyos_config/tests/cli_config/cli_backup.yaml @@ -1,3 +1,4 @@ +--- - debug: msg="END cli_config/backup.yaml on connection={{ ansible_connection }}" - name: delete configurable backup file path @@ -23,8 +24,8 @@ - name: take config backup network.cli.cli_config: - backup: yes - become: yes + backup: true + become: true register: result - assert: @@ -44,11 +45,11 @@ - name: take configuration backup in custom filename and directory path network.cli.cli_config: - backup: yes + backup: true backup_options: filename: backup.cfg dir_path: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}" - become: yes + become: true register: result - assert: @@ -67,10 +68,10 @@ - name: take configuration backup in custom filename network.cli.cli_config: - backup: yes + backup: true backup_options: filename: backup.cfg - become: yes + become: true register: result - assert: @@ -89,10 +90,10 @@ - name: take configuration backup in custom path and default filename network.cli.cli_config: - backup: yes + backup: true backup_options: dir_path: "{{ role_path }}/backup_test_dir/{{ inventory_hostname_short }}" - become: yes + become: true register: result - assert: diff --git a/tests/integration/targets/vyos_facts/tasks/main.yaml b/tests/integration/targets/vyos_facts/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_facts/tasks/main.yaml +++ b/tests/integration/targets/vyos_facts/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_facts/tests/cli/basic_facts.yaml b/tests/integration/targets/vyos_facts/tests/cli/basic_facts.yaml index e0a3bca..33382ea 100644 --- a/tests/integration/targets/vyos_facts/tests/cli/basic_facts.yaml +++ b/tests/integration/targets/vyos_facts/tests/cli/basic_facts.yaml @@ -1,3 +1,4 @@ +--- - name: get host name vyos.vyos.vyos_command: commands: diff --git a/tests/integration/targets/vyos_interface/tasks/main.yaml b/tests/integration/targets/vyos_interface/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_interface/tasks/main.yaml +++ b/tests/integration/targets/vyos_interface/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_interface/tests/cli/basic.yaml b/tests/integration/targets/vyos_interface/tests/cli/basic.yaml index 22957e1..168d666 100644 --- a/tests/integration/targets/vyos_interface/tests/cli/basic.yaml +++ b/tests/integration/targets/vyos_interface/tests/cli/basic.yaml @@ -84,7 +84,7 @@ - name: Disable interface vyos.vyos.vyos_interface: name: eth1 - enabled: False + enabled: false register: result - assert: @@ -95,7 +95,7 @@ - name: Enable interface vyos.vyos.vyos_interface: name: eth1 - enabled: True + enabled: true register: result - assert: @@ -133,8 +133,8 @@ - name: Set interface on aggregate vyos.vyos.vyos_interface: aggregate: - - { name: eth1, description: test-interface-1, speed: 100, duplex: half, mtu: 512} - - { name: eth2, description: test-interface-2, speed: 1000, duplex: full, mtu: 256} + - {name: eth1, description: test-interface-1, speed: 100, duplex: half, mtu: 512} + - {name: eth2, description: test-interface-2, speed: 1000, duplex: full, mtu: 256} register: result when: "'virtio_net' not in lsmod_out.stdout[0]" @@ -154,8 +154,8 @@ - name: Set interface on aggregate (idempotent) vyos.vyos.vyos_interface: aggregate: - - { name: eth1, description: test-interface-1, speed: 100, duplex: half, mtu: 512} - - { name: eth2, description: test-interface-2, speed: 1000, duplex: full, mtu: 256} + - {name: eth1, description: test-interface-1, speed: 100, duplex: half, mtu: 512} + - {name: eth2, description: test-interface-2, speed: 1000, duplex: full, mtu: 256} register: result when: "'virtio_net' not in lsmod_out.stdout[0]" @@ -170,7 +170,7 @@ - name: eth1 - name: eth2 description: test-interface - enabled: False + enabled: false register: result - assert: @@ -184,7 +184,7 @@ aggregate: - name: eth1 - name: eth2 - enabled: True + enabled: true register: result - assert: diff --git a/tests/integration/targets/vyos_interface/tests/cli/intent.yaml b/tests/integration/targets/vyos_interface/tests/cli/intent.yaml index 946728d..1c14a7b 100644 --- a/tests/integration/targets/vyos_interface/tests/cli/intent.yaml +++ b/tests/integration/targets/vyos_interface/tests/cli/intent.yaml @@ -1,5 +1,5 @@ --- -- debug: msg="START cli/intent.yaml on connection={{ ansible_connection }}" #" +- debug: msg="START cli/intent.yaml on connection={{ ansible_connection }}" # To be able to run the lldp test we need to have a neighbor configured to talk to # In DCI & Zuul we (currently) only spin up a single network VM, so we can't configure a neighbor @@ -30,7 +30,7 @@ - name: Setup (interface is up) vyos.vyos.vyos_interface: name: eth1 - enabled: True + enabled: true state: present register: result @@ -48,7 +48,7 @@ vyos.vyos.vyos_interface: name: eth0 neighbors: - - port: eth0 + - port: eth0 when: run_lldp_tests register: result @@ -61,7 +61,7 @@ vyos.vyos.vyos_interface: name: eth1 state: down - ignore_errors: yes + ignore_errors: true register: result - assert: @@ -73,9 +73,9 @@ vyos.vyos.vyos_interface: name: eth0 neighbors: - - port: dummy_port - host: dummy_host - ignore_errors: yes + - port: dummy_port + host: dummy_host + ignore_errors: true when: run_lldp_tests register: result @@ -89,7 +89,7 @@ - name: Config + intent vyos.vyos.vyos_interface: name: eth1 - enabled: False + enabled: false state: down register: result @@ -100,9 +100,9 @@ - name: Config + intent (fail) vyos.vyos.vyos_interface: name: eth1 - enabled: False + enabled: false state: up - ignore_errors: yes + ignore_errors: true register: result - assert: @@ -113,10 +113,10 @@ - name: Aggregate config + intent (pass) vyos.vyos.vyos_interface: aggregate: - - name: eth1 - enabled: True - state: up - ignore_errors: yes + - name: eth1 + enabled: true + state: up + ignore_errors: true register: result - assert: @@ -126,9 +126,9 @@ - name: Check lldp neighbors intent aggregate arguments vyos.vyos.vyos_interface: aggregate: - - name: eth0 - neighbors: - - port: eth0 + - name: eth0 + neighbors: + - port: eth0 when: run_lldp_tests register: result @@ -140,12 +140,12 @@ - name: Check lldp neighbors intent aggregate arguments (failed) vyos.vyos.vyos_interface: aggregate: - - name: eth0 - neighbors: - - port: eth0 - - port: dummy_port - host: dummy_host - ignore_errors: yes + - name: eth0 + neighbors: + - port: eth0 + - port: dummy_port + host: dummy_host + ignore_errors: true when: run_lldp_tests register: result diff --git a/tests/integration/targets/vyos_interfaces/meta/main.yaml b/tests/integration/targets/vyos_interfaces/meta/main.yaml index e380a13..7413320 100644 --- a/tests/integration/targets/vyos_interfaces/meta/main.yaml +++ b/tests/integration/targets/vyos_interfaces/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - - prepare_vyos_tests
\ No newline at end of file + - prepare_vyos_tests diff --git a/tests/integration/targets/vyos_interfaces/tasks/main.yaml b/tests/integration/targets/vyos_interfaces/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_interfaces/tasks/main.yaml +++ b/tests/integration/targets/vyos_interfaces/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { 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 0a44fa4..4dd5f18 100644 --- a/tests/integration/targets/vyos_interfaces/tests/cli/_populate.yaml +++ b/tests/integration/targets/vyos_interfaces/tests/cli/_populate.yaml @@ -14,4 +14,4 @@ - eth1 - eth2 loop_control: - loop_var: intf
\ No newline at end of file + loop_var: intf 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 ce4723d..9157f55 100644 --- a/tests/integration/targets/vyos_interfaces/tests/cli/_remove_config.yaml +++ b/tests/integration/targets/vyos_interfaces/tests/cli/_remove_config.yaml @@ -14,4 +14,4 @@ - eth1 - eth2 loop_control: - loop_var: intf
\ No newline at end of file + loop_var: intf diff --git a/tests/integration/targets/vyos_interfaces/tests/cli/deleted.yaml b/tests/integration/targets/vyos_interfaces/tests/cli/deleted.yaml index b48f916..fc86ca7 100644 --- a/tests/integration/targets/vyos_interfaces/tests/cli/deleted.yaml +++ b/tests/integration/targets/vyos_interfaces/tests/cli/deleted.yaml @@ -4,7 +4,7 @@ - include_tasks: _populate.yaml -- block: +- block: - name: Delete attributes of given interfaces vyos.vyos.vyos_interfaces: &deleted config: 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 ab68fde..4a72c8a 100644 --- a/tests/integration/targets/vyos_interfaces/tests/cli/empty_config.yaml +++ b/tests/integration/targets/vyos_interfaces/tests/cli/empty_config.yaml @@ -1,13 +1,13 @@ --- - 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 vyos.vyos.vyos_interfaces: config: state: merged register: result - ignore_errors: True + ignore_errors: true - assert: that: @@ -18,7 +18,7 @@ config: state: replaced register: result - ignore_errors: True + ignore_errors: true - assert: that: @@ -29,7 +29,7 @@ config: state: overridden register: result - ignore_errors: True + 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 89ed893..50e4936 100644 --- a/tests/integration/targets/vyos_interfaces/tests/cli/merged.yaml +++ b/tests/integration/targets/vyos_interfaces/tests/cli/merged.yaml @@ -1,6 +1,6 @@ --- - 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 @@ -56,4 +56,4 @@ that: - "{{ merged['after'] | symmetric_difference(result['before']) |length == 0 }}" always: - - include_tasks: _remove_config.yaml + - 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 c9eb1b7..74669f7 100644 --- a/tests/integration/targets/vyos_interfaces/tests/cli/overridden.yaml +++ b/tests/integration/targets/vyos_interfaces/tests/cli/overridden.yaml @@ -1,6 +1,6 @@ --- - 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 @@ -22,7 +22,7 @@ - name: Assert that before dicts were correctly generated assert: that: - - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" + - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" - name: Assert that correct commands were generated assert: @@ -47,6 +47,6 @@ assert: that: - "{{ 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 1211f63..64510d7 100644 --- a/tests/integration/targets/vyos_interfaces/tests/cli/replaced.yaml +++ b/tests/integration/targets/vyos_interfaces/tests/cli/replaced.yaml @@ -1,6 +1,6 @@ --- - 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 @@ -13,8 +13,8 @@ - name: eth1 description: "Replaced by Ansible" vifs: - - vlan_id: 100 - description: "VIF 100 - Replaced by Ansible" + - vlan_id: 100 + description: "VIF 100 - Replaced by Ansible" - name: eth2 mtu: 1400 @@ -24,8 +24,8 @@ - name: Assert that correct set of commands were generated assert: - that: - - "{{ replaced['commands'] | symmetric_difference(result['commands']) |length == 0 }}" + that: + - "{{ replaced['commands'] | symmetric_difference(result['commands']) |length == 0 }}" - name: Assert that before dicts are correctly generated assert: @@ -43,13 +43,13 @@ - name: Assert that task was idempotent assert: - that: - - "result['changed'] == false" + that: + - "result['changed'] == false" - name: Assert that before dict is correctly generated assert: - that: - - "{{ replaced['after'] | symmetric_difference(result['before']) |length == 0 }}" + that: + - "{{ replaced['after'] | symmetric_difference(result['before']) |length == 0 }}" always: - - include_tasks: _remove_config.yaml
\ No newline at end of file + - 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 3ec4d3d..f947513 100644 --- a/tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml +++ b/tests/integration/targets/vyos_interfaces/tests/cli/rtt.yaml @@ -73,6 +73,6 @@ - name: Assert that config was reverted assert: that: "{{ base_config['after'] | symmetric_difference(revert['after']) |length == 0 }}" - + always: - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_l3_interface/tasks/main.yaml b/tests/integration/targets/vyos_l3_interface/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_l3_interface/tasks/main.yaml +++ b/tests/integration/targets/vyos_l3_interface/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_l3_interface/tests/cli/basic.yaml b/tests/integration/targets/vyos_l3_interface/tests/cli/basic.yaml index 9ad6955..3c24b11 100644 --- a/tests/integration/targets/vyos_l3_interface/tests/cli/basic.yaml +++ b/tests/integration/targets/vyos_l3_interface/tests/cli/basic.yaml @@ -147,9 +147,9 @@ - name: Set IP addresses on aggregate vyos.vyos.vyos_l3_interface: aggregate: - - { name: eth1, ipv4: 192.168.2.10/24 } - - { name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64" } - - { name: eth2, ipv4: 192.168.4.10/24 } + - {name: eth1, ipv4: 192.168.2.10/24} + - {name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64"} + - {name: eth2, ipv4: 192.168.4.10/24} register: result - assert: @@ -163,9 +163,9 @@ - name: Set IP addresses on aggregate (idempotent) vyos.vyos.vyos_l3_interface: aggregate: - - { name: eth1, ipv4: 192.168.2.10/24 } - - { name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64" } - - { name: eth2, ipv4: 192.168.4.10/24 } + - {name: eth1, ipv4: 192.168.2.10/24} + - {name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64"} + - {name: eth2, ipv4: 192.168.4.10/24} register: result - assert: @@ -175,9 +175,9 @@ - name: Remove IP addresses on aggregate vyos.vyos.vyos_l3_interface: aggregate: - - { name: eth1, ipv4: 192.168.2.10/24 } - - { name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64" } - - { name: eth2, ipv4: 192.168.4.10/24 } + - {name: eth1, ipv4: 192.168.2.10/24} + - {name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64"} + - {name: eth2, ipv4: 192.168.4.10/24} state: absent register: result @@ -192,9 +192,9 @@ - name: Remove IP addresses on aggregate (idempotent) vyos.vyos.vyos_l3_interface: aggregate: - - { name: eth1, ipv4: 192.168.2.10/24 } - - { name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64" } - - { name: eth2, ipv4: 192.168.4.10/24 } + - {name: eth1, ipv4: 192.168.2.10/24} + - {name: eth2, ipv4: 192.168.3.10/24, ipv6: "fd5d:12c9:2201:1::1/64"} + - {name: eth2, ipv4: 192.168.4.10/24} state: absent register: result diff --git a/tests/integration/targets/vyos_l3_interfaces/meta/main.yml b/tests/integration/targets/vyos_l3_interfaces/meta/main.yml index e380a13..7413320 100644 --- a/tests/integration/targets/vyos_l3_interfaces/meta/main.yml +++ b/tests/integration/targets/vyos_l3_interfaces/meta/main.yml @@ -1,2 +1,3 @@ +--- dependencies: - - prepare_vyos_tests
\ No newline at end of file + - prepare_vyos_tests diff --git a/tests/integration/targets/vyos_l3_interfaces/tasks/main.yaml b/tests/integration/targets/vyos_l3_interfaces/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tasks/main.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_l3_interfaces/tests/cli/_populate.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/_populate.yaml index fc0bbb2..d598c42 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/_populate.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/_populate.yaml @@ -8,4 +8,4 @@ set interfaces ethernet eth2 address '192.0.2.10/24' set interfaces ethernet eth2 address '192.0.2.11/24' set interfaces ethernet eth2 address '2001:db8::10/32' - set interfaces ethernet eth2 address '2001:db8::12/32'
\ No newline at end of file + set interfaces ethernet eth2 address '2001:db8::12/32' diff --git a/tests/integration/targets/vyos_l3_interfaces/tests/cli/deleted.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/deleted.yaml index a40901c..b95bcdb 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/deleted.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/deleted.yaml @@ -5,44 +5,44 @@ - include_tasks: _remove_config.yaml - block: - - include_tasks: _populate.yaml - - - name: Delete attributes of given interfaces - vyos.vyos.vyos_l3_interfaces: &deleted - config: - - name: eth1 - - name: eth2 - state: deleted - register: result - - - name: Assert that the before dicts were correctly generated - assert: - that: - - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" - - - name: Assert that the correct set of commands were generated - assert: - that: - - "{{ 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 }}" - - - name: Delete attributes of given interfaces (IDEMPOTENT) - vyos.vyos.vyos_l3_interfaces: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.changed == false" - - - name: Assert that the before dicts were correctly generated - assert: - that: - - "{{ deleted['after'] | symmetric_difference(result['before']) |length == 0 }}" + - include_tasks: _populate.yaml + + - name: Delete attributes of given interfaces + vyos.vyos.vyos_l3_interfaces: &deleted + config: + - name: eth1 + - name: eth2 + state: deleted + register: result + + - name: Assert that the before dicts were correctly generated + assert: + that: + - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" + + - name: Assert that the correct set of commands were generated + assert: + that: + - "{{ 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 }}" + + - name: Delete attributes of given interfaces (IDEMPOTENT) + vyos.vyos.vyos_l3_interfaces: *deleted + register: result + + - name: Assert that the previous task was idempotent + assert: + that: + - "result.changed == false" + + - name: Assert that the before dicts were correctly generated + assert: + that: + - "{{ deleted['after'] | symmetric_difference(result['before']) |length == 0 }}" always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_l3_interfaces/tests/cli/empty_config.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/empty_config.yaml index 530df88..7b1f100 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/empty_config.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/empty_config.yaml @@ -1,13 +1,13 @@ --- - debug: - msg: "START vyos_l3_interfaces empty_config integration tests on connection={{ ansible_connection }}" + msg: "START vyos_l3_interfaces empty_config integration tests on connection={{ ansible_connection }}" - name: Merged with empty config should give appropriate error message vyos.vyos.vyos_l3_interfaces: config: state: merged register: result - ignore_errors: True + ignore_errors: true - assert: that: @@ -18,7 +18,7 @@ config: state: replaced register: result - ignore_errors: True + ignore_errors: true - assert: that: @@ -29,7 +29,7 @@ config: state: overridden register: result - ignore_errors: True + ignore_errors: true - assert: that: diff --git a/tests/integration/targets/vyos_l3_interfaces/tests/cli/merged.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/merged.yaml index 64724ef..1b3b9ea 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/merged.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/merged.yaml @@ -5,54 +5,54 @@ - include_tasks: _remove_config.yaml - block: - - name: Merge the provided configuration with the exisiting running configuration - vyos.vyos.vyos_l3_interfaces: &merged - config: - - name: eth1 - ipv4: - - address: 192.0.2.10/24 - ipv6: - - address: 2001:db8::10/32 - - - name: eth2 - ipv4: - - address: 198.51.100.10/24 - vifs: - - vlan_id: 101 - ipv4: - - address: 198.51.100.130/25 - ipv6: - - address: 2001:db8::20/32 - state: merged - register: result - - - name: Assert that before dicts were correctly generated - assert: - 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 }}" - - - name: Assert that after dicts was correctly generated - assert: - that: - - "{{ merged['after'] | symmetric_difference(result['after']) |length == 0 }}" - - - name: Merge the provided configuration with the existing running configuration (IDEMPOTENT) - vyos.vyos.vyos_l3_interfaces: *merged - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result['changed'] == false" - - - name: Assert that before dicts were correctly generated - assert: - that: - - "{{ merged['after'] | symmetric_difference(result['before']) |length == 0 }}" + - name: Merge the provided configuration with the exisiting running configuration + vyos.vyos.vyos_l3_interfaces: &merged + config: + - name: eth1 + ipv4: + - address: 192.0.2.10/24 + ipv6: + - address: 2001:db8::10/32 + + - name: eth2 + ipv4: + - address: 198.51.100.10/24 + vifs: + - vlan_id: 101 + ipv4: + - address: 198.51.100.130/25 + ipv6: + - address: 2001:db8::20/32 + state: merged + register: result + + - name: Assert that before dicts were correctly generated + assert: + 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 }}" + + - name: Assert that after dicts was correctly generated + assert: + that: + - "{{ merged['after'] | symmetric_difference(result['after']) |length == 0 }}" + + - name: Merge the provided configuration with the existing running configuration (IDEMPOTENT) + vyos.vyos.vyos_l3_interfaces: *merged + register: result + + - name: Assert that the previous task was idempotent + assert: + that: + - "result['changed'] == false" + + - name: Assert that before dicts were correctly generated + assert: + that: + - "{{ merged['after'] | symmetric_difference(result['before']) |length == 0 }}" always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_l3_interfaces/tests/cli/overridden.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/overridden.yaml index 6a9b013..06d6fc7 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/overridden.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/overridden.yaml @@ -5,48 +5,48 @@ - include_tasks: _remove_config.yaml - block: - - include_tasks: _populate.yaml - - - name: Overrides all device configuration with provided configuration - vyos.vyos.vyos_l3_interfaces: &overridden - config: - - name: eth0 - ipv4: - - address: dhcp - - name: eth1 - ipv4: - - address: "192.0.2.15/24" - state: overridden - register: result - - - name: Assert that before dicts were correctly generated - assert: - that: - - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" - - - name: Assert that correct commands were generated - assert: - that: - - "{{ 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 }}" - - - name: Overrides all device configuration with provided configurations (IDEMPOTENT) - vyos.vyos.vyos_l3_interfaces: *overridden - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result['changed'] == false" - - - name: Assert that before dicts were correctly generated - assert: - that: - - "{{ overridden['after'] | symmetric_difference(result['before']) |length == 0 }}" + - include_tasks: _populate.yaml + + - name: Overrides all device configuration with provided configuration + vyos.vyos.vyos_l3_interfaces: &overridden + config: + - name: eth0 + ipv4: + - address: dhcp + - name: eth1 + ipv4: + - address: "192.0.2.15/24" + state: overridden + register: result + + - name: Assert that before dicts were correctly generated + assert: + that: + - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" + + - name: Assert that correct commands were generated + assert: + that: + - "{{ 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 }}" + + - name: Overrides all device configuration with provided configurations (IDEMPOTENT) + vyos.vyos.vyos_l3_interfaces: *overridden + register: result + + - name: Assert that the previous task was idempotent + assert: + that: + - "result['changed'] == false" + + - name: Assert that before dicts were correctly generated + assert: + that: + - "{{ overridden['after'] | symmetric_difference(result['before']) |length == 0 }}" always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_l3_interfaces/tests/cli/replaced.yaml b/tests/integration/targets/vyos_l3_interfaces/tests/cli/replaced.yaml index 4d44983..6f1228a 100644 --- a/tests/integration/targets/vyos_l3_interfaces/tests/cli/replaced.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/tests/cli/replaced.yaml @@ -5,48 +5,48 @@ - include_tasks: _remove_config.yaml - block: - - include_tasks: _populate.yaml - - - name: Replace device configurations of listed interfaces with provided configurations - vyos.vyos.vyos_l3_interfaces: &replaced - config: - - name: eth1 - ipv4: - - address: 192.0.2.19/24 - - name: eth2 - ipv6: - - address: 2001:db8::11/32 - state: replaced - register: result - - - name: Assert that correct set of commands were generated - assert: - that: - - "{{ replaced['commands'] | symmetric_difference(result['commands']) |length == 0 }}" - - - name: Assert that before dicts are correctly generated - assert: - that: - - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" - - - name: Assert that after dict is correctly generated - assert: - that: - - "{{ replaced['after'] | symmetric_difference(result['after']) |length == 0 }}" - - - name: Replace device configurations of listed interfaces with provided configurarions (IDEMPOTENT) - vyos.vyos.vyos_l3_interfaces: *replaced - register: result - - - name: Assert that task was idempotent - assert: - that: - - "result['changed'] == false" - - - name: Assert that before dict is correctly generated - assert: - that: - - "{{ replaced['after'] | symmetric_difference(result['before']) |length == 0 }}" + - include_tasks: _populate.yaml + + - name: Replace device configurations of listed interfaces with provided configurations + vyos.vyos.vyos_l3_interfaces: &replaced + config: + - name: eth1 + ipv4: + - address: 192.0.2.19/24 + - name: eth2 + ipv6: + - address: 2001:db8::11/32 + state: replaced + register: result + + - name: Assert that correct set of commands were generated + assert: + that: + - "{{ replaced['commands'] | symmetric_difference(result['commands']) |length == 0 }}" + + - name: Assert that before dicts are correctly generated + assert: + that: + - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" + + - name: Assert that after dict is correctly generated + assert: + that: + - "{{ replaced['after'] | symmetric_difference(result['after']) |length == 0 }}" + + - name: Replace device configurations of listed interfaces with provided configurarions (IDEMPOTENT) + vyos.vyos.vyos_l3_interfaces: *replaced + register: result + + - name: Assert that task was idempotent + assert: + that: + - "result['changed'] == false" + + - name: Assert that before dict is correctly generated + assert: + that: + - "{{ replaced['after'] | symmetric_difference(result['before']) |length == 0 }}" always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_l3_interfaces/vars/main.yaml b/tests/integration/targets/vyos_l3_interfaces/vars/main.yaml index f908d2c..1241763 100644 --- a/tests/integration/targets/vyos_l3_interfaces/vars/main.yaml +++ b/tests/integration/targets/vyos_l3_interfaces/vars/main.yaml @@ -20,7 +20,7 @@ merged: - name: "eth0" ipv4: - address: "dhcp" - + - name: "eth1" ipv4: - address: "192.0.2.10/24" diff --git a/tests/integration/targets/vyos_lag_interfaces/meta/main.yaml b/tests/integration/targets/vyos_lag_interfaces/meta/main.yaml index f88bce5..7413320 100644 --- a/tests/integration/targets/vyos_lag_interfaces/meta/main.yaml +++ b/tests/integration/targets/vyos_lag_interfaces/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_vyos_tests diff --git a/tests/integration/targets/vyos_lag_interfaces/tasks/main.yaml b/tests/integration/targets/vyos_lag_interfaces/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_lag_interfaces/tasks/main.yaml +++ b/tests/integration/targets/vyos_lag_interfaces/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_lag_interfaces/tests/cli/_add_bond.yaml b/tests/integration/targets/vyos_lag_interfaces/tests/cli/_add_bond.yaml index c479f79..adacb0c 100644 --- a/tests/integration/targets/vyos_lag_interfaces/tests/cli/_add_bond.yaml +++ b/tests/integration/targets/vyos_lag_interfaces/tests/cli/_add_bond.yaml @@ -4,5 +4,5 @@ config: "{{ lines }}" vars: lines: | - set interfaces bonding bond0 - set interfaces bonding bond1 + set interfaces bonding bond0 + set interfaces bonding bond1 diff --git a/tests/integration/targets/vyos_lag_interfaces/tests/cli/_remove_bond.yaml b/tests/integration/targets/vyos_lag_interfaces/tests/cli/_remove_bond.yaml index 1d7ee69..29085bd 100644 --- a/tests/integration/targets/vyos_lag_interfaces/tests/cli/_remove_bond.yaml +++ b/tests/integration/targets/vyos_lag_interfaces/tests/cli/_remove_bond.yaml @@ -4,5 +4,5 @@ config: "{{ lines }}" vars: lines: | - delete interfaces bonding bond0 - delete interfaces bonding bond1 + delete interfaces bonding bond0 + delete interfaces bonding bond1 diff --git a/tests/integration/targets/vyos_lag_interfaces/tests/cli/deleted.yaml b/tests/integration/targets/vyos_lag_interfaces/tests/cli/deleted.yaml index db6fb88..af6e632 100644 --- a/tests/integration/targets/vyos_lag_interfaces/tests/cli/deleted.yaml +++ b/tests/integration/targets/vyos_lag_interfaces/tests/cli/deleted.yaml @@ -5,42 +5,42 @@ - include_tasks: _populate.yaml - block: - - name: Delete attributes of given LAG interfaces. - vyos.vyos.vyos_lag_interfaces: &deleted - config: - - name: bond0 - - name: bond1 - state: deleted - register: result - - - name: Assert that the before dicts were correctly generated - assert: - that: - - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" - - - name: Assert that the correct set of commands were generated - assert: - that: - - "{{ 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 }}" - - - name: Delete attributes of given interfaces (IDEMPOTENT) - vyos.vyos.vyos_lag_interfaces: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.changed == false" - - - name: Assert that the before dicts were correctly generated - assert: - that: - - "{{ deleted['after'] | symmetric_difference(result['before']) |length == 0 }}" - + - name: Delete attributes of given LAG interfaces. + vyos.vyos.vyos_lag_interfaces: &deleted + config: + - name: bond0 + - name: bond1 + state: deleted + register: result + + - name: Assert that the before dicts were correctly generated + assert: + that: + - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" + + - name: Assert that the correct set of commands were generated + assert: + that: + - "{{ 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 }}" + + - name: Delete attributes of given interfaces (IDEMPOTENT) + vyos.vyos.vyos_lag_interfaces: *deleted + register: result + + - name: Assert that the previous task was idempotent + assert: + that: + - "result.changed == false" + + - name: Assert that the before dicts were correctly generated + assert: + that: + - "{{ deleted['after'] | symmetric_difference(result['before']) |length == 0 }}" + always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lag_interfaces/tests/cli/empty_config.yaml b/tests/integration/targets/vyos_lag_interfaces/tests/cli/empty_config.yaml index c222354..74d3466 100644 --- a/tests/integration/targets/vyos_lag_interfaces/tests/cli/empty_config.yaml +++ b/tests/integration/targets/vyos_lag_interfaces/tests/cli/empty_config.yaml @@ -1,13 +1,13 @@ --- - debug: - msg: "START vyos_lag_interfaces empty_config integration tests on connection={{ ansible_connection }}" + msg: "START vyos_lag_interfaces empty_config integration tests on connection={{ ansible_connection }}" - name: Merged with empty config should give appropriate error message vyos.vyos.vyos_lag_interfaces: config: state: merged register: result - ignore_errors: True + ignore_errors: true - assert: that: @@ -18,7 +18,7 @@ config: state: replaced register: result - ignore_errors: True + ignore_errors: true - assert: that: @@ -29,7 +29,7 @@ config: state: overridden register: result - ignore_errors: True + ignore_errors: true - assert: that: diff --git a/tests/integration/targets/vyos_lag_interfaces/tests/cli/merged.yaml b/tests/integration/targets/vyos_lag_interfaces/tests/cli/merged.yaml index 78c9de1..7b1931f 100644 --- a/tests/integration/targets/vyos_lag_interfaces/tests/cli/merged.yaml +++ b/tests/integration/targets/vyos_lag_interfaces/tests/cli/merged.yaml @@ -1,6 +1,6 @@ --- - debug: - msg: "START vyos_lag_interfaces merged integration tests on connection={{ ansible_connection }}" + msg: "START vyos_lag_interfaces merged integration tests on connection={{ ansible_connection }}" - include_tasks: _remove_config.yaml @@ -9,52 +9,52 @@ - include_tasks: _add_bond.yaml - block: - - name: Merge the provided configuration with the exisiting running configuration - vyos.vyos.vyos_lag_interfaces: &merged + - name: Merge the provided configuration with the exisiting running configuration + vyos.vyos.vyos_lag_interfaces: &merged config: - - name: bond0 - hash_policy: "layer2" - mode: "active-backup" - members: - - member: eth1 - primary: eth1 - - - name: bond1 - hash_policy: "layer2+3" - mode: "active-backup" - members: - - member: eth2 - primary: eth2 + - name: bond0 + hash_policy: "layer2" + mode: "active-backup" + members: + - member: eth1 + primary: eth1 + + - name: bond1 + hash_policy: "layer2+3" + mode: "active-backup" + members: + - member: eth2 + primary: eth2 state: merged - register: result + register: result - - name: Assert that before dicts were correctly generated - assert: + - name: Assert that before dicts were correctly generated + assert: that: "{{ merged['before'] | symmetric_difference(result['before']) |length == 0 }}" - - name: Assert that correct set of commands were generated - assert: + - 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: + - 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_lag_interfaces: *merged - register: result + - name: Merge the provided configuration with the existing running configuration (IDEMPOTENT) + vyos.vyos.vyos_lag_interfaces: *merged + register: result - - name: Assert that the previous task was idempotent - assert: + - 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: + - 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 + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lag_interfaces/tests/cli/overridden.yaml b/tests/integration/targets/vyos_lag_interfaces/tests/cli/overridden.yaml index 6139d9f..c44cc33 100644 --- a/tests/integration/targets/vyos_lag_interfaces/tests/cli/overridden.yaml +++ b/tests/integration/targets/vyos_lag_interfaces/tests/cli/overridden.yaml @@ -1,6 +1,6 @@ --- - debug: - msg: "START vyos_lag_interfaces overridden integration tests on connection={{ ansible_connection }}" + msg: "START vyos_lag_interfaces overridden integration tests on connection={{ ansible_connection }}" - include_tasks: _remove_config.yaml @@ -9,46 +9,46 @@ - include_tasks: _populate.yaml - block: - - name: Overrides all device configuration with provided configuration - vyos.vyos.vyos_lag_interfaces: &overridden + - name: Overrides all device configuration with provided configuration + vyos.vyos.vyos_lag_interfaces: &overridden config: - - name: bond1 - mode: "active-backup" - members: - - member: eth2 - primary: eth2 - hash_policy: layer2 + - name: bond1 + mode: "active-backup" + members: + - member: eth2 + primary: eth2 + hash_policy: layer2 state: overridden - register: result + register: result - - name: Assert that before dicts were correctly generated - assert: + - name: Assert that before dicts were correctly generated + assert: that: - - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" + - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" - - name: Assert that correct commands were generated - assert: + - 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: + - 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_lag_interfaces: *overridden - register: result + - name: Overrides all device configuration with provided configurations (IDEMPOTENT) + vyos.vyos.vyos_lag_interfaces: *overridden + register: result - - name: Assert that the previous task was idempotent - assert: + - 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: + - 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 + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lag_interfaces/tests/cli/replaced.yaml b/tests/integration/targets/vyos_lag_interfaces/tests/cli/replaced.yaml index ce469e0..894d505 100644 --- a/tests/integration/targets/vyos_lag_interfaces/tests/cli/replaced.yaml +++ b/tests/integration/targets/vyos_lag_interfaces/tests/cli/replaced.yaml @@ -1,51 +1,51 @@ --- - debug: - msg: "START vyos_lag_interfaces replaced integration tests on connection={{ ansible_connection }}" + msg: "START vyos_lag_interfaces replaced integration tests on connection={{ ansible_connection }}" - include_tasks: _remove_config.yaml - include_tasks: _populate.yaml - block: - - name: Replace device configurations of listed LAG interfaces with provided configurations - vyos.vyos.vyos_lag_interfaces: &replaced + - name: Replace device configurations of listed LAG interfaces with provided configurations + vyos.vyos.vyos_lag_interfaces: &replaced config: - - name: bond1 - mode: "802.3ad" - hash_policy: "layer2" - members: - - member: eth2 + - name: bond1 + mode: "802.3ad" + hash_policy: "layer2" + members: + - member: eth2 state: replaced - register: result + register: result - - name: Assert that correct set of commands were generated - assert: + - 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: + - name: Assert that before dicts are correctly generated + assert: that: - - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" + - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" - - name: Assert that after dict is correctly generated - assert: + - 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 LAG interfaces with provided configurarions (IDEMPOTENT) - vyos.vyos.vyos_lag_interfaces: *replaced - register: result + - name: Replace device configurations of listed LAG interfaces with provided configurarions (IDEMPOTENT) + vyos.vyos.vyos_lag_interfaces: *replaced + register: result - - name: Assert that task was idempotent - assert: + - name: Assert that task was idempotent + assert: that: - - "result['changed'] == false" + - "result['changed'] == false" - - name: Assert that before dict is correctly generated - assert: + - 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 + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lag_interfaces/tests/cli/rtt.yaml b/tests/integration/targets/vyos_lag_interfaces/tests/cli/rtt.yaml index eb3814e..3095a12 100644 --- a/tests/integration/targets/vyos_lag_interfaces/tests/cli/rtt.yaml +++ b/tests/integration/targets/vyos_lag_interfaces/tests/cli/rtt.yaml @@ -7,63 +7,63 @@ - include_tasks: _remove_bond.yaml - block: - - name: Apply the provided configuration (base config) - vyos.vyos.vyos_lag_interfaces: - config: - - name: bond0 - hash_policy: "layer2" - mode: "active-backup" - members: - - member: eth1 - primary: eth1 + - name: Apply the provided configuration (base config) + vyos.vyos.vyos_lag_interfaces: + config: + - name: bond0 + hash_policy: "layer2" + mode: "active-backup" + members: + - member: eth1 + primary: eth1 - - name: bond1 - hash_policy: "layer2+3" - mode: "active-backup" - members: - - member: eth2 - primary: eth2 + - name: bond1 + hash_policy: "layer2+3" + mode: "active-backup" + members: + - member: eth2 + primary: eth2 - state: merged - register: base_config + state: merged + register: base_config - - name: Gather lag_interfaces facts - vyos.vyos.vyos_facts: - gather_subset: - - default - gather_network_resources: - - lag_interfaces + - name: Gather lag_interfaces facts + vyos.vyos.vyos_facts: + gather_subset: + - default + gather_network_resources: + - lag_interfaces - - name: Apply the provided configuration (config to be reverted) - vyos.vyos.vyos_lag_interfaces: - config: - - name: bond0 - hash_policy: "layer2+3" - mode: "802.3ad" - members: - - member: eth1 + - name: Apply the provided configuration (config to be reverted) + vyos.vyos.vyos_lag_interfaces: + config: + - name: bond0 + hash_policy: "layer2+3" + mode: "802.3ad" + members: + - member: eth1 - - name: bond1 - hash_policy: "layer2" - mode: "xor-hash" - members: - - member: eth2 - state: merged - register: result + - name: bond1 + hash_policy: "layer2" + mode: "xor-hash" + members: + - member: eth2 + state: merged + register: result - - name: Assert that changes were applied - assert: - that: "{{ round_trip['after'] | symmetric_difference(result['after']) |length == 0 }}" + - name: Assert that changes were applied + assert: + that: "{{ round_trip['after'] | symmetric_difference(result['after']) |length == 0 }}" - - name: Revert back to base config using facts round trip - vyos.vyos.vyos_lag_interfaces: - config: "{{ ansible_facts['network_resources']['lag_interfaces'] }}" - state: overridden - register: revert + - name: Revert back to base config using facts round trip + vyos.vyos.vyos_lag_interfaces: + config: "{{ ansible_facts['network_resources']['lag_interfaces'] }}" + state: overridden + register: revert - - name: Assert that config was reverted - assert: - that: "{{ base_config['after'] | symmetric_difference(revert['after']) |length == 0 }}" + - name: Assert that config was reverted + assert: + that: "{{ base_config['after'] | symmetric_difference(revert['after']) |length == 0 }}" always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_linkagg/tasks/main.yaml b/tests/integration/targets/vyos_linkagg/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_linkagg/tasks/main.yaml +++ b/tests/integration/targets/vyos_linkagg/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_linkagg/tests/cli/basic.yaml b/tests/integration/targets/vyos_linkagg/tests/cli/basic.yaml index 5a02255..fadbbd7 100644 --- a/tests/integration/targets/vyos_linkagg/tests/cli/basic.yaml +++ b/tests/integration/targets/vyos_linkagg/tests/cli/basic.yaml @@ -130,8 +130,8 @@ - name: Create collection of linkagg definitions vyos.vyos.vyos_linkagg: aggregate: - - { name: bond0, members: [eth1] } - - { name: bond1, members: [eth2] } + - {name: bond0, members: [eth1]} + - {name: bond1, members: [eth2]} state: present register: result @@ -146,8 +146,8 @@ - name: Create collection of linkagg definitions again (idempotent) vyos.vyos.vyos_linkagg: aggregate: - - { name: bond0, members: [eth1] } - - { name: bond1, members: [eth2] } + - {name: bond0, members: [eth1]} + - {name: bond1, members: [eth2]} state: present register: result diff --git a/tests/integration/targets/vyos_lldp/tasks/main.yaml b/tests/integration/targets/vyos_lldp/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_lldp/tasks/main.yaml +++ b/tests/integration/targets/vyos_lldp/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_lldp_global/tasks/main.yaml b/tests/integration/targets/vyos_lldp_global/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_lldp_global/tasks/main.yaml +++ b/tests/integration/targets/vyos_lldp_global/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_lldp_global/tests/cli/deleted.yaml b/tests/integration/targets/vyos_lldp_global/tests/cli/deleted.yaml index 79660af..8017e93 100644 --- a/tests/integration/targets/vyos_lldp_global/tests/cli/deleted.yaml +++ b/tests/integration/targets/vyos_lldp_global/tests/cli/deleted.yaml @@ -5,40 +5,40 @@ - include_tasks: _populate.yaml - block: - - name: Delete attributes of LLDP service. - vyos.vyos.vyos_lldp_global: &deleted - config: - state: deleted - register: result - - - name: Assert that the before dicts were correctly generated - assert: - that: - - "{{ populate == result['before']}}" - - - name: Assert that the correct set of commands were generated - assert: - that: - - "{{ deleted['commands'] | symmetric_difference(result['commands']) |length == 0 }}" - - - name: Assert that the after dicts were correctly generated - assert: - that: - - "{{ deleted['after'] == result['after']}}" - - - name: Delete attributes of given interfaces (IDEMPOTENT) - vyos.vyos.vyos_lldp_global: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.changed == false" - - - name: Assert that the before dicts were correctly generated - assert: - that: - - "{{ deleted['after'] == result['before'] }}" + - name: Delete attributes of LLDP service. + vyos.vyos.vyos_lldp_global: &deleted + config: + state: deleted + register: result + + - name: Assert that the before dicts were correctly generated + assert: + that: + - "{{ populate == result['before']}}" + + - name: Assert that the correct set of commands were generated + assert: + that: + - "{{ deleted['commands'] | symmetric_difference(result['commands']) |length == 0 }}" + + - name: Assert that the after dicts were correctly generated + assert: + that: + - "{{ deleted['after'] == result['after']}}" + + - name: Delete attributes of given interfaces (IDEMPOTENT) + vyos.vyos.vyos_lldp_global: *deleted + register: result + + - name: Assert that the previous task was idempotent + assert: + that: + - "result.changed == false" + + - name: Assert that the before dicts were correctly generated + assert: + that: + - "{{ deleted['after'] == result['before'] }}" always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lldp_global/tests/cli/empty_config.yaml b/tests/integration/targets/vyos_lldp_global/tests/cli/empty_config.yaml index 5bac638..05609b6 100644 --- a/tests/integration/targets/vyos_lldp_global/tests/cli/empty_config.yaml +++ b/tests/integration/targets/vyos_lldp_global/tests/cli/empty_config.yaml @@ -1,13 +1,13 @@ --- - debug: - msg: "START vyos_lldp_global empty_config integration tests on connection={{ ansible_connection }}" + msg: "START vyos_lldp_global empty_config integration tests on connection={{ ansible_connection }}" - name: Merged with empty config should give appropriate error message vyos.vyos.vyos_lldp_global: config: state: merged register: result - ignore_errors: True + ignore_errors: true - assert: that: @@ -18,7 +18,7 @@ config: state: replaced register: result - ignore_errors: True + ignore_errors: true - assert: that: diff --git a/tests/integration/targets/vyos_lldp_global/tests/cli/merged.yaml b/tests/integration/targets/vyos_lldp_global/tests/cli/merged.yaml index b1687da..a17bd61 100644 --- a/tests/integration/targets/vyos_lldp_global/tests/cli/merged.yaml +++ b/tests/integration/targets/vyos_lldp_global/tests/cli/merged.yaml @@ -1,49 +1,49 @@ --- - debug: - msg: "START vyos_lldp_global merged integration tests on connection={{ ansible_connection }}" + msg: "START vyos_lldp_global merged integration tests on connection={{ ansible_connection }}" - include_tasks: _remove_config.yaml - include_tasks: _populate.yaml - block: - - name: Merge the provided configuration with the exisiting running configuration - vyos.vyos.vyos_lldp_global: &merged + - name: Merge the provided configuration with the exisiting running configuration + vyos.vyos.vyos_lldp_global: &merged config: - legacy_protocols: - - 'fdp' - - 'cdp' - address: 192.0.2.11 + legacy_protocols: + - 'fdp' + - 'cdp' + address: 192.0.2.11 state: merged - register: result + register: result - - name: Assert that before dicts were correctly generated - assert: + - name: Assert that before dicts were correctly generated + assert: that: "{{ merged['before'] == result['before'] }}" - - name: Assert that correct set of commands were generated - assert: + - 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: + - name: Assert that after dicts was correctly generated + assert: that: - - "{{ merged['after'] == result['after'] }}" + - "{{ merged['after'] == result['after'] }}" - - name: Merge the provided configuration with the existing running configuration (IDEMPOTENT) - vyos.vyos.vyos_lldp_global: *merged - register: result + - name: Merge the provided configuration with the existing running configuration (IDEMPOTENT) + vyos.vyos.vyos_lldp_global: *merged + register: result - - name: Assert that the previous task was idempotent - assert: + - 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: + - name: Assert that before dicts were correctly generated + assert: that: - - "{{ merged['after'] == result['before'] }}" + - "{{ merged['after'] == result['before'] }}" always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lldp_global/tests/cli/replaced.yaml b/tests/integration/targets/vyos_lldp_global/tests/cli/replaced.yaml index 22bd8e5..371e7f3 100644 --- a/tests/integration/targets/vyos_lldp_global/tests/cli/replaced.yaml +++ b/tests/integration/targets/vyos_lldp_global/tests/cli/replaced.yaml @@ -1,51 +1,51 @@ --- - debug: - msg: "START vyos_lldp_global replaced integration tests on connection={{ ansible_connection }}" + msg: "START vyos_lldp_global replaced integration tests on connection={{ ansible_connection }}" - include_tasks: _remove_config.yaml - include_tasks: _populate.yaml - block: - - name: Replace device configurations of LLDP service with provided configurations - vyos.vyos.vyos_lldp_global: &replaced + - name: Replace device configurations of LLDP service with provided configurations + vyos.vyos.vyos_lldp_global: &replaced config: - legacy_protocols: - - 'edp' - - 'sonmp' - - 'cdp' - address: 192.0.2.14 + legacy_protocols: + - 'edp' + - 'sonmp' + - 'cdp' + address: 192.0.2.14 state: replaced - register: result + register: result - - name: Assert that correct set of commands were generated - assert: + - 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: + - name: Assert that before dicts are correctly generated + assert: that: - - "{{ populate == result['before'] }}" + - "{{ populate == result['before'] }}" - - name: Assert that after dict is correctly generated - assert: + - name: Assert that after dict is correctly generated + assert: that: - - "{{ replaced['after'] == result['after'] }}" + - "{{ replaced['after'] == result['after'] }}" - - name: Replace device configurations of LLDP service with provided configurarions (IDEMPOTENT) - vyos.vyos.vyos_lldp_global: *replaced - register: result + - name: Replace device configurations of LLDP service with provided configurarions (IDEMPOTENT) + vyos.vyos.vyos_lldp_global: *replaced + register: result - - name: Assert that task was idempotent - assert: + - name: Assert that task was idempotent + assert: that: - - "result['changed'] == false" + - "result['changed'] == false" - - name: Assert that before dict is correctly generated - assert: + - name: Assert that before dict is correctly generated + assert: that: - - "{{ replaced['after'] == result['before'] }}" + - "{{ replaced['after'] == result['before'] }}" always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lldp_global/tests/cli/rtt.yaml b/tests/integration/targets/vyos_lldp_global/tests/cli/rtt.yaml index 4f8ca9c..02902bc 100644 --- a/tests/integration/targets/vyos_lldp_global/tests/cli/rtt.yaml +++ b/tests/integration/targets/vyos_lldp_global/tests/cli/rtt.yaml @@ -5,47 +5,47 @@ - include_tasks: _remove_config.yaml - block: - - name: Apply the provided configuration (base config) - vyos.vyos.vyos_lldp_global: - config: - legacy_protocols: - - 'fdp' - - 'cdp' - address: 192.0.2.11 - state: merged - register: base_config - - - name: Gather vyos_lldp_global facts - vyos.vyos.vyos_facts: - gather_subset: - - default - gather_network_resources: - - lldp_global - - - name: Apply the provided configuration (config to be reverted) - vyos.vyos.vyos_lldp_global: - config: - legacy_protocols: - - 'edp' - - 'sonmp' - - 'cdp' - address: 192.0.2.14 - state: merged - register: result - - - name: Assert that changes were applied - assert: - that: "{{ round_trip['after'] == result['after'] }}" - - - name: Revert back to base config using facts round trip - vyos.vyos.vyos_lldp_global: - config: "{{ ansible_facts['network_resources']['lldp_global'] }}" - state: replaced - register: revert - - - name: Assert that config was reverted - assert: - that: "{{ base_config['after'] == revert['after'] }}" + - name: Apply the provided configuration (base config) + vyos.vyos.vyos_lldp_global: + config: + legacy_protocols: + - 'fdp' + - 'cdp' + address: 192.0.2.11 + state: merged + register: base_config + + - name: Gather vyos_lldp_global facts + vyos.vyos.vyos_facts: + gather_subset: + - default + gather_network_resources: + - lldp_global + + - name: Apply the provided configuration (config to be reverted) + vyos.vyos.vyos_lldp_global: + config: + legacy_protocols: + - 'edp' + - 'sonmp' + - 'cdp' + address: 192.0.2.14 + state: merged + register: result + + - name: Assert that changes were applied + assert: + that: "{{ round_trip['after'] == result['after'] }}" + + - name: Revert back to base config using facts round trip + vyos.vyos.vyos_lldp_global: + config: "{{ ansible_facts['network_resources']['lldp_global'] }}" + state: replaced + register: revert + + - name: Assert that config was reverted + assert: + that: "{{ base_config['after'] == revert['after'] }}" always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lldp_global/vars/main.yaml b/tests/integration/targets/vyos_lldp_global/vars/main.yaml index f091f2c..420b2b4 100644 --- a/tests/integration/targets/vyos_lldp_global/vars/main.yaml +++ b/tests/integration/targets/vyos_lldp_global/vars/main.yaml @@ -4,7 +4,7 @@ merged: address: '192.0.2.17' enable: true legacy_protocols: - - 'cdp' + - 'cdp' commands: - "set service lldp management-address '192.0.2.11'" diff --git a/tests/integration/targets/vyos_lldp_interface/tasks/main.yaml b/tests/integration/targets/vyos_lldp_interface/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_lldp_interface/tasks/main.yaml +++ b/tests/integration/targets/vyos_lldp_interface/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_lldp_interface/tests/cli/basic.yaml b/tests/integration/targets/vyos_lldp_interface/tests/cli/basic.yaml index e91091b..0690e9e 100644 --- a/tests/integration/targets/vyos_lldp_interface/tests/cli/basic.yaml +++ b/tests/integration/targets/vyos_lldp_interface/tests/cli/basic.yaml @@ -92,8 +92,8 @@ - name: Create aggregate of LLDP interface configurations vyos.vyos.vyos_lldp_interface: aggregate: - - name: eth1 - - name: eth2 + - name: eth1 + - name: eth2 state: present register: result @@ -106,8 +106,8 @@ - name: Create aggregate of LLDP interface configurations again (idempotent) vyos.vyos.vyos_lldp_interface: aggregate: - - name: eth1 - - name: eth2 + - name: eth1 + - name: eth2 state: present register: result @@ -118,8 +118,8 @@ - name: Override LLDP interface configuration on aggregate vyos.vyos.vyos_lldp_interface: aggregate: - - name: eth1 - - { name: eth2, state: disabled } + - name: eth1 + - {name: eth2, state: disabled} state: present register: result @@ -131,8 +131,8 @@ - name: Override LLDP interface configuration on aggregate again (idempotent) vyos.vyos.vyos_lldp_interface: aggregate: - - name: eth1 - - { name: eth2, state: disabled } + - name: eth1 + - {name: eth2, state: disabled} state: present register: result @@ -143,8 +143,8 @@ - name: Delete aggregate of LLDP interface configurations vyos.vyos.vyos_lldp_interface: aggregate: - - name: eth1 - - name: eth2 + - name: eth1 + - name: eth2 state: absent register: result @@ -157,8 +157,8 @@ - name: Delete aggregate of LLDP interface configurations (idempotent) vyos.vyos.vyos_lldp_interface: aggregate: - - name: eth1 - - name: eth2 + - name: eth1 + - name: eth2 state: absent register: result diff --git a/tests/integration/targets/vyos_lldp_interfaces/meta/main.yaml b/tests/integration/targets/vyos_lldp_interfaces/meta/main.yaml index f88bce5..7413320 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/meta/main.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/meta/main.yaml @@ -1,2 +1,3 @@ +--- dependencies: - prepare_vyos_tests diff --git a/tests/integration/targets/vyos_lldp_interfaces/tasks/main.yaml b/tests/integration/targets/vyos_lldp_interfaces/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tasks/main.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_remove_config.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_remove_config.yaml index e3abbdb..d012f7b 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_remove_config.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/_remove_config.yaml @@ -5,4 +5,4 @@ vars: lines: | delete service lldp interface - delete service lldp + delete service lldp diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/deleted.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/deleted.yaml index bd7c713..7b2d53a 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/deleted.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/deleted.yaml @@ -5,42 +5,42 @@ - include_tasks: _populate.yaml - block: - - name: Delete attributes of given LLDP interfaces. - vyos.vyos.vyos_lldp_interfaces: &deleted - config: - - name: 'eth1' - - name: 'eth2' - state: deleted - register: result - - - name: Assert that the before dicts were correctly generated - assert: - that: - - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" - - - name: Assert that the correct set of commands were generated - assert: - that: - - "{{ 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 }}" - - - name: Delete attributes of given interfaces (IDEMPOTENT) - vyos.vyos.vyos_lldp_interfaces: *deleted - register: result - - - name: Assert that the previous task was idempotent - assert: - that: - - "result.changed == false" - - "result.commands|length == 0" - - - name: Assert that the before dicts were correctly generated - assert: - that: - - "{{ deleted['after'] | symmetric_difference(result['before']) |length == 0 }}" + - name: Delete attributes of given LLDP interfaces. + vyos.vyos.vyos_lldp_interfaces: &deleted + config: + - name: 'eth1' + - name: 'eth2' + state: deleted + register: result + + - name: Assert that the before dicts were correctly generated + assert: + that: + - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" + + - name: Assert that the correct set of commands were generated + assert: + that: + - "{{ 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 }}" + + - name: Delete attributes of given interfaces (IDEMPOTENT) + vyos.vyos.vyos_lldp_interfaces: *deleted + register: result + + - name: Assert that the previous task was idempotent + assert: + that: + - "result.changed == false" + - "result.commands|length == 0" + + - name: Assert that the before dicts were correctly generated + assert: + that: + - "{{ deleted['after'] | symmetric_difference(result['before']) |length == 0 }}" always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/empty_config.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/empty_config.yaml index 4afb7fe..44c0b89 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/empty_config.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/empty_config.yaml @@ -1,13 +1,13 @@ --- - debug: - msg: "START vyos_lldp_interfaces empty_config integration tests on connection={{ ansible_connection }}" + msg: "START vyos_lldp_interfaces empty_config integration tests on connection={{ ansible_connection }}" - name: Merged with empty config should give appropriate error message vyos.vyos.vyos_lldp_interfaces: config: state: merged register: result - ignore_errors: True + ignore_errors: true - assert: that: @@ -18,7 +18,7 @@ config: state: replaced register: result - ignore_errors: True + ignore_errors: true - assert: that: @@ -29,7 +29,7 @@ config: state: overridden register: result - ignore_errors: True + ignore_errors: true - assert: that: diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/merged.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/merged.yaml index ae5b10b..bf968b2 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/merged.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/merged.yaml @@ -1,58 +1,58 @@ --- - debug: - msg: "START vyos_lldp_interfaces merged integration tests on connection={{ ansible_connection }}" + msg: "START vyos_lldp_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_lldp_interfaces: &merged + - name: Merge the provided configuration with the exisiting running configuration + vyos.vyos.vyos_lldp_interfaces: &merged config: - - name: 'eth1' - location: - civic_based: - country_code: 'US' - ca_info: - - ca_type: 0 - ca_value: 'ENGLISH' - - - name: 'eth2' - location: - coordinate_based: - altitude: 2200 + - name: 'eth1' + location: + civic_based: + country_code: 'US' + ca_info: + - ca_type: 0 + ca_value: 'ENGLISH' + + - name: 'eth2' + location: + coordinate_based: + altitude: 2200 datum: 'WGS84' longitude: '222.267255W' - latitude: '33.524449N' + latitude: '33.524449N' state: merged - register: result + register: result - - name: Assert that before dicts were correctly generated - assert: + - name: Assert that before dicts were correctly generated + assert: that: "{{ merged['before'] | symmetric_difference(result['before']) |length == 0 }}" - - name: Assert that correct set of commands were generated - assert: + - 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: + - 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_lldp_interfaces: *merged - register: result + - name: Merge the provided configuration with the existing running configuration (IDEMPOTENT) + vyos.vyos.vyos_lldp_interfaces: *merged + register: result - - name: Assert that the previous task was idempotent - assert: + - 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: + - 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 + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/overridden.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/overridden.yaml index eedb563..8cf038c 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/overridden.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/overridden.yaml @@ -1,49 +1,49 @@ --- - debug: - msg: "START vyos_lldp_interfaces overridden integration tests on connection={{ ansible_connection }}" + msg: "START vyos_lldp_interfaces overridden integration tests on connection={{ ansible_connection }}" - include_tasks: _remove_config.yaml - include_tasks: _populate_intf.yaml - block: - - name: Overrides all device configuration with provided configuration - vyos.vyos.vyos_lldp_interfaces: &overridden - config: - - name: 'eth2' - location: - elin: '0000000911' - state: overridden - register: result - - - name: Assert that before dicts were correctly generated - assert: + - name: Overrides all device configuration with provided configuration + vyos.vyos.vyos_lldp_interfaces: &overridden + config: + - name: 'eth2' + location: + elin: '0000000911' + state: overridden + register: result + + - name: Assert that before dicts were correctly generated + assert: that: - - "{{ populate_intf | symmetric_difference(result['before']) |length == 0 }}" + - "{{ populate_intf | symmetric_difference(result['before']) |length == 0 }}" - - name: Assert that correct commands were generated - assert: + - 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: + - 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_lldp_interfaces: *overridden - register: result + - name: Overrides all device configuration with provided configurations (IDEMPOTENT) + vyos.vyos.vyos_lldp_interfaces: *overridden + register: result - - name: Assert that the previous task was idempotent - assert: + - 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: + - 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 + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/replaced.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/replaced.yaml index 07fec9e..17acf06 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/replaced.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/replaced.yaml @@ -1,63 +1,63 @@ --- - debug: - msg: "START vyos_lldp_interfaces replaced integration tests on connection={{ ansible_connection }}" + msg: "START vyos_lldp_interfaces replaced integration tests on connection={{ ansible_connection }}" - include_tasks: _remove_config.yaml - include_tasks: _populate.yaml - block: - - name: Replace device configurations of listed LLDP interfaces with provided configurations - vyos.vyos.vyos_lldp_interfaces: &replaced + - name: Replace device configurations of listed LLDP interfaces with provided configurations + vyos.vyos.vyos_lldp_interfaces: &replaced config: - - name: 'eth2' - enable: false - location: - civic_based: - country_code: 'US' - ca_info: - - ca_type: 0 - ca_value: 'ENGLISH' - - - name: 'eth1' - enable: false - location: - coordinate_based: - altitude: 2200 + - name: 'eth2' + enable: false + location: + civic_based: + country_code: 'US' + ca_info: + - ca_type: 0 + ca_value: 'ENGLISH' + + - name: 'eth1' + enable: false + location: + coordinate_based: + altitude: 2200 datum: 'WGS84' longitude: '222.267255W' latitude: '33.524449N' state: replaced - register: result + register: result - - name: Assert that correct set of commands were generated - assert: + - 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: + - name: Assert that before dicts are correctly generated + assert: that: - - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" + - "{{ populate | symmetric_difference(result['before']) |length == 0 }}" - - name: Assert that after dict is correctly generated - assert: + - 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 LLDP interfaces with provided configurarions (IDEMPOTENT) - vyos.vyos.vyos_lldp_interfaces: *replaced - register: result + - name: Replace device configurations of listed LLDP interfaces with provided configurarions (IDEMPOTENT) + vyos.vyos.vyos_lldp_interfaces: *replaced + register: result - - name: Assert that task was idempotent - assert: + - name: Assert that task was idempotent + assert: that: - - "result['changed'] == false" + - "result['changed'] == false" - - name: Assert that before dict is correctly generated - assert: + - 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 + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rtt.yaml b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rtt.yaml index d97cf9c..4d4cf82 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rtt.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/tests/cli/rtt.yaml @@ -5,53 +5,53 @@ - include_tasks: _remove_config.yaml - block: - - name: Apply the provided configuration (base config) - vyos.vyos.vyos_lldp_interfaces: - config: - - name: 'eth1' - location: - civic_based: - country_code: 'US' - ca_info: - - ca_type: 0 - ca_value: 'ENGLISH' - - state: merged - register: base_config - - - name: Gather lldp_interfaces facts - vyos.vyos.vyos_facts: - gather_subset: - - default - gather_network_resources: - - lldp_interfaces - - - name: Apply the provided configuration (config to be reverted) - vyos.vyos.vyos_lldp_interfaces: - config: - - name: 'eth2' - location: - coordinate_based: - altitude: 2200 - datum: 'WGS84' - longitude: '222.267255W' - latitude: '33.524449N' - state: merged - register: result - - - name: Assert that changes were applied - assert: - that: "{{ round_trip['after'] | symmetric_difference(result['after']) |length == 0 }}" - - - name: Revert back to base config using facts round trip - vyos.vyos.vyos_lldp_interfaces: - config: "{{ ansible_facts['network_resources']['lldp_interfaces'] }}" - state: overridden - register: revert - - - name: Assert that config was reverted - assert: - that: "{{ base_config['after'] | symmetric_difference(revert['after']) |length == 0 }}" + - name: Apply the provided configuration (base config) + vyos.vyos.vyos_lldp_interfaces: + config: + - name: 'eth1' + location: + civic_based: + country_code: 'US' + ca_info: + - ca_type: 0 + ca_value: 'ENGLISH' + + state: merged + register: base_config + + - name: Gather lldp_interfaces facts + vyos.vyos.vyos_facts: + gather_subset: + - default + gather_network_resources: + - lldp_interfaces + + - name: Apply the provided configuration (config to be reverted) + vyos.vyos.vyos_lldp_interfaces: + config: + - name: 'eth2' + location: + coordinate_based: + altitude: 2200 + datum: 'WGS84' + longitude: '222.267255W' + latitude: '33.524449N' + state: merged + register: result + + - name: Assert that changes were applied + assert: + that: "{{ round_trip['after'] | symmetric_difference(result['after']) |length == 0 }}" + + - name: Revert back to base config using facts round trip + vyos.vyos.vyos_lldp_interfaces: + config: "{{ ansible_facts['network_resources']['lldp_interfaces'] }}" + state: overridden + register: revert + + - name: Assert that config was reverted + assert: + that: "{{ base_config['after'] | symmetric_difference(revert['after']) |length == 0 }}" always: - - include_tasks: _remove_config.yaml + - include_tasks: _remove_config.yaml diff --git a/tests/integration/targets/vyos_lldp_interfaces/vars/main.yaml b/tests/integration/targets/vyos_lldp_interfaces/vars/main.yaml index 6f33343..169b0d5 100644 --- a/tests/integration/targets/vyos_lldp_interfaces/vars/main.yaml +++ b/tests/integration/targets/vyos_lldp_interfaces/vars/main.yaml @@ -20,36 +20,36 @@ merged: after: - name: 'eth1' location: - civic_based: - country_code: 'US' + civic_based: + country_code: 'US' ca_info: - - ca_type: 0 - ca_value: 'ENGLISH' + - ca_type: 0 + ca_value: 'ENGLISH' - name: 'eth2' location: - coordinate_based: - altitude: 2200 - datum: 'WGS84' - longitude: '222.267255W' - latitude: '33.524449N' + coordinate_based: + altitude: 2200 + datum: 'WGS84' + longitude: '222.267255W' + latitude: '33.524449N' populate: - name: 'eth1' location: - civic_based: - country_code: 'US' + civic_based: + country_code: 'US' ca_info: - - ca_type: 0 - ca_value: 'ENGLISH' + - ca_type: 0 + ca_value: 'ENGLISH' - name: 'eth2' location: - coordinate_based: - altitude: 2200 - datum: 'WGS84' - longitude: '222.267255W' - latitude: '33.524449N' + coordinate_based: + altitude: 2200 + datum: 'WGS84' + longitude: '222.267255W' + latitude: '33.524449N' replaced: commands: @@ -68,35 +68,35 @@ replaced: - name: 'eth2' enable: false location: - civic_based: - country_code: 'US' + civic_based: + country_code: 'US' ca_info: - - ca_type: 0 - ca_value: 'ENGLISH' + - ca_type: 0 + ca_value: 'ENGLISH' - name: 'eth1' enable: false location: - coordinate_based: - altitude: 2200 - datum: 'WGS84' - longitude: '222.267255W' - latitude: '33.524449N' + coordinate_based: + altitude: 2200 + datum: 'WGS84' + longitude: '222.267255W' + latitude: '33.524449N' populate_intf: - name: 'eth2' enable: false location: - civic_based: - country_code: 'US' + civic_based: + country_code: 'US' ca_info: - - ca_type: 0 - ca_value: 'ENGLISH' + - ca_type: 0 + ca_value: 'ENGLISH' overridden: commands: - - "delete service lldp interface eth2 location" - - "delete service lldp interface eth2 'disable'" + - "delete service lldp interface eth2 location" + - "delete service lldp interface eth2 'disable'" - "set service lldp interface eth2 location elin '0000000911'" after: @@ -115,16 +115,16 @@ round_trip: after: - name: 'eth1' location: - civic_based: - country_code: 'US' + civic_based: + country_code: 'US' ca_info: - - ca_type: 0 + - ca_type: 0 ca_value: 'ENGLISH' - name: 'eth2' location: - coordinate_based: - altitude: 2200 - datum: 'WGS84' - longitude: '222.267255W' - latitude: '33.524449N' + coordinate_based: + altitude: 2200 + datum: 'WGS84' + longitude: '222.267255W' + latitude: '33.524449N' diff --git a/tests/integration/targets/vyos_logging/tasks/main.yaml b/tests/integration/targets/vyos_logging/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_logging/tasks/main.yaml +++ b/tests/integration/targets/vyos_logging/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_logging/tests/cli/basic.yaml b/tests/integration/targets/vyos_logging/tests/cli/basic.yaml index 144f8d3..d588456 100644 --- a/tests/integration/targets/vyos_logging/tests/cli/basic.yaml +++ b/tests/integration/targets/vyos_logging/tests/cli/basic.yaml @@ -83,8 +83,8 @@ - name: Add logging collections vyos.vyos.vyos_logging: aggregate: - - { dest: file, name: test1, facility: all, level: info } - - { dest: file, name: test2, facility: news, level: debug } + - {dest: file, name: test1, facility: all, level: info} + - {dest: file, name: test2, facility: news, level: debug} state: present register: result @@ -97,9 +97,9 @@ - name: Add and remove logging collections with overrides vyos.vyos.vyos_logging: aggregate: - - { dest: console, facility: all, level: info } - - { dest: file, name: test1, facility: all, level: info, state: absent } - - { dest: console, facility: daemon, level: warning } + - {dest: console, facility: all, level: info} + - {dest: file, name: test1, facility: all, level: info, state: absent} + - {dest: console, facility: daemon, level: warning} state: present register: result @@ -112,9 +112,9 @@ - name: Remove logging collections vyos.vyos.vyos_logging: aggregate: - - { dest: console, facility: all, level: info } - - { dest: console, facility: daemon, level: warning } - - { dest: file, name: test2, facility: news, level: debug } + - {dest: console, facility: all, level: info} + - {dest: console, facility: daemon, level: warning} + - {dest: file, name: test2, facility: news, level: debug} state: absent register: result diff --git a/tests/integration/targets/vyos_smoke/tasks/main.yaml b/tests/integration/targets/vyos_smoke/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_smoke/tasks/main.yaml +++ b/tests/integration/targets/vyos_smoke/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_smoke/tests/cli/common_config.yaml b/tests/integration/targets/vyos_smoke/tests/cli/common_config.yaml index 1c07980..cfac254 100644 --- a/tests/integration/targets/vyos_smoke/tests/cli/common_config.yaml +++ b/tests/integration/targets/vyos_smoke/tests/cli/common_config.yaml @@ -1,3 +1,4 @@ +--- # vyos.py in plugins and module_utils/network covered by these as well # hit NetworkConfig - name: configure simple config command diff --git a/tests/integration/targets/vyos_smoke/tests/cli/common_utils.yaml b/tests/integration/targets/vyos_smoke/tests/cli/common_utils.yaml index db837c5..fb80c93 100644 --- a/tests/integration/targets/vyos_smoke/tests/cli/common_utils.yaml +++ b/tests/integration/targets/vyos_smoke/tests/cli/common_utils.yaml @@ -1,3 +1,4 @@ +--- # vyos.py in plugins and module_utils/network covered by these as well # remove_default_spec() hit by multiple plays @@ -20,7 +21,7 @@ - name: enable eth1 vyos.vyos.vyos_interface: name: eth1 - enabled: True + enabled: true state: present register: result @@ -34,7 +35,7 @@ vyos.vyos.vyos_interface: name: eth1 state: down - ignore_errors: yes + ignore_errors: true register: result - assert: @@ -45,5 +46,5 @@ - name: Config + intent vyos.vyos.vyos_interface: name: eth1 - enabled: False + enabled: false state: down diff --git a/tests/integration/targets/vyos_smoke/tests/cli/misc_tests.yaml b/tests/integration/targets/vyos_smoke/tests/cli/misc_tests.yaml index 720f95e..456effc 100644 --- a/tests/integration/targets/vyos_smoke/tests/cli/misc_tests.yaml +++ b/tests/integration/targets/vyos_smoke/tests/cli/misc_tests.yaml @@ -1,8 +1,9 @@ +--- # hit check conditional in module_utils.network.vyos -> load_config() - name: configure simple config command vyos.vyos.vyos_config: lines: set system host-name check-test - check_mode: yes + check_mode: true - name: get host name vyos.vyos.vyos_command: diff --git a/tests/integration/targets/vyos_static_route/tasks/main.yaml b/tests/integration/targets/vyos_static_route/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_static_route/tasks/main.yaml +++ b/tests/integration/targets/vyos_static_route/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_static_route/tests/cli/basic.yaml b/tests/integration/targets/vyos_static_route/tests/cli/basic.yaml index 122e49a..4b1ef1c 100644 --- a/tests/integration/targets/vyos_static_route/tests/cli/basic.yaml +++ b/tests/integration/targets/vyos_static_route/tests/cli/basic.yaml @@ -79,8 +79,8 @@ - name: Add static route collections vyos.vyos.vyos_static_route: aggregate: - - { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 } - - { prefix: 172.24.2.0, mask: 24, next_hop: 192.168.42.64 } + - {prefix: 172.24.1.0/24, next_hop: 192.168.42.64} + - {prefix: 172.24.2.0, mask: 24, next_hop: 192.168.42.64} state: present register: result @@ -93,9 +93,9 @@ - name: Add and remove static route collections with overrides vyos.vyos.vyos_static_route: aggregate: - - { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 } - - { prefix: 172.24.2.0/24, next_hop: 192.168.42.64, state: absent } - - { prefix: 172.24.3.0/24, next_hop: 192.168.42.64 } + - {prefix: 172.24.1.0/24, next_hop: 192.168.42.64} + - {prefix: 172.24.2.0/24, next_hop: 192.168.42.64, state: absent} + - {prefix: 172.24.3.0/24, next_hop: 192.168.42.64} state: present register: result @@ -108,8 +108,8 @@ - name: Remove static route collections vyos.vyos.vyos_static_route: aggregate: - - { prefix: 172.24.1.0/24, next_hop: 192.168.42.64 } - - { prefix: 172.24.3.0/24, next_hop: 192.168.42.64 } + - {prefix: 172.24.1.0/24, next_hop: 192.168.42.64} + - {prefix: 172.24.3.0/24, next_hop: 192.168.42.64} state: absent register: result diff --git a/tests/integration/targets/vyos_system/tasks/main.yaml b/tests/integration/targets/vyos_system/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_system/tasks/main.yaml +++ b/tests/integration/targets/vyos_system/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_user/tasks/main.yaml b/tests/integration/targets/vyos_user/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_user/tasks/main.yaml +++ b/tests/integration/targets/vyos_user/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_user/tests/cli/auth.yaml b/tests/integration/targets/vyos_user/tests/cli/auth.yaml index 566191e..bbd67bc 100644 --- a/tests/integration/targets/vyos_user/tests/cli/auth.yaml +++ b/tests/integration/targets/vyos_user/tests/cli/auth.yaml @@ -18,7 +18,7 @@ command: "ssh auth_user@{{ ansible_ssh_host }} -p {{ ansible_port | default(22) }} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no '/opt/vyatta/sbin/vyatta-cfg-cmd-wrapper show version'" responses: (?i)password: "badpass" - ignore_errors: yes + ignore_errors: true register: results - name: check that attempt failed @@ -27,8 +27,8 @@ - results.failed always: - - name: delete user - vyos.vyos.vyos_user: - name: auth_user - state: absent - register: result + - name: delete user + vyos.vyos.vyos_user: + name: auth_user + state: absent + register: result diff --git a/tests/integration/targets/vyos_vlan/tasks/main.yaml b/tests/integration/targets/vyos_vlan/tasks/main.yaml index 415c99d..d4cf26f 100644 --- a/tests/integration/targets/vyos_vlan/tasks/main.yaml +++ b/tests/integration/targets/vyos_vlan/tasks/main.yaml @@ -1,2 +1,2 @@ --- -- { include: cli.yaml, tags: ['cli'] } +- {include: cli.yaml, tags: ['cli']} diff --git a/tests/integration/targets/vyos_vlan/tests/cli/basic.yaml b/tests/integration/targets/vyos_vlan/tests/cli/basic.yaml index 6e4417e..cb0f348 100644 --- a/tests/integration/targets/vyos_vlan/tests/cli/basic.yaml +++ b/tests/integration/targets/vyos_vlan/tests/cli/basic.yaml @@ -73,8 +73,8 @@ - name: Create VLANs using aggregate vyos.vyos.vyos_vlan: &agg_vlan aggregate: - - { vlan_id: 101, name: voice, interfaces: "eth0" } - - { vlan_id: 201, name: mgm, interfaces: "eth1" } + - {vlan_id: 101, name: voice, interfaces: "eth0"} + - {vlan_id: 201, name: mgm, interfaces: "eth1"} state: present register: result diff --git a/tests/integration/targets/vyos_vlan/tests/cli/intent.yaml b/tests/integration/targets/vyos_vlan/tests/cli/intent.yaml index 7c78937..4a12317 100644 --- a/tests/integration/targets/vyos_vlan/tests/cli/intent.yaml +++ b/tests/integration/targets/vyos_vlan/tests/cli/intent.yaml @@ -35,8 +35,8 @@ vlan_id: 100 interfaces: eth0 associated_interfaces: - - eth0 - - eth1 + - eth0 + - eth1 register: result - assert: @@ -47,10 +47,10 @@ vyos.vyos.vyos_vlan: vlan_id: 100 associated_interfaces: - - eth3 - - eth4 + - eth3 + - eth4 register: result - ignore_errors: yes + ignore_errors: true - assert: that: |