netbox-community / ansible_modules

NetBox modules for Ansible using Ansible Collections
GNU General Public License v3.0
331 stars 210 forks source link

[Bug]: netbox_device_role creates slug always lowercase symbols #840

Open 2327 opened 2 years ago

2327 commented 2 years ago

Ansible NetBox Collection version

v3.7.1

Ansible version

ansible [core 2.12.7]
  config file = /ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/dist-packages/ansible
  ansible collection location = /ansible/.vendor_collections:/root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
  jinja version = 3.1.1
  libyaml = True

NetBox version

netbox-5cbd58dcd-vrtf9 (v3.3.4)

Python version

3.9

Steps to Reproduce

task from ansible:

- name: Create device roles
  netbox.netbox.netbox_device_role:
    netbox_url: "{{ netbox_url }}"
    netbox_token: "{{ netbox_token }}"
    data:
      name: "{{ role_type }}"
      slug: "{{ role_type }}"
      color: FFFFFF
    state: present

Expected Behavior

I expect device role slug to be created with uppercase symbols. I tried slug: "{{ role_type | upper }}"

Observed Behavior

device role slug is always created with lowercase symbols. For this reason ansible not picked up my group_vars. I have to change slug of device role manually and then I see the variables

ryanmerolle commented 1 year ago

I am lost, names allow upper case and spaces, slugs do not in netbox.