netbox-community / ansible_modules

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

[Feature]: create netbox_journal #636

Open ThomasADavis opened 2 years ago

ThomasADavis commented 2 years ago
ISSUE TYPE
SOFTWARE VERSIONS
NetBox:

Any netbox > 2.11.0 supports this.

SUMMARY

Support for creating/delete journals in ansible would be nice!

rodvand commented 2 years ago

@ThomasADavis How do you suggest we add this? Add this onto each module as a dictionary, or create a separate module for journals?

ThomasADavis commented 2 years ago

Our goal is to use the journal as an audit log of ansible runs against that object (device/vm) I want to place an Ansible ARA URL into the journal. So, yes, I'm happy to be the test subject, and try to document this. What hasn't been decide is do we modify a specific journal entry, appending runs to it, or create an separate journal entry for each run.

since it's an separate API call (/extras/journal-entries), and that api can create/modify existing entries, I would like to see a module 1st.

There's also /extras/image-attachments and /extras/webhooks which would be good to have.

I would look at the tags module, it's an /extras/tag api call..

Not sure if any of the other modules does 2 separate API calls.

ThomasADavis commented 2 years ago

so the tags and the config_context are /extra api modules. so, which name for this?

netbox_journal or netbox_extra_journal

ThomasADavis commented 2 years ago
{
  assigned_object_type* string
      title: Assigned object type
  assigned_object_id*   integer
      title: Assigned object id 
      maximum: 2147483647
      minimum: 0
  created_by    integer
       title: Created by
       x-nullable: true
  kind  string
      title: Kind
      Enum:  [ info, success, warning, danger ]
   comments*    string
      title: Comments
      minLength: 1
}

created_by == user_id kind == one of [ info, success, warning, danger ]

assigned_object_type can be: 'virtualization.virtualmachine' 'dcim.device' sites can have a journal entry. vlans can have a journal entry.

and so on.. makes it an individual module.

lookup module is missing journal support and few other extras..

rodvand commented 2 years ago

so the tags and the config_context are /extra api modules. so, which name for this?

netbox_journal or netbox_extra_journal

As no other modules has the extra/dcim/ipam prefix, I think a simplenetbox_journal should suffice. I can look into adding the lookup support for the few extras missing.

ThomasADavis commented 2 years ago

yea, I was going to add at least journal support to the lookup module and create the journal module, and then use both for the test part

but I've been slammed at work, so little free time.. we need journal support as an security audit showed us this to record ARA playbooks URL's.