Skip to content

Commit

Permalink
Use command instead of unarchive
Browse files Browse the repository at this point in the history
  • Loading branch information
tersmitten committed Jan 17, 2017
1 parent a4f3824 commit 77ff02c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 23 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ before_install:

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 @@ -78,6 +79,8 @@ script:
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
- if [ "$ANSIBLE_VERSION" = "latest" ]; then ansible-lint || 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 77ff02c

Please sign in to comment.