Headers

Every playbook needs to start with the following header:

- name: Get Uptime Low Reason
hosts:
- "localhost"
gather_facts: False

Credentials

Indeni platform will provide the device Credentials. In order to do so, need to use the proper macros:

panos_op:
ip_address: '{{ ip_address }}'
username: '{{ username }}'
password: '{{ password }}'
cmd: 'show interface all'

Device Tags

Indeni platform pass the playbook all of the tags collected for the device during the interrogation process. The playbook can use it under the field device_tags

- name: Found vendor!!!
debug:
msg: "{{ device_tags.vendor }}"
when: device_tags.vendor is defined
- name: Found version!!!
debug:
msg: {{ device_tags['os.version'] }}"
when: device_tags['os.version'] is defined

Tasks

Each task should have a proper name, in order to visualize the results in a clear way

tasks:
- name: run show interface
panos_op:
ip_address: '{{ ip_address }}'
username: '{{ user_name }}'
password: '{{ password }}'
cmd: 'show interface all'
register: result
- name: result show interface
debug: msg='{{ result.stdout }}'

Adding the name for each task should be enforced as part of the code reviews.