diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..6236b62 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,2 @@ +exclude_paths: + - ./tests/requirements \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..ac011e3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,33 @@ +--- +language: python +cache: pip +python: "2.7" + +# Use the new container infrastructure +sudo: false + +# Install pip +addons: + apt: + packages: + - python-pip + +install: + # Install ansible and dependencies + - pip install ansible ansible-lint + + # Check ansible version + - ansible --version + + # Create ansible.cfg with correct roles_path + - printf '[defaults]\nroles_path=./tests/requirements/:../' >ansible.cfg + +script: + # Run ansible-lint + - ansible-lint . + + # Basic role syntax check + - ansible-playbook tests/test.yml -i tests/inventory --syntax-check + +notifications: + webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index 44488fe..b82f7a1 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -35,7 +35,9 @@ shell: "{{ _mvn_cmdline }}" args: chdir: "{{ conga_basedir }}" - tags: conga-maven-compile + tags: + - conga-maven-compile + - skip_ansible_lint - name: Set fact that CONGA configuration was generated set_fact: conga_configuration_generated=true \ No newline at end of file diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 0000000..e03e58f --- /dev/null +++ b/tests/inventory @@ -0,0 +1,3 @@ +[test] +localhost + diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 0000000..d3dcd0f --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,4 @@ +- name: test role syntax + hosts: test + roles: + - ansible-conga-maven \ No newline at end of file