MiamiOH / foreman_teamdynamix

A Foreman Plugin for TeamDynamix
GNU General Public License v3.0
1 stars 1 forks source link

foreman_teamdynamix

A Foreman Plugin for TeamDynamix. It manages a host's life cycle as a corresponding Asset in TeamDynamix.

Installation

To install foreman_teamdynamix require it in your gem file by adding the line.

gem 'foreman_teamdynamix'

Then update foreman to include the gem with the command.

bundle update foreman_teamdynamix

Configuration

To setup the configuration file create a new file named 'foreman_teamdynamix.yaml' at the location /etc/foreman/plugins/

If there is no configuration file then the tab should not appear on the detailed hosts screen, but if there is one and it is empty then it will appear without any fields.

Example Configuration

---
:teamdynamix:
  :api:
    :url: https://miamioh.teamdynamix.com/SBTDWebApi/api
    :appId: 741
    :username: 'xxxxxx'
    :password: 'xxxxxx'
    :create:
      StatusID: 641
      AcquisitionDate: host.created_at
      OwningCustomerName: "'foreman_teamdynamix_plugin_test'"
      Attributes:
      - Name: mu.ci.Lifecycle Status
        ID: 11634
        Value: 26190
      - Name: mu.ci.Description
        ID: 11632
        Value: >-
          "created by ForemanTeamdynamix plugin, owner is #{host.owner_id}"
      - Name: Ticket Routing Details
        ID: 11636
        Value: >-
          "Asset for host running on OS #{host.operatingsystem_id}"
    :delete:
      StatusId: 642
  :fields:
    :url: https://miamioh.teamdynamix.com/SBTDNext/Apps
    Asset ID: ID
    Owner: OwningCustomerName
    Parent Asset: ParentID
    mu.ci.Description: Attributes.mu.ci.Description
    Ticket Routing Details: Attributes.Ticket Routing Details
    mu.ci.Lifecycle Status: Attributes.mu.ci.Lifecycle Status

[:api][:create] or [:delete]

[:api][:create][Attributes]

[:fields]

Add additional host attribute

rake db:migrate

Verify the TeamDynamix Tab is loaded

Navigate to /hosts/, click on one of the listed host. There should be tabs: 'Properties', 'Metrics', 'Templates', 'NICs' and 'teamdynamix.title or Team Dynamix Tab'

Development mode

foreman running locally (i.e not installed via rpm/debian package) does not use settings from /etc/foreman/plugins/ Add the teamdynamix config to /config/settings.yaml

Rake Task

rake teamdynamix:sync:hosts

Scans the hosts and sync them with TeamDynamix.

Test mode

gem install foreman_teamdynamix --dev
rake test:foreman_teamdynamix