linode / linode/ansible_linode

[Feature]: Allow jinja expressions in filter values in inventory plugin

Open
#746 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
63
Forks
38
Avg merge
5d 20h
Merged PRs (30d)
7

Description

### Description

In a simple inventory.linode.yaml like the one below, the jinja2 lookup for api_token is properly expanded, but the lookup in the "tags" filter is not.

We ship this file for maintaining linode groups, and find it useful to set the group in the environment without having to include it explicitly in the inventory file.

### New/Affected Components

plugins/inventory/instance.yaml

### Example Ansible Config

```yaml
plugin: linode.cloud.instance
api_token: "{{ lookup('env', 'LINODE_CLI_TOKEN') }}"
tags:
- "{{ lookup('env', 'INVENTORY_GROUP') }}"
compose:
ansible_host: ipv4[0]
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with plugins/inventory/instance.yaml and compare how the api_token lookup is expanded with how values in the tags filter are processed. Verify the example Ansible configuration, including the INVENTORY_GROUP lookup, and consider the work complete when Jinja expressions in filter values are expanded consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.