Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add switch for install bundler #27

Merged
merged 1 commit into from
Aug 8, 2016
Merged

Conversation

vkill
Copy link
Contributor

@vkill vkill commented May 4, 2016

Hi

I add a switch for install bundler, because we cannot install any gem by normal way in China.

After this modification, I can install bundler and some gems like this

---
- hosts: server
  roles:
    - ansible-role-ruby
      ruby_install_from_source: True
      ruby_version: 2.2.2
      ruby_download_url: http://cache.ruby-lang.org/pub/ruby/ruby-2.2.2.tar.gz
      ruby_install_bundler: False
      ruby_install_gems: []

  tasks:
    - name: 'Replace gem source for user'
      shell: gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
      become: yes
      become_user: "{{ ansible_ssh_user }}"

    - name: 'Replace gem source for root'
      shell: gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
      become: yes
      become_user: "root"

    - name: Install Bundler.
      gem: name=bundler state=present user_install=no

    - name: Install configured gems.
      gem: "name={{ item }} state=present"
      become: yes
      become_user: "{{ ansible_ssh_user }}"
      with_items:
        - pry

Please review it, thanks.

@geerlingguy
Copy link
Owner

Sounds good, thanks!

@geerlingguy geerlingguy merged commit 1f0c32b into geerlingguy:master Aug 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants