An opinionated role that installs Just
This role requires two separate tools be installed.
First it requires the 'ansible.utils' collection be installed from Ansible-Galaxy via:
ansible-galaxy collection install ansible.utils
Secondly it requires the jsonschema
Python package be installed via:
pip3 install jsonschema
just
: [mapping] (required) contains the following fields:
-
versions
: [array of strings] (optional)A list of valid Just versions that should be fetched and extracted to
just_path
. -
default
: [string] (optional)The version that should be set as system default. If the version does not exist the task will fail.
-
trim
: [boolean] (optional)If true indicates that all non linked directories under
just_path
that do not correspond to version numbers defined insideversions
should be removed.
just_path
: [string] (optional) The path at which Just
will be extracted to.
Example:
- just:
- trim: true
- default: "1.1.1"
- versions:
- "1.1.1"
- "1.2.2"
None, other then previously stated requirements.
Before the role can be used it needs to be added to the machine running the playbook, and as of writing this, this role is not hosted on Ansible-Galaxy only on Github.
-
Create a
requirements.yml
file in the root directory of the playbook being worked on. -
Add the following definition inside the
requirements.yml
file:
- name: hth-just
src: https://github.com/hrafnthor/ansible-just.git
scm: git
- Install the requirements by executing
ansible-galaxy install -r .requirements.yml
This will allow any playbook run from this machine to use the role hth-just
- hosts: all
vars:
- just:
- trim: true
- default: "1.1.1"
- versions:
- "1.1.1"
- "1.2.2"
roles:
- hth-just
MIT license. See attached license file.
Hrafn Thorvaldsson Find me at https://www.hth.is