updated netboxinventory state
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
2986915dc7
commit
993fa3f591
@ -7,17 +7,23 @@ netboxinventory-dependencies:
|
|||||||
{% set nodename = salt['grains.get']('nodename') %}
|
{% set nodename = salt['grains.get']('nodename') %}
|
||||||
{% set location = salt['grains.get']('location') %}
|
{% set location = salt['grains.get']('location') %}
|
||||||
{% set type = salt['grains.get']('type') %}
|
{% set type = salt['grains.get']('type') %}
|
||||||
|
{% if salt['smbios.get']('system-manufacturer') %}
|
||||||
{% set manufacturer = salt['smbios.get']('system-manufacturer') %}
|
{% set manufacturer = salt['smbios.get']('system-manufacturer') %}
|
||||||
{% set model = salt['smbios.get']('system-product-name') %}
|
{% else %}{% set manufacturer = "none" %}{% endif %}
|
||||||
|
|
||||||
{%- if salt['netbox.get'](app='dcim', endpoint='manufacturers', name=manufacturer) == {} %}
|
{% if salt['smbios.get']('system-manufacturer') %}
|
||||||
|
{% set model = salt['smbios.get']('system-product-name') %}
|
||||||
|
{% else %}{% set model = "none" %}{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
{%- if not salt['netbox.get'](app='dcim', endpoint='manufacturers', name=manufacturer) %}
|
||||||
netbox.create_manufacturer_{{ manufacturer|md5 }}:
|
netbox.create_manufacturer_{{ manufacturer|md5 }}:
|
||||||
module.run:
|
module.run:
|
||||||
- name: netbox.create_manufacturer
|
- name: netbox.create_manufacturer
|
||||||
- m_name: "{{ manufacturer }}"
|
- m_name: "{{ manufacturer }}"
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{%- if salt['netbox.get'](app='dcim', endpoint='device-types', model=model) == {} %}
|
{%- if not salt['netbox.get'](app='dcim', endpoint='device-types', model=model) %}
|
||||||
netbox.create_device_type_{{ model|md5 }}:
|
netbox.create_device_type_{{ model|md5 }}:
|
||||||
module.run:
|
module.run:
|
||||||
- name: netbox.create_device_type
|
- name: netbox.create_device_type
|
||||||
|
Loading…
Reference in New Issue
Block a user