diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f74c83a --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# OS generated files # +###################### +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +Icon? +ehthumbs.db +Thumbs.db + +# IDE files # +################# +/.settings +/.buildpath +/.project +/nbproject +*.komodoproject +*.kpf +/.idea + +# Vagrant files # +.virtualbox/ +.vagrant/ +vagrant_ansible_inventory_* +ansible.cfg + +# Other files # +############### +!empty diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c20e4c1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,79 @@ +--- +sudo: required +dist: trusty + +language: python +python: "2.7" + +env: + - ANSIBLE_VERSION=latest + - ANSIBLE_VERSION=2.0.2.0 + - ANSIBLE_VERSION=2.0.1.0 + - ANSIBLE_VERSION=2.0.0.2 + - ANSIBLE_VERSION=2.0.0.1 + - ANSIBLE_VERSION=2.0.0.0 + - ANSIBLE_VERSION=1.9.6 + - ANSIBLE_VERSION=1.9.5 + - ANSIBLE_VERSION=1.9.4 + - ANSIBLE_VERSION=1.9.3 + - ANSIBLE_VERSION=1.9.2 + - ANSIBLE_VERSION=1.9.1 + - ANSIBLE_VERSION=1.9.0.1 + - ANSIBLE_VERSION=1.8.4 + - ANSIBLE_VERSION=1.8.3 + - ANSIBLE_VERSION=1.8.2 + - ANSIBLE_VERSION=1.8.1 + - ANSIBLE_VERSION=1.8 + - ANSIBLE_VERSION=1.7.2 + - ANSIBLE_VERSION=1.7.1 + - ANSIBLE_VERSION=1.7 + - ANSIBLE_VERSION=1.6.9 + - ANSIBLE_VERSION=1.6.8 + - ANSIBLE_VERSION=1.6.7 + - ANSIBLE_VERSION=1.6.6 + - ANSIBLE_VERSION=1.6.5 + - ANSIBLE_VERSION=1.6.4 + - ANSIBLE_VERSION=1.6.3 + - ANSIBLE_VERSION=1.6.2 + - ANSIBLE_VERSION=1.6.10 + - ANSIBLE_VERSION=1.6.1 + - ANSIBLE_VERSION=1.6 + +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 + +script: + # Check the role/playbook's syntax. + - ansible-playbook -i tests/inventory tests/test.yml --syntax-check + + # Run the role/playbook with ansible-playbook. + - ansible-playbook -i tests/inventory tests/test.yml -vvvv + + # Run the role/playbook again, checking to make sure it's idempotent. + - > + ansible-playbook -i tests/inventory tests/test.yml + | grep -q 'changed=0.*failed=0' + && (echo 'Idempotence test: pass' && exit 0) + || (echo 'Idempotence test: fail' && exit 1) + +notifications: + email: false + hipchat: + rooms: + secure: iFZY09ZcfsdbhhbyHIh4A3yjn/do7KVKs8PpXBHu3ieCawUrm0wBALwrA5ijNAVqbMVxegkQfPL44cuYGGX3HKFHVjK68Yb6tx/2jv9drK2vLqRV2q8bhAAxbUlWJLZYCybm2QhGKC8m6WCKoY3qMLFpJ/GemOCDI6O56NJjH+AOhXOvdJxc58Qj1gsaxxKsU8fMmQz17tgpACodVNmdMraJgIYObbPr3j+JzI4cg35TVaeGPiAcCGf+E8k2lPcX6fOIzpa7MPDV46tII3DzwCHzd2m9vQSVA16wHr9kUS0QXcWVKyRk5p5TOuS8+Zo5LJHXBoUkmoyYPipM0r77CLavTR5WlnikCgjn5P7PMrfT0JQnemInKFqfTfWpHKa7prBKZM3Xp1JX/3lt8Vpv7cFyYvva8D3gCJHPTzGVGKy/VHjD2axL3wGd271EiHngi4YOjT4hdtpKD1mYp4PWHKi7dUSVND47nNPTQcf8Qs6x/LBXOPRecOfHG3No1T7aZi6LK78W4zzWWcdLKRlSQbOyowDrq+eFjUiZthVGQhpcpWsbA8byhf/oxyPgPdPIKc3E0BAqJ4bvBEYb/psl+6b3m60NPr5Wife4FzDG3klb80CGlnQAoGWsurrLl/XmViOGlwlPeaOaWWSI/wi46YlQn+Gg21pRPHXc9h/ZOBg= + webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..a498425 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +## komodo-ide + +[![Build Status](https://travis-ci.org/Oefenweb/ansible-komodo-ide.svg?branch=master)](https://travis-ci.org/Oefenweb/ansible-komodo-ide) [![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-komodo--ide-blue.svg)](https://galaxy.ansible.com/Oefenweb/ansible-komodo-ide) + +Set up [Komodo IDE](http://komodoide.com/) by ActiveState in Debian-like systems. + +#### Requirements + +* `unzip` (will be installed) + +#### Variables + +* `komodo_ide_version` [default: `8.5.4`]: Version to install +* `komodo_ide_build` [default: `86985`]: Build to install +* `komodo_ide_install_prefix` [default: `/opt`]: Install prefix + +## Dependencies + +None + +#### Example + +```yaml +--- +- hosts: all + roles: + - komodo-ide +``` + +#### License + +MIT + +#### Author Information + +Mischa ter Smitten + +#### Feedback, bug-reports, requests, ... + +Are [welcome](https://github.com/Oefenweb/ansible-komodo-ide/issues)! diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..4d7b356 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,69 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby ts=2 sw=2 tw=0 et : + +role = File.basename(File.expand_path(File.dirname(__FILE__))) + +boxes = [ + { + :name => "ubuntu-1204", + :box => "opscode-ubuntu-12.04", + :url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-12.04_chef-provisionerless.box", + :ip => '10.0.0.11', + :cpu => "50", + :ram => "256" + }, + { + :name => "ubuntu-1404", + :box => "opscode-ubuntu-14.04", + :url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box", + :ip => '10.0.0.12', + :cpu => "50", + :ram => "256" + }, + { + :name => "ubuntu-1604", + :box => "opscode-ubuntu-16.04", + :url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-16.04_chef-provisionerless.box", + :ip => '10.0.0.13', + :cpu => "50", + :ram => "256" + }, + { + :name => "debian-710", + :box => "opscode-debian-7.10", + :url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.10_chef-provisionerless.box", + :ip => '10.0.0.14', + :cpu => "50", + :ram => "256" + }, + { + :name => "debian-84", + :box => "opscode-debian-8.4", + :url => "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-8.4_chef-provisionerless.box", + :ip => '10.0.0.15', + :cpu => "50", + :ram => "256" + }, +] + +Vagrant.configure("2") do |config| + boxes.each do |box| + config.vm.define box[:name] do |vms| + vms.vm.box = box[:box] + vms.vm.box_url = box[:url] + vms.vm.hostname = "ansible-#{role}-#{box[:name]}" + + vms.vm.provider "virtualbox" do |v| + v.customize ["modifyvm", :id, "--cpuexecutioncap", box[:cpu]] + v.customize ["modifyvm", :id, "--memory", box[:ram]] + end + + vms.vm.network :private_network, ip: box[:ip] + + vms.vm.provision :ansible do |ansible| + ansible.playbook = "tests/vagrant.yml" + ansible.verbose = "vv" + end + end + end +end diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..864b6e6 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,5 @@ +# defaults file for komodo-ide +--- +komodo_ide_version: 8.5.4 +komodo_ide_build: 86985 +komodo_ide_install_prefix: /opt diff --git a/files/empty b/files/empty new file mode 100644 index 0000000..e69de29 diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..ba4be2d --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,2 @@ +# handlers file for komodo-ide +--- diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..f253c57 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,23 @@ +# meta file for pip +--- +galaxy_info: + author: Mischa ter Smitten + company: Oefenweb.nl B.V. + description: Set up Komodo IDE by ActiveState in Debian-like systems + license: MIT + min_ansible_version: 1.6 + platforms: + - name: Ubuntu + versions: + - precise + - trusty + - xenial + - name: Debian + versions: + - wheezy + - jessie + galaxy_tags: + - development + - system + - ide +dependencies: [] diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..f33fe3f --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,76 @@ +# tasks file for komodo-ide +--- +- name: create (download) directory + file: + path: "{{ komodo_ide_downloads_path }}" + state: directory + owner: root + group: root + mode: 0755 + tags: + - configuration + - komodo-ide + - komodo-ide-download + +- name: download + get_url: + url: "http://downloads.activestate.com/Komodo/releases/{{ komodo_ide_version }}/Komodo-IDE-{{ komodo_ide_version }}-{{ komodo_ide_build }}-linux-{{ komodo_ide_machine_map[ansible_machine] }}.tar.gz" + dest: "{{ komodo_ide_downloads_path }}/Komodo-IDE-{{ komodo_ide_version }}-{{ komodo_ide_build }}-linux-{{ komodo_ide_machine_map[ansible_machine] }}.tar.gz" + owner: root + group: root + mode: 0644 + tags: + - configuration + - komodo-ide + - 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 + 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 + 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 + tags: + - configuration + - komodo-ide + - komodo-ide-install + - komodo-ide-install-dir + +- name: install (symlink) + file: + src: "{{ komodo_ide_install_prefix }}/Komodo-IDE-{{ komodo_ide_version }}-{{ komodo_ide_build }}/bin/komodo" + dest: /usr/local/bin/komodo + state: link + force: true + tags: + - configuration + - komodo-ide + - komodo-ide-install + - komodo-ide-install-symlink diff --git a/templates/empty b/templates/empty new file mode 100644 index 0000000..e69de29 diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 0000000..2fbb50c --- /dev/null +++ b/tests/inventory @@ -0,0 +1 @@ +localhost diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 0000000..b369726 --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,7 @@ +# test file for komodo-ide +--- +- hosts: localhost + connection: local + sudo: true + roles: + - ../../ diff --git a/tests/vagrant.yml b/tests/vagrant.yml new file mode 100644 index 0000000..e91f24b --- /dev/null +++ b/tests/vagrant.yml @@ -0,0 +1,7 @@ +# test file for komodo-ide +--- +- hosts: all + remote_user: vagrant + sudo: true + roles: + - ../../ diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..913044b --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,9 @@ +# vars file for komodo-ide +--- +komodo_ide_downloads_path: /var/lib/ansible/komodo-ide/downloads +komodo_ide_install_path: "{{ komodo_ide_install_prefix }}/packer-{{ komodo_ide_version }}" +komodo_ide_machine_map: + i686: x86 + i386: x86 + x86_64: x86_64 + amd64: x86_64