Git Product home page Git Product logo

ansible-role-asdf's Introduction

Build Status

Ansible ASDF role

An Ansible Role that installs asdf version manager with plugins.

Requirements

None

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml). The variable asdf_plugins specifies a list of plugins to install:

asdf_plugins: []

Each plugin can be given in the following format:

asdf_plugins:
  - name: "erlang"    # a plugin name
    repository: ""    # a plugin repository, optional
    versions:         # a list of versions to install
      - 18.3
      - 20.1
    global: 20.1      # set as a global version, optional

The variable asdf_user sets a user for which the role is installed:

asdf_user: "deploy"

By default the role installs asdf and its plugins in the ~/.asdf for this user. This behaviour can be changed by setting asdf_dir. This is useful in situations where multiple users need access to installed plugins and tools (e.g. a deploy user, the app user, and possibly developer users).

asdf_dir: "/opt/asdf-vm"

The variable asdf_legacy_version_file specifies if plugins which support this feature should read the version files used by other version managers (e.g. .ruby-version in the case of Ruby's rbenv).

asdf_legacy_version_file: "yes"

The variable asdf_plugin_dependencies sets packages which are needed for plugins (see defaults/main.yml):

asdf_plugin_dependencies: []

The variable asdf_version sets the git tag of asdf:

asdf_version: v0.9.0

Dependencies

None

Example Playbook

Playbook example is given below:

- hosts: web
  roles:
  - role: ansible-role-asdf
    asdf_plugins:
    - name: "erlang"
      versions: ["18.3", "20.1"]
      global: "20.1"
    - name: "elixir"
      versions: "1.3.1"

A more complex example for CentOS is:

- name: install asdf
  hosts: '*'
  become: true
  vars:
    asdf_version: v0.6.2
    asdf_user: ci
    asdf_plugins:
      - name: erlang
      - name: elixir
      - name: nodejs
        versions: ["8.11.3"]
        global: "8.11.3"
  roles:
    - asdf

Installing asdf into a shared directory accessible to the developers group:

- name: install asdf
  hosts: '*'
  become: true
  vars:
    asdf_user: deploy
    asdf_group: developers
    asdf_dir: /opt/asdf-vm
    asdf_plugins:
      - name: erlang
      - name: elixir
      - name: nodejs
        versions: ["8.11.3"]
        global: "8.11.3"
  roles:
    - asdf

License

Licensed under the MIT License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.