Skip to content

[BUG] state variable can easily collide with other variables #31

@neilschelly

Description

@neilschelly

Describe the bug
I am getting a collision on the state variable that is defaulted to latest in this cookbook. Specifically, I use the aws_ec2 module for Ansible inventory. This will set a state on every host it discovers representing the instance state.

To Reproduce
Steps to reproduce the behavior:

  1. Use the aws_ec2 inventory for hosts.
  2. Run the playbook.
  3. See error
TASK [artis3n.tailscale : State Validation] **************************************************************************************************************************************
fatal: [tailscale_gateway]: FAILED! => {"changed": false, "msg": "'state' must be 'latest', 'present', or 'absent'."}

Expected behavior
The value for state should be latest, present, or absent. But if the instance was discovered by the aws_ec2 module, state will be something like:

{
    "code": 16,
    "name": "running"
}

Target (please complete the following information):

  • OS: N/A
  • Ansible version: 2.16.6
  • artis3n.tailscale version: 4.5.0
  • Tailscale version (set verbose to true): N/A

Additional context
Add any other context about the problem here.

I'm guessing the fix will be to rename the state variable to something like tailscale_state so that it's less likely at least to conflict with other playbooks or modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis bug is confirmed and can be reproduced.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions