Skip to content

Commit c1162be

Browse files
Add travis and ansible-lint (#4)
* Add travis and ansible-lint * Fix ansible-lint issues * Fix missing pip packages
1 parent 1f04697 commit c1162be

File tree

5 files changed

+45
-1
lines changed

5 files changed

+45
-1
lines changed

.ansible-lint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
exclude_paths:
2+
- ./tests/requirements

.travis.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
language: python
3+
cache: pip
4+
python: "2.7"
5+
6+
# Use the new container infrastructure
7+
sudo: false
8+
9+
# Install pip
10+
addons:
11+
apt:
12+
packages:
13+
- python-pip
14+
15+
install:
16+
# Install ansible and dependencies
17+
- pip install ansible ansible-lint
18+
19+
# Check ansible version
20+
- ansible --version
21+
22+
# Create ansible.cfg with correct roles_path
23+
- printf '[defaults]\nroles_path=./tests/requirements/:../' >ansible.cfg
24+
25+
script:
26+
# Run ansible-lint
27+
- ansible-lint .
28+
29+
# Basic role syntax check
30+
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
31+
32+
notifications:
33+
webhooks: https://galaxy.ansible.com/api/v1/notifications/

tasks/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
shell: "{{ _mvn_cmdline }}"
3636
args:
3737
chdir: "{{ conga_basedir }}"
38-
tags: conga-maven-compile
38+
tags:
39+
- conga-maven-compile
40+
- skip_ansible_lint
3941

4042
- name: Set fact that CONGA configuration was generated
4143
set_fact: conga_configuration_generated=true

tests/inventory

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[test]
2+
localhost
3+

tests/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: test role syntax
2+
hosts: test
3+
roles:
4+
- ansible-conga-maven

0 commit comments

Comments
 (0)