Skip to content

Commit

Permalink
Pass ansible-lint check
Browse files Browse the repository at this point in the history
  • Loading branch information
atosatto committed Nov 9, 2019
1 parent 0e1eda6 commit 26c4617
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
17 changes: 10 additions & 7 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
extends: default

rules:

# Disable line-length and truthy values reporting
line-length: disable
truthy: disable

# Max 1 space to separate the elements in brakets
braces:
max-spaces-inside: 1
level: error

# Max 1 space in empty brackets
brackets:
max-spaces-inside: 1
level: error
line-length: disable
# NOTE(retr0h): Templates no longer fail this lint rule.
# Uncomment if running old Molecule templates.
# truthy: disable
min-spaces-inside-empty: 0
max-spaces-inside-empty: 1
2 changes: 0 additions & 2 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,5 @@ galaxy_info:
galaxy_tags:
- docker
- swarm
- docker-swarm
- docker-cluster

dependencies: []
2 changes: 1 addition & 1 deletion tasks/docker_engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
_docker_package_version: "-{{ docker_package_version }}"
when: ansible_os_family == 'Debian'

when: docker_package_version != ''
when: docker_package_version | length > 0

- name: Install Docker.
package:
Expand Down
4 changes: 2 additions & 2 deletions tasks/docker_group.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
- name: Reset ansible connection after group changes (Ansible >= 2.3.0).
include: reset_connection.yml
static: false # we need to force dynamic inclusion here to avoid 'reset_connection' to be
# always executed even if the when condition evaluates to false on Ansible 2.4.x
# or to generate syntax errors on Ansible < 2.3
# always executed even if the when condition evaluates to false on Ansible 2.4.x
# or to generate syntax errors on Ansible < 2.3
when: ansible_version is defined
and (ansible_version.full is version_compare('2.3.0.0', '>='))

Expand Down
2 changes: 1 addition & 1 deletion tasks/swarm_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

- name: Distribute the fact containing address of the first Swarm manager.
set_fact:
docker_manager_address: "{{hostvars[groups['docker_swarm_manager'][0]]['docker_manager_address'] }}"
docker_manager_address: "{{ hostvars[groups['docker_swarm_manager'][0]]['docker_manager_address'] }}"
when: "inventory_hostname != groups['docker_swarm_manager'][0]"

- name: Join the pending Swarm worker nodes.
Expand Down
2 changes: 1 addition & 1 deletion tasks/swarm_labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: Get list of labels.
command: >-
docker inspect
--format {% raw %}'{{range $key, $value := .Spec.Labels}}{{printf "%s\n" $key}}{{end}}'{% endraw %}
--format {% raw %}'{{ range $key, $value := .Spec.Labels }}{{ printf "%s\n" $key }}{{ end }}'{% endraw %}
{{ ansible_hostname }}
register: docker_swarm_labels
changed_when: false
Expand Down

0 comments on commit 26c4617

Please sign in to comment.