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

chore: next release #43

Merged
merged 6 commits into from
Dec 31, 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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: 'CI'


on:
pull_request:
types:
- synchronize
# pull_request:
# types:
# - synchronize
push:
branches:
- '**'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ The inventory playbook includes the [AWX Feature](../../../playbooks/awx.md) to

The following job template will be created:

* **Centurion/ITAM/Inventory** Inventory host machines and publish to Centurion ERP
- **Centurion/ITAM/Inventory** Inventory host machines and publish to Centurion ERP

On import to AWX / Ansible Automation Platform a credential type will also be created, 'Collection/No Fuss Computing/Centurion/API' that can be used to supply the required secrets and Centurion host.


!!! warning
The inventory playbook currently has an issue relating to gathering software starting with L. This issue has been reported and is being worked on
[github issue 19](https://github.com/nofusscomputing/ansible_collection_centurion/issues/19)
The inventory playbook currently has an issue relating to gathering software starting with L. This issue has been reported and is being worked on [github issue 19](https://github.com/nofusscomputing/ansible_collection_centurion/issues/19)


## Play workflow
Expand All @@ -33,4 +32,3 @@ The inventory playbook conducts the follwoing tasks:
- Uploads the inventory report to Centurion ERP

- Cleans any leftover files used to create the reports

9 changes: 5 additions & 4 deletions docs/projects/ansible/collection/centurion/playbooks/teams.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ The teams playbook includes the [AWX Feature](../../../playbooks/awx.md) to impo

The following job template will be created:

* **Centurion/Access/Teams** Creation and patching of teams and permissions
- **Centurion/Access/Teams** Creation and patching of teams and permissions


!!! info
!!! info
The playbook is able to work with the [inventory plugin](../plugins/index.md) that is included in this collection.


Expand Down Expand Up @@ -56,7 +56,8 @@ centurion_erp:

!!! 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.

<!-- markdownlint-disable -->
<!-- markdownlint-disable-next-line code-block-style -->
```yaml
centurion_erp:
common_teams:
Expand All @@ -72,4 +73,4 @@ centurion_erp:
notes: *team-name-notes

```

<!-- markdownlint-restore -->
3 changes: 1 addition & 2 deletions playbooks/inventory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

- name: Inventory Software [a-k]
ansible.builtin.set_fact:
cacheable: false

Check warning on line 34 in playbooks/inventory.yaml

View workflow job for this annotation

GitHub Actions / Ansible Collection / Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ software | default([]) + [{ 'name': package.value[0].name, 'category': package.value[0].category | default(''), 'version': package.value[0].version }] }} -> {{ software | default([]) + [{'name': package.value[0].name, 'category': package.value[0].category | default(''), 'version': package.value[0].version}] }}
software: "{{ software | default([]) + [{
'name': package.value[0].name,
'category': package.value[0].category | default(''),
Expand Down Expand Up @@ -68,7 +68,7 @@

- name: Inventory Software [m-z]
ansible.builtin.set_fact:
cacheable: false

Check warning on line 71 in playbooks/inventory.yaml

View workflow job for this annotation

GitHub Actions / Ansible Collection / Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ software | default([]) + [{ 'name': package.value[0].name, 'category': package.value[0].category | default(''), 'version': package.value[0].version }] }} -> {{ software | default([]) + [{'name': package.value[0].name, 'category': package.value[0].category | default(''), 'version': package.value[0].version}] }}
software: "{{ software | default([]) + [{
'name': package.value[0].name,
'category': package.value[0].category | default(''),
Expand Down Expand Up @@ -96,7 +96,7 @@
}


- name: Save report

Check warning on line 99 in playbooks/inventory.yaml

View workflow job for this annotation

GitHub Actions / Ansible Collection / Lint

risky-file-permissions

File permissions unset or incorrect.
ansible.builtin.copy:
content: "{{ report | to_nice_json }}"
dest: "/tmp/{{ ansible_hostname }}.json"
Expand All @@ -105,7 +105,7 @@
- name: Upload inventory - {{ ansible_hostname }}
ansible.builtin.uri:
url: |-
{{ lookup('env', 'ITSM_API') }}/api/device/inventory
{{ lookup('env', 'ITSM_API') }}/api/v2/itam/inventory

method: POST
body_format: json
Expand Down Expand Up @@ -173,4 +173,3 @@
CENTURION_API: '{{ centurion_url }}'
CENTURION_TOKEN: '{{ centurion_token }}'
CENTURION_VALIDATE_CERTS: '{{ centurion_validate_certs | default(true) }}'

5 changes: 2 additions & 3 deletions playbooks/teams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
tasks:


- name: Confirm required vars exist

Check warning on line 17 in playbooks/teams.yaml

View workflow job for this annotation

GitHub Actions / Ansible Collection / Lint

run-once[task]

Using run_once may behave differently if strategy is set to free.
ansible.builtin.assert:
that:
- centurion_erp.teams is defined
Expand All @@ -30,10 +30,10 @@
delegate_to: localhost


- name: Collect organizations from centurion ERP

Check warning on line 33 in playbooks/teams.yaml

View workflow job for this annotation

GitHub Actions / Ansible Collection / Lint

run-once[task]

Using run_once may behave differently if strategy is set to free.
ansible.builtin.uri:
url: |-
{{ lookup('env', 'CENTURION_API') }}/api/organization/
{{ lookup('env', 'CENTURION_API') }}/api/v2/access/organization/
method: GET
body_format: json
headers:
Expand All @@ -49,7 +49,7 @@
{{ nfc_pb_disable_log | default(true) }}


- name: Collect teams from centurion ERP

Check warning on line 52 in playbooks/teams.yaml

View workflow job for this annotation

GitHub Actions / Ansible Collection / Lint

run-once[task]

Using run_once may behave differently if strategy is set to free.
ansible.builtin.uri:
url: "{{ item }}"
method: GET
Expand All @@ -68,9 +68,9 @@
{{ nfc_pb_disable_log | default(true) }}


- name: Create list of Teams

Check warning on line 71 in playbooks/teams.yaml

View workflow job for this annotation

GitHub Actions / Ansible Collection / Lint

run-once[task]

Using run_once may behave differently if strategy is set to free.
ansible.builtin.set_fact:
team_permissions: |

Check warning on line 73 in playbooks/teams.yaml

View workflow job for this annotation

GitHub Actions / Ansible Collection / Lint

jinja[spacing]

Jinja2 spacing could be improved: [
[
{% for config_organisation in centurion_erp.teams %}

Expand Down Expand Up @@ -132,10 +132,10 @@
{{ nfc_pb_disable_log | default(true) }}


- name: Create new teams in centurion_ERP

Check warning on line 135 in playbooks/teams.yaml

View workflow job for this annotation

GitHub Actions / Ansible Collection / Lint

run-once[task]

Using run_once may behave differently if strategy is set to free.
ansible.builtin.uri:
url: |-
{{ lookup('env', 'CENTURION_API') }}/api/organization/{{ item.organization_id }}/team
{{ lookup('env', 'CENTURION_API') }}/api/v2/access/organization/{{ item.organization_id }}/team
method: POST
body_format: json
body: |-
Expand All @@ -157,7 +157,7 @@
{{ nfc_pb_disable_log | default(true) }}


- name: Update permissions to include newly created teams

Check warning on line 160 in playbooks/teams.yaml

View workflow job for this annotation

GitHub Actions / Ansible Collection / Lint

run-once[task]

Using run_once may behave differently if strategy is set to free.
ansible.builtin.set_fact:
team_permissions: |
[
Expand Down Expand Up @@ -265,4 +265,3 @@
- permissions
- teams
use_fact_cache: true

Loading