rvm / rvm1-ansible

The official ansible RVM role to install and manage your Ruby versions.
MIT License
271 stars 136 forks source link

FreeBSD support #45

Closed dinapappor closed 9 years ago

dinapappor commented 9 years ago

I can't get this role to work with FreeBSD 10.1 running on ec2 with newly spun ami.

I get this:

TASK: [rvm_io.rvm1-ruby | Detect rvm binary] ********************************** 
fatal: [10.0.100.253] => Missing become password

FATAL: all hosts have already failed -- aborting

Relevant parts of the playbook:


---
- hosts: tag_env_ansiblelab:&tag_type_api
  remote_user: ec2-user
  become: yes
  become_method: su

  vars:
    ansible_python_interpreter: /usr/local/bin/python2.7
    rvm1_user: deploy
    rvm1_install_path: '/usr/home/deploy/.rvm'
    rvm1_install_flags: '--auto-dotfiles --user-install'

  pre_tasks:
    - pkgng: name=ca_root_nss state=present
    - pkgng: name=sudo state=present
    - pkgng: name=bash state=present
    - pkgng: name=gnupg state=present
    - user: name=deploy shell=/usr/local/bin/bash
    - name: Configure deploy sudoers file
      lineinfile: dest=/usr/local/etc/sudoers.d/deploy owner=root group=wheel mode=0440
                  line="deploy ALL=(ALL) NOPASSWD:ALL"
                  state=present
                  create=yes
                  validate='visudo -cf %s'

  tasks:
  - name: Bootstrap pkng
    raw: /usr/sbin/pkg -N
    register: pkg
    ignore_errors: True
  - raw: /usr/bin/env ASSUME_ALWAYS_YES=1 /usr/sbin/pkg bootstrap -f
    when: pkg|failed

  roles:
     - nginx
     - { role: rvm_io.rvm1-ruby, tags: ruby, sudo: True }

nginx does install fine.

dinapappor commented 9 years ago

Seems, it's the ec2-user which I connect to with ssh that is making the trouble here. Adding it and will see if that fixes things.

Hit another thing though:

TASK: [rvm_io.rvm1-ruby | Import GPG keys] ************************************ 
failed: [10.0.100.253] => {"changed": false, "cmd": ["gpg", "--keyserver", "hkp://keys.gnupg.net", "--recv-keys", "D39DC0E3"], "delta": "0:00:06.826400", "end": "2015-05-06 16:16:14.380273", "rc": 2, "start": "2015-05-06 16:16:07.553873", "warnings": []}
stderr: gpg: directory '/home/deploy/.gnupg' created
gpg: new configuration file '/home/deploy/.gnupg/gpg.conf' created
gpg: WARNING: options in '/home/deploy/.gnupg/gpg.conf' are not yet active during this run
gpg: keybox '/home/deploy/.gnupg/pubring.kbx' created
gpg: keyserver receive failed: No route to host

FATAL: all hosts have already failed -- aborting
dinapappor commented 9 years ago

The problems I have now seems to be related to #31.

I assume this particular issue can be closed for now. (I had to add ec2-user to sudoers file).

nickjj commented 9 years ago

Ok, closing it. It is indeed related to #31.