From 9b1d6e335d6f3a709205b7065feb14904637ae70 Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Wed, 13 Dec 2023 22:26:10 +0100 Subject: [PATCH] feat: commit collection skeleton --- .ansible-lint | 8 ++++++++ .gitignore | 6 +++--- .yamllint | 40 ++++++++++++++++++++++++++++++++++++ LICENSE | 21 ++++++++++++++----- README.md | 4 ++-- galaxy.yml | 30 +++++++++++++++++++++++++++ meta/runtime.yml | 52 +++++++++++++++++++++++++++++++++++++++++++++++ plugins/README.md | 31 ++++++++++++++++++++++++++++ 8 files changed, 182 insertions(+), 10 deletions(-) create mode 100644 .ansible-lint create mode 100644 .yamllint create mode 100644 galaxy.yml create mode 100644 meta/runtime.yml create mode 100644 plugins/README.md diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..0d93798 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,8 @@ +--- +warn_list: + - experimental # all rules tagged as experimental + - yaml # violations reported by yamllint + - meta-no-info + +skip_list: + - jinja[spacing] # Rule that looks inside jinja2 templates. diff --git a/.gitignore b/.gitignore index 5c199eb..a1ca609 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -# ---> Ansible -*.retry - +# ignore molecule/testinfra pycache +**/__pycache__ +.vscode diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..24fdec5 --- /dev/null +++ b/.yamllint @@ -0,0 +1,40 @@ +--- +# Based on ansible-lint config +extends: default + +rules: + braces: + max-spaces-inside: 1 + level: error + brackets: + max-spaces-inside: 1 + level: error + colons: + max-spaces-after: -1 + level: error + commas: + max-spaces-after: -1 + level: error + comments: enable + comments-indentation: disable + document-start: enable + empty-lines: + max: 3 + level: error + hyphens: + level: error + indentation: enable + key-duplicates: enable + line-length: + max: 80 + level: warning + new-line-at-end-of-file: enable + new-lines: + type: unix + trailing-spaces: enable + truthy: + allowed-values: + - 'true' + - 'false' + - 'yes' + - 'no' diff --git a/LICENSE b/LICENSE index 496d578..475d657 100644 --- a/LICENSE +++ b/LICENSE @@ -1,9 +1,20 @@ -MIT License +The MIT License (MIT) -Copyright (c) 2023 ansible-collections +Copyright (c) 2017 Bertrand Lanson -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 7f2347e..113d682 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# hashistack +# Ansible Collection - ednxzu.hashistack -A complete ansible collection to deploy and manage Hashicorp Vault, Consul, and Nomad clusters. \ No newline at end of file +Documentation for the collection. diff --git a/galaxy.yml b/galaxy.yml new file mode 100644 index 0000000..92e1ef4 --- /dev/null +++ b/galaxy.yml @@ -0,0 +1,30 @@ +--- +namespace: ednxzu +name: hashistack +version: 1.0.0 +readme: README.md +authors: + - Bertrand Lanson +description: your collection description +license: [] +license_file: 'LICENSE' + +# A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character +# requirements as 'namespace' and 'name' +tags: [] +dependencies: {} +repository: https://git.ednz.fr/ansible-collections/hashistack +documentation: http://docs.example.com +homepage: http://example.com +issues: http://example.com/issue/tracker +# A list of file glob-like patterns used to filter any files or directories that should not be included in the build +# artifact. A pattern is matched from the relative path of the file or directory of the collection directory. This +# uses 'fnmatch' to match the files or directories. Some directories and files like 'galaxy.yml', '*.pyc', '*.retry', +# and '.git' are always filtered. Mutually exclusive with 'manifest' +build_ignore: [] +# A dict controlling use of manifest directives used in building the collection artifact. The key 'directives' is a +# list of MANIFEST.in style +# L(directives,https://packaging.python.org/en/latest/guides/using-manifest-in/#manifest-in-commands). The key +# 'omit_default_directives' is a boolean that controls whether the default directives are used. Mutually exclusive +# with 'build_ignore' +# manifest: null diff --git a/meta/runtime.yml b/meta/runtime.yml new file mode 100644 index 0000000..20f709e --- /dev/null +++ b/meta/runtime.yml @@ -0,0 +1,52 @@ +--- +# Collections must specify a minimum required ansible version to upload +# to galaxy +# requires_ansible: '>=2.9.10' + +# Content that Ansible needs to load from another location or that has +# been deprecated/removed +# plugin_routing: +# action: +# redirected_plugin_name: +# redirect: ns.col.new_location +# deprecated_plugin_name: +# deprecation: +# removal_version: "4.0.0" +# warning_text: | +# See the porting guide on how to update your playbook to +# use ns.col.another_plugin instead. +# removed_plugin_name: +# tombstone: +# removal_version: "2.0.0" +# warning_text: | +# See the porting guide on how to update your playbook to +# use ns.col.another_plugin instead. +# become: +# cache: +# callback: +# cliconf: +# connection: +# doc_fragments: +# filter: +# httpapi: +# inventory: +# lookup: +# module_utils: +# modules: +# netconf: +# shell: +# strategy: +# terminal: +# test: +# vars: + +# Python import statements that Ansible needs to load from another location +# import_redirection: +# ansible_collections.ns.col.plugins.module_utils.old_location: +# redirect: ansible_collections.ns.col.plugins.module_utils.new_location + +# Groups of actions/modules that take a common set of options +# action_groups: +# group_name: +# - module1 +# - module2 diff --git a/plugins/README.md b/plugins/README.md new file mode 100644 index 0000000..6260634 --- /dev/null +++ b/plugins/README.md @@ -0,0 +1,31 @@ +# Collections Plugins Directory + +This directory can be used to ship various plugins inside an Ansible collection. Each plugin is placed in a folder that +is named after the type of plugin it is in. It can also include the `module_utils` and `modules` directory that +would contain module utils and modules respectively. + +Here is an example directory of the majority of plugins currently supported by Ansible: + +``` +└── plugins + ├── action + ├── become + ├── cache + ├── callback + ├── cliconf + ├── connection + ├── filter + ├── httpapi + ├── inventory + ├── lookup + ├── module_utils + ├── modules + ├── netconf + ├── shell + ├── strategy + ├── terminal + ├── test + └── vars +``` + +A full list of plugin types can be found at [Working With Plugins](https://docs.ansible.com/ansible-core/2.15/plugins/plugins.html).