manage_pipx_packages/molecule/default_vagrant/verify.yml
Bertrand Lanson 6e45c9e279
All checks were successful
test / Linting (push) Successful in 33s
test / Molecule tests (default, debian12) (push) Successful in 1m39s
test / Molecule tests (default, ubuntu2204) (push) Successful in 1m39s
test / Molecule tests (with_custom_packages, debian12) (push) Successful in 2m4s
test / Molecule tests (with_custom_packages, ubuntu2204) (push) Successful in 1m36s
feat(test): remove /etc/hosts tests, fix #1
2023-12-09 10:45:10 +01:00

29 lines
951 B
YAML

---
- name: Verify
hosts: all
gather_facts: true
become: true
tasks:
- name: "Test: packages ansible-lint"
block:
- name: "Get pipx installed packages"
ansible.builtin.command: "pipx list --json"
environment:
PIPX_HOME: "/opt/pipx"
changed_when: false
register: pipx_installed_packages
- name: "Set fact"
ansible.builtin.set_fact:
pipx_simple_list: "{{ pipx_simple_list | default({}) | combine({item.key: item.value.metadata.main_package.package_version}) }}"
loop: "{{ pipx_installed_packages.stdout | from_json | json_query('venvs') | dict2items }}"
- name: "Verify packages ansible-lint"
ansible.builtin.assert:
that:
- pipx_simple_list['ansible-lint'] is defined
- name: "Print installed packages"
ansible.builtin.debug:
msg: "{{ pipx_simple_list }}"