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

Add vars support to ansible watches #2138

Closed
Jamstah opened this issue Oct 30, 2019 · 0 comments · Fixed by #2147
Closed

Add vars support to ansible watches #2138

Jamstah opened this issue Oct 30, 2019 · 0 comments · Fixed by #2147
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. language/ansible Issue is related to an Ansible operator project

Comments

@Jamstah
Copy link
Contributor

Jamstah commented Oct 30, 2019

Feature Request

With ansible watches, you can specify a playbook or role, but cannot also specify vars. With the finalizer, you can also specify vars.

In my case, I am creating a number of CRDs with a similar function, it would be good to run them through the same playbook but with different vars. If I could specify the vars in the watch, it would make it really easy. Instead, I will have to use separate playbooks for each CRD that each call the same roles.

Example watches.yaml if vars were supported:

---
- version: v1alpha1
  group: example.com
  kind: ManagedNamespace1
  playbook: /opt/ansible/namespace.yml
  vars:
    kind: one
  watchClusterScopedResources: True
  finalizer:
    name: finalizer.example.com
    playbook: /opt/ansible/destroy.yml
- version: v1alpha1
  group: example.com
  kind: ManagedNamespace2
  playbook: /opt/ansible/namespace.yml
  vars:
    kind: two
  watchClusterScopedResources: True
  finalizer:
    name: finalizer.example.com
    playbook: /opt/ansible/destroy.yml
Jamstah added a commit to Jamstah/operator-sdk that referenced this issue Nov 2, 2019
This adds support for extra vars in top level watches for ansible, to allow for the same playbook to be used for multiple GVKs with different vars.

Fixes operator-framework#2138
Jamstah added a commit to Jamstah/operator-sdk that referenced this issue Nov 2, 2019
This adds support for extra vars in top level watches for ansible, to allow for the same playbook to be used for multiple GVKs with different vars.

Fixes operator-framework#2138
@asmacdo asmacdo added kind/feature Categorizes issue or PR as related to a new feature. language/ansible Issue is related to an Ansible operator project labels Nov 4, 2019
camilamacedo86 pushed a commit that referenced this issue Nov 6, 2019
This adds support for extra vars in top level watches for ansible, to allow for the same playbook to be used for multiple GVKs with different vars.

closes #2138
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. language/ansible Issue is related to an Ansible operator project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants