updated netboxinventory state
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Paul 2023-01-20 13:24:50 +01:00
parent 2986915dc7
commit 993fa3f591

View File

@ -7,17 +7,23 @@ netboxinventory-dependencies:
{% set nodename = salt['grains.get']('nodename') %}
{% set location = salt['grains.get']('location') %}
{% set type = salt['grains.get']('type') %}
{% if 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 }}:
module.run:
- name: netbox.create_manufacturer
- m_name: "{{ manufacturer }}"
{%- 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 }}:
module.run:
- name: netbox.create_device_type