Ansible collection for Solarwinds

I have been slowly developing a decently large collection of Ansible modules and a dynamic inventory plugin over the last few years, and finally have it published to Ansible Galaxy. I thought this would be a good place to find new users for feedback and possibly more community contribution. My background is only in in Operations and Linux/Virtualization admin, so I'm sure there's plenty of network centric and administrative modules still to be developed. You can find the list of modules and plugins on Galaxy here: https://galaxy.ansible.com/ui/repo/published/jeisenbath/solarwinds/

Thanks!

  • Great work, Jeisen!! I am new to Ansible ,could help with this? I'd like to setup kind of a automated Alert suppersion on our environment.

  • If you aren't familiar with Ansible, I'd say the best place to look is always for any examples in the modules (either with ansible-doc module_name or the Documentation section on the Ansible Galaxy page) or for any example playbooks (would love to build on these in the collection as people find useful examples). In this case, I have an example task in the orion_node module for muting a node for 30 minutes.

    By default both of the unmanaged and muted states for orion_node will unmanage for one day. In the example playbook below, you could orchestrate muting a device being patched at the start of a playbook, then your maintenance tasks, followed with a task to unmute.

    ---
    - name: Patching playbook
      hosts: patching_hosts
      
      tasks:
        - name: Mute node in Solarwinds for one day
          jeisenbath.solarwinds.orion_node:
            hostname: "{{ solarwinds_host }}"
            username: "{{ solarwinds_username }}"
            password: "{{ solarwinds_password }}"
            state: muted
            name: "{{ inventory_hostname }}" # This assumes hostname = Caption
          delegate_to: localhost
        
        - name: Patching tasks
        ...
        
        - name: Unmute node in Solarwinds
          jeisenbath.solarwinds.orion_node:
            hostname: "{{ solarwinds_host }}"
            username: "{{ solarwinds_username }}"
            password: "{{ solarwinds_password }}"
            state: unmuted
            name: "{{ inventory_hostname }}" # This assumes hostname = Caption
          delegate_to: localhost
    ...

    I also utilize this when building infrastructure, creating a node and muting it until it's go-live date.

    - name: Mute node in Solarwinds for 30 minutes
      jeisenbath.solarwinds.orion_node:
        hostname: "{{ solarwinds_host }}"
        username: "{{ solarwinds_username }}"
        password: "{{ solarwinds_password }}"
        state: muted
        name: "{{ orion_node_caption }}"
        unmanage_until: "{{ some_datetime_string | to_datetime('%Y-%m-%d') }}Z"
      delegate_to: localhost

  • wonderful, i create many plays using SWIS api through powershell.... this is way better.

  • Thanks! I actually started this project way back because PowerOrion modules didn't install for powershell core, and didn't want to jump to a windows server just to run the old powershell scripts we had used.

  • I'd really like to see more of this... we're utilizing more and more of ansible and one area I've been investigating is keeping Orion agents for linux configured and installed the way I want on RedHat.  When we PXE boot a new RH host I want the agent installed and configured the way I want using ansible as part of the build process and PXE boot for new machines.  We already are doing the entire PXE boot process to setup clevis and tang for network bound disk encryption and to STIG our new hosts.  Perhaps thwack needs a community just for ansible?

    The trick seems to be we want ansible to be able to automatically install the Orion agent for the correct platform then configure the agent the way we like and be able to keep all the hosts configured and running this way.  We don't want to init the agent and manually configure each linux agent by hand each time... having to list resources, select what we want then submit.  Ansible should be able to do all of this for us and even like I stated above... do it during the PXE boot build process for every linux host we deploy.  This is the goal at least right now.

    Ask yourself this... would you like to manually configure each of 1000 linux hosts in Orion?  And then what happens when some of the agents start not responding or working the way they are supposed to?

    Bill