Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ansible-lint can't load module tosit.tdp.resolve #803

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
36 changes: 36 additions & 0 deletions plugins/modules/resolve.py
Original file line number Diff line number Diff line change
@@ -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
"""
Loading