Jira (BOLT-1265) target-lookup plugin to discover targets from a terraform state file.

0 views
Skip to first unread message

Alex Dreyer (JIRA)

unread,
Apr 23, 2019, 12:03:14 PM4/23/19
to puppe...@googlegroups.com
Alex Dreyer created an issue
 
Puppet Task Runner / New Feature BOLT-1265
target-lookup plugin to discover targets from a terraform state file.
Issue Type: New Feature New Feature
Assignee: Unassigned
Created: 2019/04/23 9:01 AM
Priority: Normal Normal
Reporter: Alex Dreyer

Questions:

  • How will the user specify where the statefile is? Is this config for the plugin or part of the lookup?
  • How will the user specify the name of the target?
  • How will the user specify connection info(host)?
  • Is there anything we can do that is terraform specific?
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Alex Dreyer (JIRA)

unread,
Apr 23, 2019, 12:16:27 PM4/23/19
to puppe...@googlegroups.com

Lucy Wyman (JIRA)

unread,
Apr 25, 2019, 1:34:03 PM4/25/19
to puppe...@googlegroups.com
Lucy Wyman updated an issue
Change By: Lucy Wyman
Questions:
- How will the user specify where the statefile is? Is this config for the plugin or part of the lookup?
- How will the user specify the name of the target?
- How will the user specify connection info(host)?
- Is there anything we can do that is terraform specific?

Always unconditionally print a warning to manually verify Puppet code as a comment at top of the plan

Run puppet plan through parser and validator and error if it's invalid (exit nonzero but still print plan)

Lucy Wyman (JIRA)

unread,
Apr 25, 2019, 1:52:05 PM4/25/19
to puppe...@googlegroups.com
Lucy Wyman updated an issue
Questions:
- How will the user specify where the statefile is? Is this config for the plugin or 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?

Always unconditionally print At least try shelling out to `tf state` - if it's not available fail. State server on it's own is not supported.
Need to have the terraform project directory path, and
a warning second optional path to manually verify Puppet code the statefile itself if you have multiple.
Should be passed
as a comment at top parameter to the lookup, as opposed to a way of configuring the plan lookup

Run puppet plan through parser and validator and error if it's invalid (exit nonzero but still print plan)

Lucy Wyman (JIRA)

unread,
Apr 25, 2019, 5:54:03 PM4/25/19
to puppe...@googlegroups.com
Lucy Wyman updated an issue
Questions:
- How will the user specify where the statefile is? Is this config for the plugin or 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.
Need to have the terraform project directory path, and a second optional path to the statefile itself if you have multiple.
Should be passed as a parameter to the lookup, as opposed to a way of configuring the lookup

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

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.

Lucy Wyman (JIRA)

unread,
Apr 26, 2019, 7:07:02 AM4/26/19
to puppe...@googlegroups.com
Lucy Wyman updated an issue
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.
Need to have the terraform project directory path, and a second optional path to the statefile itself if you have multiple.
Should be passed as a parameter to the lookup, as opposed to a way of configuring the lookup

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

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.

Lucy Wyman (JIRA)

unread,
Apr 26, 2019, 7:07:02 AM4/26/19
to puppe...@googlegroups.com

Lucy Wyman (JIRA)

unread,
Apr 30, 2019, 12:26:13 PM4/30/19
to puppe...@googlegroups.com

Nick Lewis (JIRA)

unread,
May 6, 2019, 5:08:03 PM5/6/19
to puppe...@googlegroups.com

Cas Donoghue (JIRA)

unread,
May 16, 2019, 12:19:03 PM5/16/19
to puppe...@googlegroups.com

Cas Donoghue (JIRA)

unread,
May 16, 2019, 12:19:03 PM5/16/19
to puppe...@googlegroups.com

Cas Donoghue (JIRA)

unread,
May 16, 2019, 12:23:03 PM5/16/19
to puppe...@googlegroups.com
Cas Donoghue updated an issue
Change By: Cas Donoghue
Release Notes Summary: 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.
Release Notes: New Feature

Melissa Amos (JIRA)

unread,
May 17, 2019, 12:54:03 PM5/17/19
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages