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

Changes to the lookup template to encounter tox-ansible sanity check failures #344

Merged
merged 1 commit into from
Dec 19, 2024
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
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
{# lookup_plugin_template.j2 #}
{%- set lookup_name = plugin_name | default("hello_world") -%}
{%- set author = author | default("Your Name") -%}
{%- set author = author | default("Your Name (@username)") -%}
{%- set description = description | default("A custom lookup plugin for Ansible.") -%}
{%- set license = license | default("GPL-3.0-or-later") -%}
"""An example lookup plugin file."""
# {{ lookup_name }}.py - {{ description }}

# pylint: disable=E0401
# {{ lookup_name }}.py - {{ description }}
# Author: {{ author }}
# License: {{ license }}

from typing import Any, Optional, Dict, List
from ansible.plugins.lookup import LookupBase # type: ignore
from ansible.errors import AnsibleError # type: ignore
from ansible.utils.display import Display # type: ignore

display = Display()
# Copyright 2020 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

DOCUMENTATION = """
name: {{ lookup_name }}
Expand Down Expand Up @@ -45,6 +40,14 @@ _list:
type: list
"""

from typing import Any, Dict, List, Optional

from ansible.errors import AnsibleError # type: ignore
from ansible.plugins.lookup import LookupBase # type: ignore
from ansible.utils.display import Display # type: ignore

display = Display()


class LookupModule(LookupBase): # type: ignore[misc]
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
"""An example lookup plugin file."""
# hello_world.py - A custom lookup plugin for Ansible.

# pylint: disable=E0401
# hello_world.py - A custom lookup plugin for Ansible.
# Author: Your Name
# License: GPL-3.0-or-later

from typing import Any, Optional, Dict, List
from ansible.plugins.lookup import LookupBase # type: ignore
from ansible.errors import AnsibleError # type: ignore
from ansible.utils.display import Display # type: ignore

display = Display()
# Author: Your Name (@username)
# Copyright 2020 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

DOCUMENTATION = """
name: hello_world
author: Your Name
author: Your Name (@username)
version_added: "1.0.0"
short_description: A custom lookup plugin for Ansible.
description:
Expand All @@ -39,6 +34,14 @@
type: list
"""

from typing import Any, Dict, List, Optional

from ansible.errors import AnsibleError # type: ignore
from ansible.plugins.lookup import LookupBase # type: ignore
from ansible.utils.display import Display # type: ignore

display = Display()


class LookupModule(LookupBase): # type: ignore[misc]
"""
Expand Down
Loading