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

ec2_win_password returns changed state but doesn't change anything #145

Closed
fd-davidtulloh opened this issue Jul 19, 2020 · 3 comments · Fixed by #283
Closed

ec2_win_password returns changed state but doesn't change anything #145

fd-davidtulloh opened this issue Jul 19, 2020 · 3 comments · Fixed by #283
Labels
affects_2.10 needs_info This issue requires further information. Please answer any outstanding questions needs_template This issue/PR has an incomplete description. Please fill in the proposed template correctly needs_triage

Comments

@fd-davidtulloh
Copy link

SUMMARY

On success, ec2_win_password returns a changed state.

However it doesn't change anything.

changed: [pdc.services.hq.adct -> localhost] => {
    "changed": true,
    "invocation": {
        "module_args": {
            "aws_access_key": null,
            "aws_secret_key": null,
            "debug_botocore_endpoint_logs": false,
            "ec2_url": null,
            "instance_id": "i-0216d76aa054cd14d",
            "key_data": null,
            "key_file": "- cut -",
            "key_passphrase": null,
            "profile": null,
            "region": "ap-southeast-2",
            "security_token": null,
            "validate_certs": true,
            "wait": false,
            "wait_timeout": 120
        }
    },
    "win_password": "-cut-"
}

Happy to prepare a pull request to change this, code change is minor.

However this is backwards incompatible, changes existing behaviour.

@fd-davidtulloh
Copy link
Author

workaround to produce what I believe is proper behaviour

  tasks:
    - ec2_win_password:
        instance_id: "{{ hostvars[inventory_hostname]['instance_id'] }}"
        key_file: "-cut-"
        region: ap-southeast-2
      delegate_to: localhost
      register: password
      changed_when: false
      failed_when: password.win_password == ""
    - set_fact: ansible_password="{{ password.win_password }}" #"
  vars:
    ansible_become: false

This is related to #142

@ansibullbot
Copy link

@fd-davidtulloh: Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.

Here are the items we could not find in your description:

  • issue type
  • ansible version
  • component name

Please set the description of this issue with this template:
https://github.com/raw/ansible/ansible/devel/.github/ISSUE_TEMPLATE/bug_report.md

click here for bot help

@ansibullbot ansibullbot added affects_2.10 needs_info This issue requires further information. Please answer any outstanding questions needs_template This issue/PR has an incomplete description. Please fill in the proposed template correctly needs_triage labels Aug 19, 2020
@nikhilpatne
Copy link
Contributor

@fd-davidtulloh I can work on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.10 needs_info This issue requires further information. Please answer any outstanding questions needs_template This issue/PR has an incomplete description. Please fill in the proposed template correctly needs_triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants