Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically create targets with options #3369

Open
jameslikeslinux opened this issue Dec 21, 2024 · 0 comments
Open

Dynamically create targets with options #3369

jameslikeslinux opened this issue Dec 21, 2024 · 0 comments
Labels
Feature New features and improvements.

Comments

@jameslikeslinux
Copy link

Use Case

I want to target containers I create within a plan and differentiate my target's name and uri. Since apply blocks get trusted.certname from the target name, I don't want it to be my container's name. Currently, this is possible for statically defined targets in the inventory.yaml, but the get_target function only lets you generate new targets by uri.

Describe the Solution You Would Like

get_target should take a second, optional parameter, for specifying config options for the target.

plan example {
  run_command('podman run --name my-container-name ...')

  $container_target = get_target('my-trusted-app', uri => 'podman://my-container-name', config => {...})
  OR
  $container_target = get_target('podman://my-container-name', name => 'my-trusted-app', config => {...})

  apply($container_target) {
    notice($trusted['certname']) # my-trusted-app
  }
}

Describe Alternatives You've Considered

Targets could be pre-specified in the inventory, but then my plan loses its generic functionality.

@jameslikeslinux jameslikeslinux added the Feature New features and improvements. label Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New features and improvements.
Projects
None yet
Development

No branches or pull requests

1 participant