zzet.rbenv Ansible Role

repository·master·Indexed 41 days ago

https://github.com/zzet/rbenv

An Ansible role for installing and managing rbenv, providing automated Ruby version management and plugin configuration. Supports both system and user installations, custom Ruby build options via RUBY_CONFIGURE_OPTS, and management of plugins such as ruby-build and rbenv-update.

Tokens
849
Snippets
1
Records
3
Agent score
2%

What's inside zzet.rbenv

  1. Install rbenv via Ansible role

    master

    This Ansible role automates the installation of rbenv and its associated plugins. You can choose between a 'system' installation (typically in /usr/local/rbenv) or a 'user' installation (typically in $HOME/.rbenv). The role allows you to specify which Ruby versions to install, manage plugins, and configure specific build options for Ruby versions.

    - hosts: web
      gather_facts: true
      vars:
        rbenv:
          env: user
          version: v0.4.0
          default_ruby: 2.0.0-p353
          rubies:
          - version: 2.0.0-p353
          - version: 2.2.4
            env:
              RUBY_CONFIGURE_OPTS: "--enable-shared"
          - version: 2.3.4
            env:
              RUBY_CONFIGURE_OPTS: "--enable-shared --with-jemalloc"
        rbenv_extra_depends:
          - libjemalloc1
          - libjemalloc-dev
      roles:
        - role: zzet.rbenv
          rbenv_users:
            - user
  2. Configure rbenv installation variables

    master

    Use the following variables to customize your rbenv installation:

    rbenv object

    • rbenv.env: Type of installation. Use 'system' or 'user'.
    • rbenv.version: The specific rbenv version tag to install.
    • rbenv.default_ruby: The Ruby version to set as the global version.
    • rbenv.rubies: An array of hashes defining Ruby versions to install. You can pass environment variables like RUBY_CONFIGURE_OPTS per version.

    Global variables

    • rbenv_repo: The git repository URL for rbenv source.
    • rbenv_plugins: An array of hashes containing name, repo, and version for plugins to install.
    • rbenv_root: The installation path. Defaults to /usr/local/rbenv for system or $HOME/.rbenv for user.
    • rbenv_users: An array of usernames for multi-user installations.
    • rbenv_extra_depends: An array of system packages to install before compiling Ruby versions.
    • rbenv_clean_up: If true, deletes all Ruby versions not explicitly listed in rbenv.rubies.
    • rbenv_owner / rbenv_group: Ownership settings for the rbenv_root when using rbenv.env: system.
    • rbenv_tmpdir: Temporary directory for artifacts during Ruby installation. Defaults to $TMPDIR.
    • rbenv_set_vars: If true (default), sets GEM_PATH=$GEM_PATH:$HOME/.gems for 'user' environments.
    • default_gems_file: Path to a custom default-gems file (used by rbenv-default-gems plugin).
  3. Reference: rbenv plugin defaults

    master

    By default, the role installs the following plugins:

    NameRepositoryDefault Version
    rbenv-varshttps://github.com/rbenv/rbenv-vars.gitmaster
    ruby-buildhttps://github.com/rbenv/ruby-build.gitmaster
    rbenv-default-gemshttps://github.com/rbenv/rbenv-default-gems.gitmaster
    rbenv-installerhttps://github.com/rbenv/rbenv-installer.gitmain
    rbenv-updatehttps://github.com/rkh/rbenv-update.gitmaster
    rbenv-whatishttps://github.com/rkh/rbenv-whatis.gitmaster
    rbenv-usehttps://github.com/rkh/rbenv-use.gitmaster