From ca707521abce87f3d06cbc2f2a4f01077ba86c29 Mon Sep 17 00:00:00 2001 From: Jean-Marie Gervais Date: Thu, 5 Oct 2023 14:41:09 +0200 Subject: [PATCH 1/2] fix: ansible-lint can't load module tosit.tdp.resolve --- plugins/modules/resolve.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 plugins/modules/resolve.py diff --git a/plugins/modules/resolve.py b/plugins/modules/resolve.py new file mode 100644 index 00000000..7ee14dc7 --- /dev/null +++ b/plugins/modules/resolve.py @@ -0,0 +1,36 @@ +# Copyright 2022 TOSIT.IO +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import absolute_import, division, print_function + + +# pylint: disable=invalid-name +__metaclass__ = type +# pylint: enable=invalid-name + +DOCUMENTATION = """ +module: resolve +short_description: >- + sets facts for current context +notes: +- This plugin always runs on the execution node +- This plugin will not run on a managed node +""" + +EXAMPLES = r""" +--- +- name: Hadoop client Config + hosts: hadoop_client + tasks: + - tosit.tdp.resolve: + node_name: hadoop_client + - name: Configure hadoop client + ansible.builtin.import_role: + name: tosit.tdp.hadoop.client + tasks_from: config + - ansible.builtin.meta: clear_facts +""" + +RETURN = r""" +# TO-DO: Enter return values here +""" From 10d049bc03ac81ebeadaf82b1e6aefa74af4148f Mon Sep 17 00:00:00 2001 From: Jean-Marie Gervais Date: Thu, 5 Oct 2023 15:56:54 +0200 Subject: [PATCH 2/2] fix: update github workflow --- .ansible-lint | 1 + .github/workflows/ansible-lint.yml | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index 536c1bc5..b5f5689d 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -5,6 +5,7 @@ exclude_paths: - tdp_lib_dag/ - tdp_vars_defaults/ - tdp_vars_schema/ + - venv warn_list: # or 'skip_list' to silence them completely - experimental # all rules tagged as experimental diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index 537f8ff7..5aed73ee 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -2,12 +2,20 @@ name: Ansible Lint on: pull_request: types: [opened, reopened, synchronize] +env: + NAMESPACE: tosit + COLLECTION_NAME: tdp + ANSIBLE_COLLECTIONS_PATH: ${{ github.workspace }} jobs: ansible-lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - run: | - dev/setup.sh - source venv/bin/activate - ansible-lint + with: + path: ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}} + - name: Setup venv for linting + run: dev/setup.sh + working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}} + - name: Run ansible-lint + run: source venv/bin/activate && ansible-lint + working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}}