thomasbaumeister.github_version.github_version (1.0.0) — lookup

Get the latest tagged releaase version from a public Github repository

| "added in version" 0.1 of thomasbaumeister.github_version"

Authors: Thomas Baumeister Thomas@Baumeister-web.de

Install collection

Install with ansible-galaxy collection install thomasbaumeister.github_version:==1.0.0


Add to requirements.yml

  collections:
    - name: thomasbaumeister.github_version
      version: 1.0.0

Description

This lookup returns the latest tagged release version of a public Github repository.

A future version will accept an optional Github token to allow lookup of private repositories.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Get the latest version, also strip the 'v' out of the tag version, e.g. 'v1.0.0' -> '1.0.0'
  set_fact:
    ansible_version: "{{ lookup('github_version', 'ansible/ansible')[1:] }}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Operate on multiple repositories
  git:
    repo: https://github.com/.git
    version: "{{ lookup('github_version', item) }}"
    dest: "{{ lookup('env', 'HOME') }}/projects"
  with_items:
    - ansible/ansible
    - ansible/molecule
    - ansible/awx

Inputs

    
repos:
    description: A list of Github repositories from which to retrieve versions.
    required: true

Outputs

_list:
  description:
  - List of latest Github repository version(s)
  type: list

See also