Make all lines less than 160 characters long

With the arrival of ansible-lint 4, strings greater than 160
characters in length are now forbidden. Adjust the new violations
accordingly and remove the rule 204 exclusion.

Change-Id: Ie483be624d22da10aa25478327af8ba3fe4f2344
This commit is contained in:
Jeremy Stanley 2019-06-26 16:16:40 +00:00 committed by Sorin Sbarnea
parent a0b390936f
commit 832cf27197
6 changed files with 15 additions and 8 deletions

View File

@ -19,7 +19,8 @@
add_host:
name: "{{ fileserver.fqdn }}"
ansible_user: "{{ fileserver.ssh_username|default(ansible_user) }}"
zuul_fileserver_project_path: "{{ fileserver.path }}{{ '/' + fileserver_leading_path if fileserver_leading_path is defined else ''}}/{{ zuul.project.short_name }}"
zuul_fileserver_project_path:
"{{ fileserver.path }}{{ '/' + fileserver_leading_path if fileserver_leading_path is defined else ''}}/{{ zuul.project.short_name }}"
- name: Add fileserver server to known hosts
known_hosts:

View File

@ -3,4 +3,6 @@
no_log: True
- name: Import role into Ansible Galaxy
command: "{{ ansible_galaxy_executable }} -s {{ ansible_galaxy_server }} import --branch {{ ansible_galaxy_branch }} {{ zuul.project['name'].split('/')[0] }} {{ zuul.project['short_name'] }}"
command: >
{{ ansible_galaxy_executable }} -s {{ ansible_galaxy_server }} import --branch {{ ansible_galaxy_branch }}
{{ zuul.project['name'].split('/')[0] }} {{ zuul.project['short_name'] }}

View File

@ -7,7 +7,9 @@
with_dict: "{{ zuul.projects }}"
- name: Synchronize src repos to workspace directory
command: "git push {% if mirror_workspace_quiet %}--quiet{% endif %} --mirror git+ssh://{{ ansible_user }}@{{ ansible_host | ipwrap }}:{{ ansible_port }}/{{ ansible_user_dir }}/{{ item.value.src_dir}}"
command: >
git push {% if mirror_workspace_quiet %}--quiet{% endif %}
--mirror git+ssh://{{ ansible_user }}@{{ ansible_host | ipwrap }}:{{ ansible_port }}/{{ ansible_user_dir }}/{{ item.value.src_dir}}
args:
chdir: "{{ zuul.executor.work_root }}/{{ item.value.src_dir }}"
with_dict: "{{ zuul.projects }}"

View File

@ -32,7 +32,9 @@
- name: Set source and destination for files and folders
set_fact:
source: "{{ item.stat.path }}"
dest: "{{ item.item.value.split('_')[0] }}/{{ item.stat.path|basename|regex_replace('^(\\..*)$', '_\\1') }}{% if item.item.value.endswith('_txt') %}.txt{% endif %}"
dest: >-
{{ item.item.value.split('_')[0] }}/{{ item.stat.path|basename|regex_replace('^(\\..*)$', '_\\1') -}}
{% if item.item.value.endswith('_txt') %}.txt{% endif %}
type: "{{ item.item.value.split('_')[0] }}"
with_items: "{{ sources.results }}"
when:

View File

@ -66,7 +66,8 @@
- name: Add registry to docker daemon configuration
vars:
new_config:
registry-mirrors: "['https://{{ buildset_registry_alias }}:{{ buildset_registry.port}}/', 'https://{{ buildset_registry_alias }}:{{ buildset_registry.proxy_port}}/']"
registry-mirrors:
"['https://{{ buildset_registry_alias }}:{{ buildset_registry.port}}/', 'https://{{ buildset_registry_alias }}:{{ buildset_registry.proxy_port}}/']"
set_fact:
docker_config: "{{ docker_config | combine(new_config) }}"
- name: Save docker daemon configuration

View File

@ -42,12 +42,11 @@ commands =
flake8 {posargs}
# Ansible lint
# [ANSIBLE0012] Commands should not change things if nothing needs doing
# [204] Lines should be no longer than 160 chars
# [206] Variables should have spaces before and after: {{ var_name }}
bash -c "find playbooks -type f -regex '.*.ya?ml' -print0 | \
xargs -t -n1 -0 ansible-lint -xANSIBLE0012,204,206"
xargs -t -n1 -0 ansible-lint -xANSIBLE0012,206"
bash -c 'find roles -maxdepth 1 -mindepth 1 -type d -printf "%p/\n" | \
xargs -t -n1 ansible-lint -xANSIBLE0012,204,206'
xargs -t -n1 ansible-lint -xANSIBLE0012,206'
# Ansible Syntax Check
bash -c "find playbooks -type f -regex '.*.ya?ml' -exec \
ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \{\} + > /dev/null"