Fix yaml lint lines too long
continuous-integration/drone/push Build is failing Details
continuous-integration/drone/pr Build is failing Details

In some cases I used block scalars: https://yaml-multiline.info/
In other cases I added newlines
In rare cases I just ignored the rule: https://yamllint.readthedocs.io/en/stable/disable_with_comments.html
This commit is contained in:
Patrick Marchand 2020-06-04 12:51:53 -04:00
parent e877b721f9
commit 98089a3274
14 changed files with 85 additions and 31 deletions

View File

@ -4,18 +4,26 @@ type: docker
name: default name: default
steps: steps:
- name: lint markdown files - name: lint markdown files
image: pipelinecomponents/remark-lint:latest image: pipelinecomponents/remark-lint:latest
commands: commands:
- "remark --no-stdout --color --use preset-lint-recommended ." - "remark --no-stdout --color --use preset-lint-recommended ."
- name: lint yaml files - name: lint yaml files
image: pipelinecomponents/yamllint:latest image: pipelinecomponents/yamllint:latest
commands: commands:
- "yamllint ." - "yamllint ."
- name: lint ansible scripts - name: lint ansible scripts
image: pipelinecomponents/ansible-lint:latest image: pipelinecomponents/ansible-lint:latest
commands: commands:
- "find . -maxdepth 1 -name '*.yml' | sort | grep -v '.drone.yml' | xargs ansible-playbook --syntax-check --list-tasks" - >
- "find . -maxdepth 1 -name '*.yml' | sort | grep -v '.drone.yml' | xargs ansible-lint" find . -maxdepth 1 -name '*.yml'
| sort
| grep -v '.drone.yml'
| xargs ansible-playbook --syntax-check --list-tasks
- >
find . -maxdepth 1 -name '*.yml'
| sort
| grep -v '.drone.yml'
| xargs ansible-lint"

View File

@ -40,4 +40,5 @@
tasks_from: exec.yml tasks_from: exec.yml
# environment: # environment:
# yamllint disable-line rule:line-length
# PKG_PATH: "http://ftp.openbsd.org/pub/OpenBSD/{{ ansible_distribution_version }}/packages/{{ ansible_architecture }}/" # PKG_PATH: "http://ftp.openbsd.org/pub/OpenBSD/{{ ansible_distribution_version }}/packages/{{ ansible_architecture }}/"

View File

@ -11,6 +11,7 @@
tasks: tasks:
- name: Install ansible's prerequisite - name: Install ansible's prerequisite
# yamllint disable-line rule:line-length
raw: export PKG_PATH=http://ftp.eu.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(uname -p)/; pkg_add -z python-2 raw: export PKG_PATH=http://ftp.eu.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(uname -p)/; pkg_add -z python-2
# vim:ft=ansible # vim:ft=ansible

View File

@ -37,7 +37,8 @@
- name: "If AllowGroups is present then use it" - name: "If AllowGroups is present then use it"
set_fact: set_fact:
ssh_allowgroups: "{{ (grep_allowgroups_ssh.rc == 0) or (grep_allowusers_ssh.rc != 0) }}" ssh_allowgroups:
"{{ (grep_allowgroups_ssh.rc == 0) or (grep_allowusers_ssh.rc != 0) }}"
- name: "Add AllowGroups sshd directive with '{{ evolinux_ssh_group }}'" - name: "Add AllowGroups sshd directive with '{{ evolinux_ssh_group }}'"
lineinfile: lineinfile:

View File

@ -6,8 +6,10 @@ general_alert_email: "root@localhost"
general_technical_realm: "example.com" general_technical_realm: "example.com"
evomaintenance_realm: "example.com" evomaintenance_realm: "example.com"
evomaintenance_alert_email: "evomaintenance-{{ inventory_hostname }}@{{ evomaintenance_realm }}" evomaintenance_alert_email:
evomaintenance_hostname: "{{ inventory_hostname }}.{{ general_technical_realm }}" "evomaintenance-{{ inventory_hostname }}@{{ evomaintenance_realm }}"
evomaintenance_hostname:
"{{ inventory_hostname }}.{{ general_technical_realm }}"
evomaintenance_pg_host: null evomaintenance_pg_host: null
evomaintenance_pg_passwd: null evomaintenance_pg_passwd: null
evomaintenance_pg_db: null evomaintenance_pg_db: null
@ -27,4 +29,7 @@ evomaintenance_hook_commit: true
evomaintenance_hook_mail: true evomaintenance_hook_mail: true
evomaintenance_default_hosts: [] evomaintenance_default_hosts: []
evomaintenance_additional_hosts: [] evomaintenance_additional_hosts: []
evomaintenance_hosts: "{{ evomaintenance_default_hosts | union(evomaintenance_additional_hosts) | unique }}" evomaintenance_hosts: >
{{ evomaintenance_default_hosts
| union(evomaintenance_additional_hosts)
| unique }}

View File

@ -10,7 +10,12 @@
- evomaintenance - evomaintenance
- name: Copy evomaintenance script and template - name: Copy evomaintenance script and template
copy: src={{ item.src }} dest={{ item.dest }} owner=root group=wheel mode="0755" copy:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: 'root'
group: 'wheel'
mode: '0755'
with_items: with_items:
- {src: 'evomaintenance.sh', dest: '/usr/share/scripts/'} - {src: 'evomaintenance.sh', dest: '/usr/share/scripts/'}
- {src: 'evomaintenance.tpl', dest: '/usr/share/scripts/'} - {src: 'evomaintenance.tpl', dest: '/usr/share/scripts/'}

View File

@ -2,7 +2,8 @@
- name: Configure rc.local - name: Configure rc.local
lineinfile: lineinfile:
path: /etc/rc.local path: /etc/rc.local
line: 'date | mail -s "boot/reboot of $(hostname -s)" {{ general_alert_email }}' line:
'date | mail -s "boot/reboot of $(hostname -s)" {{ general_alert_email }}'
create: true create: true
tags: tags:
- misc - misc

View File

@ -29,7 +29,9 @@
minute: 0 minute: 0
hour: 4 hour: 4
weekday: 0 weekday: 0
job: "/usr/sbin/bgpctl show rib selected > /var/log/bgp/rib-selected-$(date +\\%F)" job: >
/usr/sbin/bgpctl show rib selected
> /var/log/bgp/rib-selected-$(date +\\%F)
when: group_names | select('search','bgp') | list | count > 0 when: group_names | select('search','bgp') | list | count > 0
tags: tags:
- bgp - bgp

View File

@ -29,6 +29,7 @@
- etc-git - etc-git
- commit-etc - commit-etc
# yamllint disable rule:line-length
- name: set commit author - name: set commit author
set_fact: set_fact:
commit_author: '{% if ansible_env.SUDO_USER is not defined %}root{% else %}{{ ansible_env.SUDO_USER }}{% endif %}' commit_author: '{% if ansible_env.SUDO_USER is not defined %}root{% else %}{{ ansible_env.SUDO_USER }}{% endif %}'
@ -47,6 +48,7 @@
tags: tags:
- etc-git - etc-git
- commit-etc - commit-etc
# yamllint enable rule:line-length
- debug: - debug:
var: etc_commit_end_run var: etc_commit_end_run

View File

@ -93,7 +93,8 @@
- name: cron job for /etc/.git status is removed - name: cron job for /etc/.git status is removed
lineinfile: lineinfile:
path: /etc/daily.local path: /etc/daily.local
line: '/usr/local/bin/git --git-dir=/etc/.git --work-tree=/etc status --short' line:
'/usr/local/bin/git --git-dir=/etc/.git --work-tree=/etc status --short'
owner: root owner: root
mode: "0644" mode: "0644"
state: absent state: absent
@ -105,7 +106,13 @@
cron: cron:
name: git status name: git status
minute: 42 minute: 42
job: "who > /dev/null || /usr/local/bin/git --git-dir=/etc/.git --work-tree=/etc status --short" job: >
who
> /dev/null
|| /usr/local/bin/git
--git-dir=/etc/.git
--work-tree=/etc
status --short
when: etc_git_monitor_status when: etc_git_monitor_status
tags: tags:
- etc-git - etc-git
@ -114,7 +121,13 @@
cron: cron:
name: git status name: git status
minute: 42 minute: 42
job: "who > /dev/null || /usr/local/bin/git --git-dir=/etc/.git --work-tree=/etc status --short" job: >
who
> /dev/null
|| /usr/local/bin/git
--git-dir=/etc/.git
--work-tree=/etc
status --short
state: absent state: absent
when: not etc_git_monitor_status when: not etc_git_monitor_status
tags: tags:

View File

@ -2,7 +2,8 @@
evolix_trusted_ips: [] evolix_trusted_ips: []
additional_trusted_ips: [] additional_trusted_ips: []
# Let's merge evolix_trusted_ips with additional_trusted_ips # Let's merge evolix_trusted_ips with additional_trusted_ips
nagios_nrpe_allowed_hosts: "{{ evolix_trusted_ips | union(additional_trusted_ips) | unique }}" nagios_nrpe_allowed_hosts:
"{{ evolix_trusted_ips | union(additional_trusted_ips) | unique }}"
nagios_nrpe_ldap_dc: "dc=DOMAIN,dc=EXT" nagios_nrpe_ldap_dc: "dc=DOMAIN,dc=EXT"
nagios_nrpe_ldap_passwd: LDAP_PASSWD nagios_nrpe_ldap_passwd: LDAP_PASSWD
nagios_nrpe_pgsql_passwd: PGSQL_PASSWD nagios_nrpe_pgsql_passwd: PGSQL_PASSWD

View File

@ -55,8 +55,12 @@
mode: "{{ item.mode }}" mode: "{{ item.mode }}"
force: true force: true
with_items: with_items:
- {src: 'files/shellpki/openssl.cnf', dest: '/etc/shellpki/openssl.cnf', mode: '0640'} - src: 'files/shellpki/openssl.cnf'
- {src: 'files/shellpki/shellpki', dest: '/usr/local/sbin/shellpki', mode: '0755'} dest: '/etc/shellpki/openssl.cnf'
mode: '0640'
- src: 'files/shellpki/shellpki'
dest: '/usr/local/sbin/shellpki'
mode: '0755'
tags: tags:
- openvpn - openvpn
@ -104,6 +108,8 @@
mode: "{{ item.mode }}" mode: "{{ item.mode }}"
force: true force: true
with_items: with_items:
- {src: 'files/check_openvpn.pl', dest: '/usr/local/libexec/nagios/plugins/check_openvpn.pl', mode: '0755'} - src: 'files/check_openvpn.pl'
dest: '/usr/local/libexec/nagios/plugins/check_openvpn.pl'
mode: '0755'
tags: tags:
- openvpn - openvpn

View File

@ -9,9 +9,14 @@
ignore_errors: true ignore_errors: true
tags: tags:
- commit-etc - commit-etc
# yamllint disable rule:line-length
- name: /etc modifications are committed - name: /etc modifications are committed
shell: "git add -A . && git commit -m \"{{ commit_message | default('Ansible run') }}\" --author=\"{{ ansible_env.SUDO_USER | default('Root') }} <{{ ansible_env.SUDO_USER | default('Root') }}@{{ general_technical_realm }}>\"" shell: >
git add -A .
&& git commit
-m "{{ commit_message | default('Ansible run') }}"
--author="{{ ansible_env.SUDO_USER | default('Root') }}"
< "{{ ansible_env.SUDO_USER | default('Root') }}@{{ general_technical_realm }}>"
args: args:
chdir: /etc chdir: /etc
register: etc_commit_end_evolinux register: etc_commit_end_evolinux
@ -19,3 +24,4 @@
ignore_errors: true ignore_errors: true
tags: tags:
- commit-etc - commit-etc
# yamllint enable rule:line-length

View File

@ -13,8 +13,10 @@ evolinux_sudo_group: "evolinux-sudo"
evolinux_root_disable_ssh: true evolinux_root_disable_ssh: true
# #
# evomaintenance_realm: "example.com" # evomaintenance_realm: "example.com"
# evomaintenance_alert_email: "evomaintenance-{{ inventory_hostname }}@{{ evomaintenance_realm }}" # evomaintenance_alert_email:
# evomaintenance_hostname: "{{ inventory_hostname }}.{{ general_technical_realm }}" # "evomaintenance-{{ inventory_hostname }}@{{ evomaintenance_realm }}"
# evomaintenance_hostname:
# "{{ inventory_hostname }}.{{ general_technical_realm }}"
# evomaintenance_pg_host: Null # evomaintenance_pg_host: Null
# evomaintenance_pg_passwd: Null # evomaintenance_pg_passwd: Null
# evomaintenance_pg_db: Null # evomaintenance_pg_db: Null