From e6b8a0906c062d7ecbcc259c8986638a1ca6f917 Mon Sep 17 00:00:00 2001 From: "jasonpage.tas" Date: Mon, 19 Aug 2024 12:27:18 +0930 Subject: [PATCH] docs(teams): Add Documenation for teams playbook https://github.com/nofusscomputing/ansible_collection_centurion/pull/17 #14 --- .../collection/centurion/playbooks/index.md | 11 ++++ .../collection/centurion/playbooks/teams.md | 61 +++++++++++++++++++ mkdocs.yml | 6 ++ 3 files changed, 78 insertions(+) create mode 100644 docs/projects/ansible/collection/centurion/playbooks/index.md create mode 100644 docs/projects/ansible/collection/centurion/playbooks/teams.md diff --git a/docs/projects/ansible/collection/centurion/playbooks/index.md b/docs/projects/ansible/collection/centurion/playbooks/index.md new file mode 100644 index 0000000..34813d3 --- /dev/null +++ b/docs/projects/ansible/collection/centurion/playbooks/index.md @@ -0,0 +1,11 @@ +--- +title: Playbooks +description: No Fuss Computings Companion Ansible Collection Centurion Playbooks. +date: 2024-08-18 +template: project.html +about: https://github.com/nofusscomputing/ansible_collection_centurion +--- + +Available playbooks include: + +- [Teams](./teams.md) diff --git a/docs/projects/ansible/collection/centurion/playbooks/teams.md b/docs/projects/ansible/collection/centurion/playbooks/teams.md new file mode 100644 index 0000000..03649c2 --- /dev/null +++ b/docs/projects/ansible/collection/centurion/playbooks/teams.md @@ -0,0 +1,61 @@ +--- +title: Teams +description: No Fuss Computings Companion Ansible Collection Centurion teams Playbook. +date: 2024-08-18 +template: project.html +about: https://github.com/nofusscomputing/ansible_collection_centurion +--- + +The teams playbook has been created for the purpose of creating Centurion ERP teams. It allows teams to be defined as configuration as code which allows standardisation of teams and permissions within an organisation. With this playbook it is possible to create every team within an organisation and define the permissions and notes that are to be applied to that team. + +The teams playbook includes the [AWX Feature](../../../playbooks/awx.md) to import the playbook as a job template in AWX / Ansible Automation Platform. + +The following job template will be created: + +* **Centurion/Access/Teams** Creation and patching of teams and permissions + +On import to AWX / Ansible Automation Platform a credential type will also be created, `Playbook/teams/centurion` that can be used to supply the required secrets and Centurion host. + +!!! info + The playbook is able to work with centurion ERP directly or using the inventory pluggin that is included in this collection. + + +## Play workflow + +The teams playbook gathers information regarding centurion organisations from the ansible inventory. Using this information the play is designed to create new teams, patch permissions and patch notes. The workflow for the playbook is as follows + +- Fetch all organisations from centurion +- Fetch all existing teams within each organisation from centurion +- Fetch any teams to be created from inventory +- Create new teams +- Patch all teams with required permissions +- Patch all teams with required notes + + +## Configuration + +The teams playbook uses variables that are gathered from inventory +The expected structure of the inventory file is: + +```yaml +centurion_erp: + teams: + - name: "organisation name" + teams: + - name: "team-name" + permissions: [] + notes: "permissions must be a list" + +``` + +!!! tip "common teams" + Common teams can be created by using yaml anchors. This is useful when multiple organisations require a common team and permissions to be set. + + ```yaml + centurion_erp: + common_teams: + team_name: &team-name "team_name" + team_permissions: &team-name-permissions [] + team_name_notes: &team-name-notes "team_notes" + + ``` diff --git a/mkdocs.yml b/mkdocs.yml index d5ba070..43dfa44 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -29,6 +29,12 @@ nav: - projects/ansible/collection/centurion/index.md + - Playbooks: + + - projects/ansible/collection/centurion/playbooks/index.md + + - projects/ansible/collection/centurion/playbooks/teams.md + - Plugins: - projects/ansible/collection/centurion/plugins/index.md