From 425e7d322f4c2981cc628a7c918484f1e74df0a0 Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Tue, 28 Apr 2015 11:01:31 +0200 Subject: [PATCH 1/3] add travis config for ansible --- .travis.yml | 18 ++++++++++++++++++ spec/travis.yml | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 .travis.yml create mode 100644 spec/travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..0969c5f --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +--- +language: python +python: "2.7" +before_install: + - sudo apt-get update -qq + - sudo apt-get install -qq python-apt python-pycurl +install: + - pip install ansible + - echo -e 'localhost ansible_connection=local' > spec/inventory + - echo -e '[defaults]\nroles_path = ../\nhostfile = ./spec/inventory' > ansible.cfg +script: + - ansible-playbook --syntax-check spec/travis.yml + - ansible-playbook --sudo -v --diff spec/travis.yml + - > + ansible-playbook --sudo spec/travis.yml + | grep -q 'changed=0.*failed=0' + && (echo 'Idempotence test: pass' && exit 0) + || (echo 'Idempotence test: fail' && exit 1) \ No newline at end of file diff --git a/spec/travis.yml b/spec/travis.yml new file mode 100644 index 0000000..07545b8 --- /dev/null +++ b/spec/travis.yml @@ -0,0 +1,3 @@ +- hosts: localhost + roles: + - ansible-ssh-hardening \ No newline at end of file From 7683a21fef38afd9cb6fc4436a22eb72ea20deda Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Tue, 28 Apr 2015 15:42:07 +0200 Subject: [PATCH 2/3] update roles path --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0969c5f..61f435f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ before_install: install: - pip install ansible - echo -e 'localhost ansible_connection=local' > spec/inventory - - echo -e '[defaults]\nroles_path = ../\nhostfile = ./spec/inventory' > ansible.cfg + - echo -e '[defaults]\nroles_path = ./roles\nhostfile = ./spec/inventory' > ansible.cfg script: - ansible-playbook --syntax-check spec/travis.yml - ansible-playbook --sudo -v --diff spec/travis.yml From 7408765a073059a0d3cb91d70ec59ec798e179db Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Tue, 28 Apr 2015 16:20:18 +0200 Subject: [PATCH 3/3] remove idempotence test --- .travis.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 61f435f..366b4d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,4 @@ install: - echo -e '[defaults]\nroles_path = ./roles\nhostfile = ./spec/inventory' > ansible.cfg script: - ansible-playbook --syntax-check spec/travis.yml - - ansible-playbook --sudo -v --diff spec/travis.yml - - > - ansible-playbook --sudo spec/travis.yml - | grep -q 'changed=0.*failed=0' - && (echo 'Idempotence test: pass' && exit 0) - || (echo 'Idempotence test: fail' && exit 1) \ No newline at end of file + - ansible-playbook --sudo -v --diff spec/travis.yml \ No newline at end of file