Skip to content

atosatto/ansible-requirements-lint

Repository files navigation

ansible-requirements-lint - keep you Ansible dependencies up to date

ansible-requirements-lint is a simple command-line tool to check if your Ansible dependencies are up to date.

ci GoDoc License: MIT Go Report Card GitHub All Releases

Installation

Get the latest ansible-requirements-lint release

curl -sLS https://raw.githubusercontent.com/atosatto/ansible-requirements-lint/master/contrib/install.sh | sh

Or, download a specific version

curl -sLS https://raw.githubusercontent.com/atosatto/ansible-requirements-lint/master/contrib/install.sh | VERSION=v1.0.0 sh

Usage

Given the following requirements.yml file in your current working directory

$ cat requirements.yml
---

# Prometheus
- name: atosatto.prometheus
  version: v1.0.0

# Alertmanager
- name: atosatto.alertmanager
  version: v1.0.0

# Grafana
- name: atosatto.grafana
  version: v1.0.0

ansible-requirements-lint can be used to detect updates to the list of requirements with

$ ansible-requirements-lint requirements.yml
WARN: atosatto.prometheus: role not at the latest version, upgrade from v1.0.1 to v1.1.0.
WARN: atosatto.grafana: role not at the latest version, upgrade from v1.0.0 to v1.1.0.

In addition to requirements files, ansible-requirements-lint can parse role dependencies declared in the meta/main.yml file in your role directory

$ cat meta/main.yml
---

dependencies:
- role: atosatto.prometheus
  version: v1.0.0
  prometheus_release_tag: "v2.16.0"

- name: atosatto.alertmanager
  version: v1.0.0

Running ansible-requirements-lint will produce the following results

$ ansible-requirements-lint meta/main.yml
WARN: atosatto.prometheus: role not at the latest version, upgrade from v1.0.0 to v1.1.0.

License

MIT

Author Information

Andrea Tosatto (@_hilbert_)