Merge pull request #44 from nofusscomputing/34-inventory-tracing
This commit is contained in:
@ -1,5 +1,26 @@
|
|||||||
# Contribution Guide
|
# Contribution Guide
|
||||||
|
|
||||||
|
First and foremost, thank you for your contribution. If at any stage you are stuck, confused or any other developer prone state, please ask for help.
|
||||||
|
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- Commit Messages use [conventional commit](https://www.conventionalcommits.org/en/v1.0.0/) format
|
||||||
|
- **ALL** CI jobs must pass. if they error, you can view the "details" for what went wrong.
|
||||||
|
|
||||||
|
- Ansible:
|
||||||
|
|
||||||
|
- Tasks must be named
|
||||||
|
- Task name must reflect their activity
|
||||||
|
- All task modules to use FQCN
|
||||||
|
- Don't be afraid of white space.
|
||||||
|
- Two blanks lines above tasks
|
||||||
|
- Two blank lines blow tasks
|
||||||
|
- One blank line at the end of the file
|
||||||
|
- Any task that "spills" a secret, must use `no_log`
|
||||||
|
|
||||||
|
|
||||||
|
## Dev Env
|
||||||
Development of this project has been setup to be done from VSCodium. The following additional requirements need to be met:
|
Development of this project has been setup to be done from VSCodium. The following additional requirements need to be met:
|
||||||
|
|
||||||
- npm has been installed. _required for `markdown` linting_
|
- npm has been installed. _required for `markdown` linting_
|
||||||
|
@ -102,24 +102,42 @@
|
|||||||
dest: "/tmp/{{ ansible_hostname }}.json"
|
dest: "/tmp/{{ ansible_hostname }}.json"
|
||||||
|
|
||||||
|
|
||||||
- name: Upload inventory - {{ ansible_hostname }}
|
- name: Try / catch
|
||||||
ansible.builtin.uri:
|
block:
|
||||||
url: |-
|
|
||||||
{{ lookup('env', 'ITSM_API') }}/api/v2/itam/inventory
|
|
||||||
|
|
||||||
method: POST
|
|
||||||
body_format: json
|
- name: Upload inventory - {{ ansible_hostname }}
|
||||||
src: "/tmp/{{ ansible_hostname }}.json"
|
ansible.builtin.uri:
|
||||||
remote_src: true
|
url: |-
|
||||||
headers:
|
{{ lookup('env', 'CENTURION_API') }}/api/v2/itam/inventory
|
||||||
Authorization: Token {{ lookup('env', 'ITSM_TOKEN') }}
|
|
||||||
validate_certs: "{{ lookup('env', 'ITSM_VALIDATE_CERTS') | default(true) | bool }}"
|
method: POST
|
||||||
timeout: 300
|
body_format: json
|
||||||
status_code:
|
src: "/tmp/{{ ansible_hostname }}.json"
|
||||||
- 200
|
remote_src: true
|
||||||
- 201
|
headers:
|
||||||
no_log: > # Contains a secret that logging shows
|
Authorization: Token {{ lookup('env', 'CENTURION_TOKEN') }}
|
||||||
{{ nfc_pb_disable_log | default(true) }}
|
validate_certs: "{{ lookup('env', 'CENTURION_VALIDATE_CERTS') | default(true) | bool }}"
|
||||||
|
timeout: 300
|
||||||
|
status_code:
|
||||||
|
- 200
|
||||||
|
- 201
|
||||||
|
no_log: > # Contains a secret that logging shows
|
||||||
|
{{ nfc_pb_disable_log | default(true) }}
|
||||||
|
register: api_post_inventory
|
||||||
|
|
||||||
|
|
||||||
|
always:
|
||||||
|
|
||||||
|
|
||||||
|
- name: Trace - Show Upload Details
|
||||||
|
ansible.builtin.debug:
|
||||||
|
- |
|
||||||
|
Upload failed with:
|
||||||
|
* URL: {{ api_post_inventory.url }}
|
||||||
|
* HTTP status code: {{ api_post_inventory.status }}
|
||||||
|
* Message: {{ api_post_inventory.msg }}
|
||||||
|
* Body: {{ api_post_inventory.json }}
|
||||||
|
|
||||||
|
|
||||||
always:
|
always:
|
||||||
@ -128,6 +146,7 @@
|
|||||||
path: "/tmp/{{ ansible_hostname }}.json"
|
path: "/tmp/{{ ansible_hostname }}.json"
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
|
|
||||||
nfc_pb_awx_tower_template:
|
nfc_pb_awx_tower_template:
|
||||||
|
Reference in New Issue
Block a user