Jira (BOLT-1466) Inventory configuration precedence is confusing

0 views
Skip to first unread message

Lucy Wyman (JIRA)

unread,
Jul 10, 2019, 1:44:03 PM7/10/19
to puppe...@googlegroups.com
Lucy Wyman created an issue
 
Puppet Task Runner / Task BOLT-1466
Inventory configuration precedence is confusing
Issue Type: Task Task
Assignee: Unassigned
Created: 2019/07/10 10:43 AM
Priority: Normal Normal
Reporter: Lucy Wyman

If a node belongs to multiple groups in the inventory it will pick up config from the first group with that node in the inventory, event if `-n group2` is specified. This is expected but counterintuitive behavior.

Questions:

  • Should we document this exact case and explain in more detail inventory config?
  • Is there a way to use `bolt inventory show` to help users find where config is coming from?
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Kevin Reeuwijk (JIRA)

unread,
Jul 11, 2019, 4:48:03 AM7/11/19
to puppe...@googlegroups.com
Kevin Reeuwijk commented on Task BOLT-1466
 
Re: Inventory configuration precedence is confusing

Shouldn't the (expected) behavior be that if -n groupname is specified, that Bolt scopes its use of the inventoryfile to that group only?

Maybe the --nodes parameter is too ambiguous for this to work reliably, and a --group parameter is needed to more clearly communicate intent?

Dimitri Tischenko (JIRA)

unread,
Jul 11, 2019, 5:05:03 AM7/11/19
to puppe...@googlegroups.com

The confusion arises especially with dynamically populated groups. For instance, if using this group:

    targets:
      - _plugin: puppetdb
        query: "nodes[] { }"
    config:
      transport: pcp

one would assume that all targets dynamically acquired by the puppetdb plugin will be guaranteed to connect over pcp. However, due to the way inventory parsing is implemented, if that node name is defined elsewhere in the inventory file with a different transport, bolt will prefer that definition which is not what the user expects.

Dimitri Tischenko (JIRA)

unread,
Jul 11, 2019, 5:14:02 AM7/11/19
to puppe...@googlegroups.com

Just tested a work-around by placing the pcp group at the top of the inventory file. This effectively forces bolt to use the pcp transport for the nodes from puppetdb, but it creates an inverse problem: now, the transport for nodes defined further down in the inventoryfile is ignored - all nodes which are also member of the pcp group now connect over pcp.

Lucy Wyman (JIRA)

unread,
Jul 11, 2019, 1:47:03 PM7/11/19
to puppe...@googlegroups.com
Lucy Wyman commented on Task BOLT-1466

Making targets in the inventory context aware of how they are being invoked isn't feasible. When invoking a single group it's easy to know what context should take precedence - that of the group being invoked. But what if I invoke multiple groups that a node is a part of? Which group config should take precedence? What if I invoke the node by name, and it's a member of multiple groups?

The inventory is fundamentally a way of storing connection information about targets. Groups are just ways of short-handing a list of those targets and providing some precedence to config options, but they don't (and, as far in the future as I can see, won't) provide the context for those targets to be run in during a particular Bolt invocation.

Kevin Reeuwijk (JIRA)

unread,
Jul 11, 2019, 2:57:02 PM7/11/19
to puppe...@googlegroups.com

Can you force override the transport by specifying '--transport pcp' as a workaround?

Lucy Wyman (JIRA)

unread,
Aug 6, 2019, 12:38:04 PM8/6/19
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages