From 73b2d81ecadcd03f783b30722f24e5db63a00302 Mon Sep 17 00:00:00 2001 From: Simon Constans Date: Fri, 10 Jul 2015 14:34:08 +0200 Subject: [PATCH 1/2] Refactoring --- tasks/install.yml | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/tasks/install.yml b/tasks/install.yml index 7667955..27c63b6 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -1,14 +1,21 @@ --- +- name: Test if folder exist + stat: + path={{ phpstorm_dir }} + register: phpstorm_exist + - name: Download phpStorm archive - shell: - wget "http://download.jetbrains.com/webide/PhpStorm-{{ phpstorm_version }}.tar.gz" --output-document="{{ phpstorm_archive }}" - creates="{{ phpstorm_dir }}" + get_url: + url=http://download.jetbrains.com/webide/PhpStorm-{{ phpstorm_version }}.tar.gz + dest={{ phpstorm_archive }} + when: phpstorm_exist.stat.exists == False - name: Decompress phpStorm archive - shell: - tar xvfz {{ phpstorm_archive }} -C {{ phpstorm_install_dir }} - creates="{{ phpstorm_dir }}" + unarchive: + src={{ phpstorm_archive }} + dest={{ phpstorm_install_dir }} + when: phpstorm_exist.stat.exists == False - name: Move phpStorm folder shell: @@ -16,10 +23,12 @@ creates="{{ phpstorm_dir }}" - name: Create symlink - shell: - ln -fs {{ phpstorm_dir }}/bin/phpstorm.sh {{ phpstorm_bin }} - creates="{{ phpstorm_bin }}" + file: + src={{ phpstorm_dir }}/bin/phpstorm.sh + dest={{ phpstorm_bin }} + state=link - name: Remove phpStorm archive - command: rm {{ phpstorm_archive }} - removes="{{ phpstorm_archive }}" + file: + path={{ phpstorm_archive }} + state=absent From 9f953ea243e826b74f41a9a29d01e6749fa520ec Mon Sep 17 00:00:00 2001 From: Simon Constans Date: Fri, 10 Jul 2015 14:53:04 +0200 Subject: [PATCH 2/2] Update documentation --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2ba2cd0..e37088a 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,21 @@ # ansible-role-phpstorm + +[![License](https://img.shields.io/badge/License-MIT%20License-blue.svg)](https://github.com/kosssi/ansible-role-phpstorm/blob/master/LICENSE) [![Build Status](https://travis-ci.org/kosssi/ansible-role-phpstorm.svg?branch=master)](https://travis-ci.org/kosssi/ansible-role-phpstorm) Ansible role to install [phpStorm](http://www.jetbrains.com/phpstorm/). ## Role Defaults Variables - phpstorm_version: 7.1.3 + phpstorm_version: 9.0 phpstorm_install_dir: /opt phpstorm_bin: /usr/local/bin/phpstorm ## Example Playbook roles: - - { role: kosssi.phpstorm } + - { role: kosssi.phpstorm, tags: phpstorm } ## Vagrant @@ -21,7 +23,3 @@ If you have vagrant, you can test this role: cd tests vagrant up - -## License - -MIT