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

Rewrite ArgsRule to use output of ansible-doc for validating arguments #3831

Open
ssbarnea opened this issue Oct 10, 2023 · 1 comment
Open
Assignees

Comments

@ssbarnea
Copy link
Member

Current implementation of ArgsRule does run ansible modules with partial mocking and that causes lots of issues.

It should be seen safer to switch to use of output of ansible-doc for validating arguments.

Example of task that produces an ignored runtime exception

- name: Example
  hosts: localhost
  tasks:
    - name: Wait for DNS entries to propagate
      community.aws.route53_wait:
        results: "{{ acme_certificate_INTERNAL_route53_result }}"
        aws_access_key: "{{ acme_certificate_aws_access_key | default(omit) }}"
        aws_secret_key: "{{ acme_certificate_aws_secret_key | default(omit) }}"
@cidrblock
Copy link
Contributor

There isn't parity between the argspec and the doc. e.g. mutally_exclusive and required_if in this plugin: https://github.com/ansible-collections/cisco.nxos/blob/main/plugins/modules/nxos_config.py#L415

This is why the init of AnsibleModule is called b/c that's where the validation happens and catches all the additional attributes of the argspec that are not present in the doc string.

(https://github.com/ansible-collections/amazon.aws/blob/main/plugins/modules/autoscaling_group.py#L1960)

just some history here to provide some context about why it was done the way it was.

@audgirka audgirka removed the new Triage required label Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Roadmap
Development

No branches or pull requests

3 participants