wagoodman/bridgy

Extend CSV inventory to support per-instance configurations

Open

#35 opened on Oct 3, 2018

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Python (52 forks)github user discovery
Hacktoberfest

Repository metrics

Stars
 (416 stars)
PR merge metrics
 (PR metrics pending)

Description

As hinted to in https://github.com/wagoodman/bridgy/issues/9#issuecomment-358994575 , it would be great to be able to map arbitrary CSV columns to instance parameters that override the global or inventory ssh configuration. For example, a CSV inventory with extra columns:

name, address, user, ssh-key
server-1, 123.87.123.223, admin, id_rsa.ss1
awesome-server-2, 22.54.21.123, frank, id_dsa.key42

Bridgy could take advantage of the extra information like so:

inventory:
  source:
    - type: csv
      name: on-site servers
      file: somefile.csv
      fields: name, address, user, ssh_key
      ssh:
        user: fields['user']
        options: -i fields['ssh_key']

The yaml format needs more thought, but that's the general idea (I'm open to suggestions).

Contributor guide