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

win_domain_group_membership: Group members can't be set when state is pure #256

Closed
CathalMullan opened this issue May 29, 2021 · 2 comments

Comments

@CathalMullan
Copy link

SUMMARY

When setting the members of a group using win_domain_group_membership, they are added then removed within the same task.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

win_domain_group_membership

ANSIBLE VERSION
ansible [core 2.11.1]
  config file = /home/cathal/workspace/ansible/ansible.cfg
  configured module search path = ['/home/cathal/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/cathal/workspace/ansible/.venv/lib/python3.9/site-packages/ansible
  ansible collection location = /home/cathal/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/cathal/workspace/ansible/.venv/bin/ansible
  python version = 3.9.2 (default, Mar 24 2021, 13:57:04) [GCC 7.5.0]
  jinja version = 3.0.1
  libyaml = True
CONFIGURATION
DEFAULT_FORKS(/home/cathal/workspace/ansible/ansible.cfg) = 50
DEFAULT_GATHERING(/home/cathal/workspace/ansible/ansible.cfg) = smart
DEFAULT_HOST_LIST(/home/cathal/workspace/ansible/ansible.cfg) = ['/home/cathal/workspace/ansible/vagrant.ini']
DEFAULT_LOAD_CALLBACK_PLUGINS(/home/cathal/workspace/ansible/ansible.cfg) = True
DEFAULT_POLL_INTERVAL(/home/cathal/workspace/ansible/ansible.cfg) = 3
DEFAULT_ROLES_PATH(/home/cathal/workspace/ansible/ansible.cfg) = ['/home/cathal/workspace/ansible/roles']
DEFAULT_STDOUT_CALLBACK(/home/cathal/workspace/ansible/ansible.cfg) = yaml
DEPRECATION_WARNINGS(/home/cathal/workspace/ansible/ansible.cfg) = True
DISPLAY_SKIPPED_HOSTS(/home/cathal/workspace/ansible/ansible.cfg) = False
HOST_KEY_CHECKING(/home/cathal/workspace/ansible/ansible.cfg) = False
INVENTORY_ENABLED(/home/cathal/workspace/ansible/ansible.cfg) = ['ini', 'yaml']
OS / ENVIRONMENT

Target OS is Windows Server 2019.

STEPS TO REPRODUCE
  1. Create a new domain group
  2. Add a domain group member with state set to pure
- name: Create database group
  community.windows.win_domain_group:
    name: database_group
    scope: global

- name: Set database group members
  community.windows.win_domain_group_membership:
    name: database_group
    state: pure
    members:
      - "DATABASE$"
EXPECTED RESULTS

The member is added to group.

ACTUAL RESULTS

The member is added and removed within the same task, resulting in the member not actually being added to the group.

# v1.4.0
changed: [controller] => changed=true
  added:
  - DATABASE$
  members: []
  removed:
  - DATABASE$

This worked as expected on v1.3.0, the issue seems to have been introduced with v1.4.0.

# v1.3.0
changed: [controller] => changed=true
  added:
  - DATABASE$
  members:
  - DATABASE$
  removed: []
@jborean93
Copy link
Collaborator

Thanks for the pickup, this is the only PR to touch that module so will have to look into why it's now acting like this and fix it up for the next release #204.

@jborean93
Copy link
Collaborator

This should be fixed with #264, thanks @dihmandrake for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants