Skip to content

Commit

Permalink
Merge pull request #4 from Oefenweb/fix-failing-tests
Browse files Browse the repository at this point in the history
Fix failing tests (on Ansible 2, < 2.2)
  • Loading branch information
tersmitten authored Jan 17, 2017
2 parents c34afe8 + 62af5d5 commit 1b01308
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 30 deletions.
14 changes: 6 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ python: "2.7"

env:
- ANSIBLE_VERSION=latest
- ANSIBLE_VERSION=2.2.1.0
- ANSIBLE_VERSION=2.2.0.0
- ANSIBLE_VERSION=2.1.4
- ANSIBLE_VERSION=2.1.3
- ANSIBLE_VERSION=2.1.2
- ANSIBLE_VERSION=2.1.1.0
Expand Down Expand Up @@ -48,19 +50,13 @@ branches:
only:
- master

matrix:
allow_failures:
# Idempotency test fails, see https://groups.google.com/forum/#!msg/ansible-project/jwYFl8zw8Qw/1yhSq86uFmYJ
- env: ANSIBLE_VERSION=1.8.2
- env: ANSIBLE_VERSION=1.8.1
- env: ANSIBLE_VERSION=1.8

before_install:
- sudo apt-get update -qq

install:
# Install Ansible.
- if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install --no-binary ansible ansible; else pip install --no-binary ansible ansible==$ANSIBLE_VERSION; fi
- if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible; else pip install --no-binary ansible ansible==$ANSIBLE_VERSION; fi
- if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible-lint; fi

script:
# Check the role/playbook's syntax.
Expand All @@ -76,6 +72,8 @@ script:
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
- if [ "$ANSIBLE_VERSION" = "latest" ]; then ansible-lint tests/test.yml || true; fi

notifications:
email: false
hipchat:
Expand Down
28 changes: 6 additions & 22 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,22 @@
- komodo-ide-download

- name: extract
unarchive:
src: "{{ komodo_ide_downloads_path }}/Komodo-IDE-{{ komodo_ide_version }}-{{ komodo_ide_build }}-linux-{{ komodo_ide_machine_map[ansible_machine] }}.tar.gz"
dest: "{{ komodo_ide_downloads_path }}/"
owner: root
group: root
mode: 0755
command: >
tar -xzvf "{{ komodo_ide_downloads_path }}/Komodo-IDE-{{ komodo_ide_version }}-{{ komodo_ide_build }}-linux-{{ komodo_ide_machine_map[ansible_machine] }}.tar.gz"
args:
chdir: "{{ komodo_ide_downloads_path }}"
creates: "{{ komodo_ide_downloads_path }}/Komodo-IDE-{{ komodo_ide_version }}-{{ komodo_ide_build }}-linux-{{ komodo_ide_machine_map[ansible_machine] }}/install.sh"
copy: false
register: unarchive
register: _unarchive
tags:
- configuration
- komodo-ide
- komodo-ide-extract

- name: chown
file:
path: "{{ komodo_ide_downloads_path }}/Komodo-IDE-{{ komodo_ide_version }}-{{ komodo_ide_build }}-linux-{{ komodo_ide_machine_map[ansible_machine] }}"
state: directory
owner: root
group: root
recurse: true
when: unarchive | changed and (ansible_version is not defined or ansible_version.full | version_compare('1.9', '<'))
tags:
- configuration
- komodo-ide
- komodo-ide-chown

- name: install
command: ./install.sh --install-dir {{ komodo_ide_install_prefix }}/Komodo-IDE-{{ komodo_ide_version }}-{{ komodo_ide_build }}
args:
chdir: "{{ komodo_ide_downloads_path }}/Komodo-IDE-{{ komodo_ide_version }}-{{ komodo_ide_build }}-linux-{{ komodo_ide_machine_map[ansible_machine] }}"
when: unarchive | changed
when: _unarchive | changed
tags:
- configuration
- komodo-ide
Expand Down

0 comments on commit 1b01308

Please sign in to comment.