From 57415688cede2614b1cb0987f90da7c503106886 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Wed, 15 Jan 2020 15:05:50 +0000 Subject: [PATCH] Remove ansible-lint path exclusions Fixes several rules with test-playbooks and remove path exclusions. Since we introduced the progressive mode, exclusions are no longer needed and not haivng them will assure newly added code follows the same guidelines. Change-Id: I0a72d34aff8cf23172e26c7f44e0f61571ec74b6 --- .ansible-lint | 2 -- test-playbooks/dhall/test-dhall-diff.yaml | 4 ++-- test-playbooks/multinode/multi-node-known-hosts.yaml | 6 +++--- test-playbooks/multinode/persistent-firewall.yaml | 5 ++++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index fdb864a18..7e6ec25ac 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -1,5 +1,3 @@ -exclude_paths: - - test-playbooks/ # TODO(ssbarnea): remove skip in follow-up parseable: true quiet: false skip_list: diff --git a/test-playbooks/dhall/test-dhall-diff.yaml b/test-playbooks/dhall/test-dhall-diff.yaml index 651303f2a..b52b04382 100644 --- a/test-playbooks/dhall/test-dhall-diff.yaml +++ b/test-playbooks/dhall/test-dhall-diff.yaml @@ -7,7 +7,7 @@ - name: Ensure dhall-diff succeeded assert: that: - - render_diff.stdout == '' + - render_diff.stdout | length == 0 - name: Introduce a difference copy: @@ -29,4 +29,4 @@ - name: Ensure dhall-diff failed assert: that: - - render_diff.stdout != '' + - render_diff.stdout | length > 0 diff --git a/test-playbooks/multinode/multi-node-known-hosts.yaml b/test-playbooks/multinode/multi-node-known-hosts.yaml index 17cde4f8c..197bdffc2 100644 --- a/test-playbooks/multinode/multi-node-known-hosts.yaml +++ b/test-playbooks/multinode/multi-node-known-hosts.yaml @@ -12,13 +12,13 @@ host_addresses: > {% set hosts = [] -%} {% for host, vars in hostvars.items() -%} - {% if vars['nodepool']['private_ipv4'] != '' -%} + {% if vars['nodepool']['private_ipv4'] | length > 0 -%} {% set _ = hosts.append(vars['nodepool']['private_ipv4']) -%} {% endif -%} - {% if vars['nodepool']['public_ipv4'] != '' -%} + {% if vars['nodepool']['public_ipv4'] | length > 0 -%} {% set _ = hosts.append(vars['nodepool']['public_ipv4']) -%} {% endif -%} - {% if vars['nodepool']['public_ipv6'] != '' -%} + {% if vars['nodepool']['public_ipv6'] | length > 0 -%} {% set _ = hosts.append(vars['nodepool']['public_ipv6']) -%} {% endif -%} {% endfor -%} diff --git a/test-playbooks/multinode/persistent-firewall.yaml b/test-playbooks/multinode/persistent-firewall.yaml index cee6009f4..1729f7f8a 100644 --- a/test-playbooks/multinode/persistent-firewall.yaml +++ b/test-playbooks/multinode/persistent-firewall.yaml @@ -44,7 +44,10 @@ - name: Restore iptables become: yes command: "/etc/init.d/boot.local" - when: ansible_os_family == "Suse" and iptables_service is not defined and boot_local_file.stat.exists == True + when: + - ansible_os_family == "Suse" + - iptables_service is not defined + - boot_local_file.stat.exists - name: switch and peer nodes should be in the ipv4 firewall become: yes