Uploaded image for project: 'Puppet Task Runner'
  1. Puppet Task Runner
  2. BOLT-1265

target-lookup plugin to discover targets from a terraform state file.

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: BOLT 1.20.0
    • Component/s: None
    • Release Notes:
      New Feature
    • Release Notes Summary:
      Hide
      A new plugin was added to inventory v2 that can load terraform state and map resource properties to target parameters. This allows a terraform project to be
      used to dynamically determine the targets to use when running Bolt.
      Show
      A new plugin was added to inventory v2 that can load terraform state and map resource properties to target parameters. This allows a terraform project to be used to dynamically determine the targets to use when running Bolt.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Questions:

      • How will the user specify where the statefile is? A path to the terraform project, with an optional subpath key to the specific file
      • Is this config for the plugin or part of the lookup? Part of the lookup
      • How will the user specify the name of the target?
      • How will the user specify connection info(host)? Plugin configuration?
      • Is there anything we can do that is terraform specific?

      At least try shelling out to `tf state` - if it's not available fail. State server on it's own is not supported.

      Solution:

      {
      resource_type: resources.gce_instance.*
      uri: network.public_ip
      config:
        ssh:
          hostname: id
      }
      

      So you specify a resource_type which is the "scope" in terraform where your resource exists, specified in the terraform-dot-syntax. Below that you specify bolt config, where each config option accepts a terraform-dot-syntax scope for looking up fields in the top level syntax. Ideally this will also accept regexes.

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                nick Nick Lewis
                Reporter:
                alex Alex Dreyer
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: