From 4a63c21a72845d2f65d486f296d6027f8362d566 Mon Sep 17 00:00:00 2001 From: Nick Janetakis Date: Wed, 30 Jul 2014 17:14:06 -0400 Subject: [PATCH] Fix example playbook --- README.md | 17 ++++++++++++++--- tasks/rubies.yml | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f8cf816..0d9866c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ rvm1-ansible solves this by using rvm to install 1 or more versions of ruby. It `$ ansible-galaxy install rvm_io.rvm1-ruby` -## Example playbook +## Example playbook For the sake of this example let's assume you have a group called **app** and you have a typical `site.yml` file. @@ -21,7 +21,7 @@ To use this role edit your `site.yml` file to look something like this: ``` --- - name: ensure app servers are configured -- hosts: app + hosts: app roles: # If you use the default rvm install location you must enable sudo @@ -35,10 +35,21 @@ Let's say you want to edit a few values, you can do this by opening or creating ``` --- +# Let's install rvm locally to a user and install multiple versions of ruby. + +# We can dump the rvm install script to /tmp. +rvm1_temp_download_path: '/tmp' + +# If you're going to use the ~ shortcut and you have sudo enabled then make sure +# you set sudo_user on the role to the correct user or it will be root. +# ie. { role: rvm_io.rvm1-ruby, tags: ruby, sudo: true, sudo_user: '{{ rvm1_user }}' } + +# Another option is just to not set sudo for the rvm role at all. +rvm1_install_path: '~/.rvm' + rvm1_rubies: - 'ruby-2.1.0' - 'ruby-2.1.2' -rvm1_rvm_stable_version_number: 1.25.26 ``` ## Role variables diff --git a/tasks/rubies.yml b/tasks/rubies.yml index 5e49d46..e086b9c 100644 --- a/tasks/rubies.yml +++ b/tasks/rubies.yml @@ -34,4 +34,4 @@ - name: ensure ruby version is deleted command: '{{ rvm1 }} remove {{ rvm1_delete_ruby }}' changed_when: false - when: rvm1_delete_ruby and detect_delete_ruby.rc == 0 \ No newline at end of file + when: rvm1_delete_ruby and detect_delete_ruby.rc == 0