5 changed files with 74 additions and 0 deletions
@ -0,0 +1,33 @@
|
||||
--- |
||||
- hosts: primary |
||||
tasks: |
||||
- block: |
||||
- name: Ensuring ansible-lint package is present |
||||
fail: |
||||
msg: "Centos or RHEL is not yet supported" |
||||
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' |
||||
|
||||
- name: Ensuring ansible-lint package is present |
||||
become: true |
||||
apt: |
||||
name: ansible-lint |
||||
state: present |
||||
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' |
||||
|
||||
|
||||
- name: find files to lint |
||||
find: |
||||
paths: |
||||
- "{{ src_dir| default('../..') }}/playbooks" |
||||
- "{{ src_dir| default('../..') }}/roles" |
||||
patterns: |
||||
- "*.yaml" |
||||
- "*.yml" |
||||
register: files_to_lint |
||||
|
||||
# TODO (kkalynovskyi) develop suitable ansible-lint configuration |
||||
- name: run ansible-lint against found files |
||||
command: "ansible-lint {{ item.path }}" |
||||
with_items: "{{ files_to_lint.files }}" |
||||
|
||||
|
@ -0,0 +1,16 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); |
||||
# you may not use this file except in compliance with the License. |
||||
# You may obtain a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
|
||||
- job: |
||||
name: ansible-lint-airship |
||||
run: tests/ansible/lint.yaml |
||||
nodeset: ubuntu-single-airship |
@ -0,0 +1,17 @@
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); |
||||
# you may not use this file except in compliance with the License. |
||||
# You may obtain a copy of the License at |
||||
# |
||||
# http://www.apache.org/licenses/LICENSE-2.0 |
||||
# |
||||
# Unless required by applicable law or agreed to in writing, software |
||||
# distributed under the License is distributed on an "AS IS" BASIS, |
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
# See the License for the specific language governing permissions and |
||||
# limitations under the License. |
||||
|
||||
- nodeset: |
||||
name: ubuntu-single-airship |
||||
nodes: |
||||
- name: primary |
||||
label: ubuntu-bionic |
Loading…
Reference in new issue