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

Strategy Plugin support custom options #69668

Closed
kevin-j-smith opened this issue May 22, 2020 · 2 comments
Closed

Strategy Plugin support custom options #69668

kevin-j-smith opened this issue May 22, 2020 · 2 comments
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bot_closed feature This issue/PR relates to a feature request. has_pr This issue has an associated PR. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Comments

@kevin-j-smith
Copy link

SUMMARY

While developing a generic strategy for cross team consumption with my organization we determined that our teams custom strategy would benefit from configuration options. Similar to how other plugin types use documentation to define custom options.

An example document section:

DOCUMENTATION = '''
    strategy: whole-environment-task-orchestration
    short_description: Specializes in task orchestration particularly when clusters are not defined by inventory but by ansible local facts.
    description:
        - Dynamic Strategy based on host facts
    version_added: "2.0"
    notes:
     - My Custom Strategy implementation
    author: kevin-j-smith
    options:
        cluster_name_fact:
            description:
                - Fact used to define strategy's clustering
            env:
                - name: CLUSTER_NAME_FACT
            ini:
                - section: whole-environment-task-orchestration
                  key: cluster_name_fact
            required: True
'''

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

ansible.plugins.strategy custom plugins could also benefit from customization options as do many of the other plugin types.

ADDITIONAL INFORMATION

This feature would be used to allow custom strategy plugins the ability to have custom configuration through Ansible configuration options matching the pattern already defined by other plugins. It would solve the ability to dynamically change the behavior of my custom strategy through means similar to other plugins.

#ansible.cfg
[defaults]
strategy_plugins = /etc/ansible/plugins/strategy/whole-environment-task-orchestration-strategy
strategy = whole-environment-task-orchestration

[whole-environment-task-orchestration]
cluster_name_fact='my_special_task/cluster_name'
# inventory host specialized task that needs orchestration /etc/ansible/facts.d/my_special_task
{
  "cluster_name": "product_master_group"
}
#~/playbook.yaml
---
- name: run_special_task_on_all_hosts_in_environment
  hosts: all
  tasks:
    - name: simple
       debug: msg="strategy handled me by placing me in a group with others determined by my cluster_name"
@ansibot
Copy link
Contributor

ansibot commented May 22, 2020

Files identified in the description:
None

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.10 This issue/PR affects Ansible v2.10 feature This issue/PR relates to a feature request. needs_triage Needs a first human triage before being processed. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels May 22, 2020
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label May 26, 2020
@ansibot ansibot added the has_pr This issue has an associated PR. label May 26, 2020
@bcoca bcoca added the waiting_on_contributor This would be accepted but there are no plans to actively work on it. label Jul 23, 2021
@ansibot
Copy link
Contributor

ansibot commented Jul 25, 2022

Thank you very much for your submission to Ansible. It means a lot to us that you've taken time to contribute.

Unfortunately, this issue has been open for some time while waiting for a contributor to take it up but there does not seem to have been anyone that did so. So we are going to close this issue to clear up the queues and make it easier for contributors to browse possible implementation targets.

However, we're absolutely always up for discussion. Because this project is very active, we're unlikely to see comments made on closed tickets and we lock them after some time. If you or anyone else has any further questions, please let us know by using any of the communication methods listed in the page below:

In the future, sometimes starting a discussion on the development list prior to proposing or implementing a feature can make getting things included a little easier, but it's not always necessary.

Thank you once again for this and your interest in Ansible!

click here for bot help

@ansibot ansibot added bot_closed and removed waiting_on_contributor This would be accepted but there are no plans to actively work on it. labels Jul 25, 2022
@ansibot ansibot closed this as completed Jul 25, 2022
@ansible ansible locked and limited conversation to collaborators Aug 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 bot_closed feature This issue/PR relates to a feature request. has_pr This issue has an associated PR. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants