diff --git a/.ansible-lint-ignore b/.ansible-lint-ignore new file mode 100644 index 0000000..d025a99 --- /dev/null +++ b/.ansible-lint-ignore @@ -0,0 +1 @@ +galaxy.yml galaxy[version-incorrect] \ No newline at end of file diff --git a/.cz.yaml b/.cz.yaml new file mode 100644 index 0000000..54f4ce1 --- /dev/null +++ b/.cz.yaml @@ -0,0 +1,8 @@ +--- +commitizen: + name: cz_conventional_commits + prerelease_offset: 1 + tag_format: $version + update_changelog_on_bump: false + version: 0.0.1 + version_scheme: semver diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..9f4a1fb --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,110 @@ +--- + +variables: + ANSIBLE_GALAXY_PACKAGE_NAME: centurion + MY_PROJECT_ID: "59504579" + GIT_SYNC_URL: "https://$GITHUB_USERNAME_ROBOT:$GITHUB_TOKEN_ROBOT@github.com/NoFussComputing/ansible_collection_centurion.git" + PAGES_ENVIRONMENT_PATH: projects/ansible/collection/centurion/ + RELEASE_ADDITIONAL_ACTIONS_BUMP: ./.gitlab/additional_actions_bump.sh + + +include: + - project: nofusscomputing/projects/gitlab-ci + ref: development + file: + - .gitlab-ci_common.yaml + - conventional_commits/.gitlab-ci.yml + - template/ansible-collection.gitlab-ci.yaml + - template/mkdocs-documentation.gitlab-ci.yaml + # ToDo: update gitlabCI jobs for collections workflow + - git_push_mirror/.gitlab-ci.yml + - automation/.gitlab-ci-ansible.yaml + + +Build Collection: + extends: .ansible_collection_build + needs: + - job: Ansible Lint + optional: true + - job: Ansible Lint (galaxy.yml) + optional: true + + rules: + + - if: $CI_COMMIT_TAG + when: always + + # Needs to run, even by bot as the test results need to be available + # - if: "$CI_COMMIT_AUTHOR =='nfc_bot '" + # when: never + + - if: # Occur on merge + $CI_COMMIT_BRANCH + && + $CI_PIPELINE_SOURCE == "push" + when: always + + # - if: + # $CI_COMMIT_BRANCH != "development" + # && + # $CI_COMMIT_BRANCH != "master" + # && + # $CI_PIPELINE_SOURCE == "push" + # when: always + + - when: never + + +Update Git Submodules: + extends: .ansible_playbook_git_submodule + + +Github (Push --mirror): + extends: + - .git_push_mirror + needs: [] + + +Gitlab Release: + extends: .ansible_collection_release + needs: + - Stage Collection + release: + tag_name: $CI_COMMIT_TAG + description: ./artifacts/release_notes.md + name: $CI_COMMIT_TAG + assets: + links: + - name: 'Ansible Galaxy' + url: https://galaxy.ansible.com/ui/repo/published/${ANSIBLE_GALAXY_NAMESPACE}/${ANSIBLE_GALAXY_PACKAGE_NAME}/?version=${CI_COMMIT_TAG} + + - name: ${ANSIBLE_GALAXY_NAMESPACE}-${ANSIBLE_GALAXY_PACKAGE_NAME}-${CI_COMMIT_TAG}.tar.gz + url: https://galaxy.ansible.com/api/v3/plugin/ansible/content/published/collections/artifacts/${ANSIBLE_GALAXY_NAMESPACE}-${ANSIBLE_GALAXY_PACKAGE_NAME}-${CI_COMMIT_TAG}.tar.gz + link_type: package + + - name: Documentation + url: https://nofusscomputing.com/${PAGES_ENVIRONMENT_PATH} + milestones: + - $CI_MERGE_REQUEST_MILESTONE + + +Website.Submodule.Deploy: + extends: .submodule_update_trigger + variables: + SUBMODULE_UPDATE_TRIGGER_PROJECT: nofusscomputing/infrastructure/website + environment: + url: https://nofusscomputing.com/$PAGES_ENVIRONMENT_PATH + name: Documentation + rules: + - if: # condition_dev_branch_push + $CI_COMMIT_BRANCH == "development" && + $CI_PIPELINE_SOURCE == "push" + exists: + - '{docs/**,pages/**}/*.md' + changes: + paths: + - '{docs/**,pages/**}/*.md' + compare_to: 'master' + when: always + + - when: never diff --git a/.gitlab/additional_actions_bump.sh b/.gitlab/additional_actions_bump.sh new file mode 100644 index 0000000..ee7b3eb --- /dev/null +++ b/.gitlab/additional_actions_bump.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Nothing to do here!!"; diff --git a/.gitlab/merge_request_templates/.gitkeep b/.gitlab/merge_request_templates/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..038c259 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,12 @@ +[submodule "roles/nfc_common"] + path = roles/nfc_common + url = https://gitlab.com/nofusscomputing/projects/ansible/common.git + branch = development +[submodule "website-template"] + path = website-template + url = https://gitlab.com/nofusscomputing/infrastructure/website-template.git + branch = development +[submodule "gitlab-ci"] + path = gitlab-ci + url = https://gitlab.com/nofusscomputing/projects/gitlab-ci.git + branch = development diff --git a/.nfc_automation.yaml b/.nfc_automation.yaml new file mode 100644 index 0000000..e1eb17f --- /dev/null +++ b/.nfc_automation.yaml @@ -0,0 +1,10 @@ +--- + +role_git_conf: + gitlab: + submodule_branch: "development" + default_branch: development + mr_labels: ~"type::automation" ~"impact::0" ~"priority::0" + auto_merge: true + merge_request: + patch_labels: '~"code review::not started"' diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..6452d35 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,13 @@ +{ + "yaml.schemas": { + "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json#/$defs/tasks": [ + "roles/*/tasks/**.yaml", + ], + "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/vars.json": [ + "roles/*/variables/**.yaml" + ], + "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json#/$defs/playbook": ".gitlab/test_results.yaml" + }, + "gitlab.aiAssistedCodeSuggestions.enabled": false, + "gitlab.duoChat.enabled": false, +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/galaxy.yml b/galaxy.yml new file mode 100644 index 0000000..9456e8b --- /dev/null +++ b/galaxy.yml @@ -0,0 +1,81 @@ +### REQUIRED +# The namespace of the collection. This can be a company/brand/organization or product namespace under which all +# content lives. May only contain alphanumeric lowercase characters and underscores. Namespaces cannot start with +# underscores or numbers and cannot contain consecutive underscores +namespace: nofusscomputing + +# The name of the collection. Has the same character restrictions as 'namespace' +name: itsm + +# The version of the collection. Must be compatible with semantic versioning +version: 0.0.1 + +# The path to the Markdown (.md) readme file. This path is relative to the root of the collection +readme: README.md + +# A list of the collection's content authors. Can be just the name or in the format 'Full Name (url) +# @nicks:irc/im.site#channel' +authors: + - No Fuss Computing + + +### OPTIONAL but strongly recommended +# A short summary description of the collection +description: Collection for ITSM application + +# Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only +# accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file' +license: + - MIT + +# The path to the license file for the collection. This path is relative to the root of the collection. This key is +# mutually exclusive with 'license' +license_file: '' + +# 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: + - itsm + - tools + +# Collections that this collection requires to be installed for it to be usable. The key of the dict is the +# collection label 'namespace.name'. The value is a version range +# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version +# range specifiers can be set and are separated by ',' +dependencies: {} + +# The URL of the originating SCM repository +repository: https://gitlab.com/nofusscomputing/projects/ansible/collections/itsm + +# The URL to any online docs +documentation: https://nofusscomputing.com/projects/ansible/collection/itsm/ + +# The URL to the homepage of the collection/project +# homepage: https://example.com + +# The URL to the collection issue tracker +issues: https://gitlab.com/nofusscomputing/projects/ansible/collections/itsm/-/issues + +# 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: + - .vscode + - artifacts + - docs + - .git* + - gitlab-ci + - website-template + - .ansible-lint-ignore + - .cz.yaml + - .nfc_automation.yaml + - dockerfile + - mkdocs.yml + +# 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/gitlab-ci b/gitlab-ci new file mode 160000 index 0000000..673441f --- /dev/null +++ b/gitlab-ci @@ -0,0 +1 @@ +Subproject commit 673441f83a7d943434252ee23899e3572cdfb141 diff --git a/meta/runtime.yml b/meta/runtime.yml new file mode 100644 index 0000000..2fe301c --- /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/website-template b/website-template new file mode 160000 index 0000000..8735f62 --- /dev/null +++ b/website-template @@ -0,0 +1 @@ +Subproject commit 8735f623dc5e1d9c9e46e50db03b4c41cb3d1efd