From 71286c5b0ab3b241f49e138f9b0265dc69b4053e Mon Sep 17 00:00:00 2001 From: Engin Yoeyen Date: Fri, 19 Dec 2014 19:14:26 +0100 Subject: [PATCH] move content of ruby.yml to main.yml --- tasks/main.yml | 38 +++++++++++++++++++++++++++++++++++++- tasks/ruby.yml | 38 -------------------------------------- 2 files changed, 37 insertions(+), 39 deletions(-) delete mode 100644 tasks/ruby.yml diff --git a/tasks/main.yml b/tasks/main.yml index 5fa44e5..fa6a07f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,2 +1,38 @@ --- -# tasks file for ansible-ruby + +- name: ruby | install ansible dependencies + apt: + pkg: python-pycurl + state: installed + +- name: ruby | add brightbox ppa for ruby + apt_repository: + repo: 'ppa:brightbox/ruby-ng-experimental' + state: present + register: new_ppa + +- name: apt update if new ppa added + apt: + update-cache: yes + when: new_ppa | changed + +- name: ruby | install ruby and build-essential + apt: + pkg: "{{ item }}" + state: installed + with_items: + - "ruby{{ ruby_version }}" + - "ruby{{ ruby_version }}-dev" + - ruby-switch + - build-essential + +- name: ruby | set ruby as default + shell: "ruby-switch --set ruby{{ ruby_version }}" + register: ruby_switch + changed_when : ruby_switch.stdout != "" + +- name: ruby | install bundler + gem: + name="bundler" + user_install="no" + state="present" \ No newline at end of file diff --git a/tasks/ruby.yml b/tasks/ruby.yml deleted file mode 100644 index fa6a07f..0000000 --- a/tasks/ruby.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- - -- name: ruby | install ansible dependencies - apt: - pkg: python-pycurl - state: installed - -- name: ruby | add brightbox ppa for ruby - apt_repository: - repo: 'ppa:brightbox/ruby-ng-experimental' - state: present - register: new_ppa - -- name: apt update if new ppa added - apt: - update-cache: yes - when: new_ppa | changed - -- name: ruby | install ruby and build-essential - apt: - pkg: "{{ item }}" - state: installed - with_items: - - "ruby{{ ruby_version }}" - - "ruby{{ ruby_version }}-dev" - - ruby-switch - - build-essential - -- name: ruby | set ruby as default - shell: "ruby-switch --set ruby{{ ruby_version }}" - register: ruby_switch - changed_when : ruby_switch.stdout != "" - -- name: ruby | install bundler - gem: - name="bundler" - user_install="no" - state="present" \ No newline at end of file