From 478052c76b19691a21996c86c066c6a701ea8a5a Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Thu, 6 Oct 2022 22:46:36 +1000 Subject: [PATCH] Fix: Remove ansible package/repo install Ansible is mostly used with the packer builds it's better to install ansible from PyPI, since this gives better control over the upstream version and managing dependencies. Update the pre-commit dependencies and molecule default platform config. Issue-ID: RELENG-4473 Change-Id: I5635d1633ad02e169957361ea354b092ade29c18 Signed-off-by: Anil Belur Signed-off-by: Vanessa Valderrama --- .pre-commit-config.yaml | 4 ++-- molecule/default/molecule.yml | 4 +--- tasks/main.yml | 17 +---------------- tox.ini | 4 ++-- vars/main.yml | 1 - 5 files changed, 6 insertions(+), 24 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c1879a6..b10b09b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,11 +1,11 @@ --- repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v1.3.0 + rev: v4.1.0 hooks: - id: trailing-whitespace - repo: https://github.com/jorisroovers/gitlint - rev: v0.11.0 + rev: v0.17.0 hooks: - id: gitlint diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 79ab304..7274ab6 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -11,9 +11,7 @@ platforms: - name: centos7 image: centos:7 - name: centos8 - image: centos:8 - - name: ubuntu1604 - image: ubuntu:16.04 + image: quay.io/pycontribs/centos:stream8 - name: ubuntu1804 image: ubuntu:18.04 - name: ubuntu2004 diff --git a/tasks/main.yml b/tasks/main.yml index 36e34f1..3845bd1 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -6,22 +6,6 @@ - "{{ ansible_distribution }}.yaml" - "{{ ansible_os_family }}.yaml" -- name: Setup Ansible PPA - block: - # gnupg2 is required to install the PPA and is missing on Ubuntu 18.04 - - name: Install gnupg2 - apt: - name: gnupg2 - state: present - - name: Setup Ansible PPA - apt_repository: - repo: ppa:ansible/ansible - # Ubuntu 20.04 PPA is not yet available so skip installing it for now. - # TODO: Figure out if recent versions of Ansible in Ubuntu is sufficient for - # our use without the need to pull in from PPA. - when: ansible_distribution == 'Ubuntu' and ansible_facts['distribution_major_version'] is version('20', '<') - become: true - # Required for direct install of parallel package from linuxsoft.cern.ch - rpm_key: state: present @@ -59,6 +43,7 @@ - name: Fetch PlantUML get_url: url: https://sourceforge.net/projects/plantuml/files/plantuml.jar/download + validate_certs: no dest: /opt/plantuml/plantuml.jar mode: 0644 register: result diff --git a/tox.ini b/tox.ini index a8d316b..0942618 100644 --- a/tox.ini +++ b/tox.ini @@ -24,5 +24,5 @@ basepython = python3 deps = pre-commit commands = - pre-commit install --hook-type commit-msg - pre-commit run --all-files + pre-commit run --all-files --show-diff-on-failure + pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG diff --git a/vars/main.yml b/vars/main.yml index 912d27a..d631243 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,7 +1,6 @@ --- lf_recommended_tools_packages: "{{ lf_recommended_tools_packages_common }} + {{ lf_recommended_tools_packages_distro }}" lf_recommended_tools_packages_common: - - ansible - ant - crudini - curl -- 2.16.6