Skip to content

microsoft.ad.computer - Parameter "ProtectedFromAccidentalDeletion" cannot be found #47

Closed
@rsigari

Description

SUMMARY
ISSUE TYPE
  • Bug Report
COMPONENT NAME
  • microsoft.ad.computer
ANSIBLE VERSION
ansible 2.10.17
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/share/venv/lib/python3.7/site-packages/ansible
  executable location = /usr/share/venv/bin/ansible
  python version = 3.7.5 (default, Jun  8 2023, 02:25:10) [GCC 7.3.0]
COLLECTION VERSION
ansible-galaxy 2.10.17
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/share/venv/lib/python3.7/site-packages/ansible
  executable location = /usr/share/venv/bin/ansible-galaxy
  python version = 3.7.5 (default, Jun  8 2023, 02:25:10) [GCC 7.3.0]
Using /etc/ansible/ansible.cfg as config file

# /usr/share/ansible/collections/ansible_collections
Collection   Version
------------ -------
microsoft.ad 1.2.0  

# /usr/share/venv/lib/python3.7/site-packages/ansible_collections
Collection   Version
------------ -------
microsoft.ad 1.2.0  
CONFIGURATION
ansible-config 2.10.17
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/share/venv/lib/python3.7/site-packages/ansible
  executable location = /usr/share/venv/bin/ansible-config
  python version = 3.7.5 (default, Jun  8 2023, 02:25:10) [GCC 7.3.0]
Using /etc/ansible/ansible.cfg as config file
ANSIBLE_FORCE_COLOR(env: ANSIBLE_FORCE_COLOR) = True
ANSIBLE_SSH_ARGS(/etc/ansible/ansible.cfg) = -o ControlMaster=auto -o ControlPersist=120s
ANSIBLE_SSH_RETRIES(/etc/ansible/ansible.cfg) = 3
CACHE_PLUGIN(/etc/ansible/ansible.cfg) = ansible.builtin.jsonfile
CACHE_PLUGIN_CONNECTION(/etc/ansible/ansible.cfg) = ./tmp/ansible_facts
COLLECTIONS_PATHS(/etc/ansible/ansible.cfg) = ['/root/.ansible/collections', '/ws1dev/collections', '/usr/share/ansible/collections']
DEFAULT_ACTION_PLUGIN_PATH(env: ANSIBLE_ACTION_PLUGINS) = ['/usr/share/venv/lib/python3.7/site-packages/ara/plugins/action']
DEFAULT_CALLBACK_PLUGIN_PATH(env: ANSIBLE_CALLBACK_PLUGINS) = ['/usr/share/venv/lib/python3.7/site-packages/ara/plugins/callback']
DEFAULT_CALLBACK_WHITELIST(env: ANSIBLE_CALLBACK_WHITELIST) = ['profile_tasks', 'timer', 'junit']
DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 25
DEFAULT_GATHERING(/etc/ansible/ansible.cfg) = smart
DEFAULT_LOAD_CALLBACK_PLUGINS(/etc/ansible/ansible.cfg) = True
DEFAULT_LOOKUP_PLUGIN_PATH(env: ANSIBLE_LOOKUP_PLUGINS) = ['/usr/share/venv/lib/python3.7/site-packages/ara/plugins/lookup']
DEFAULT_MANAGED_STR(/etc/ansible/ansible.cfg) = Ansible Managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}
DEFAULT_ROLES_PATH(/etc/ansible/ansible.cfg) = ['/root/.ansible/roles', '/ws1dev/roles', '/usr/share/ansible/roles']
DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = yaml
DEFAULT_VERBOSITY(env: ANSIBLE_VERBOSITY) = 3
DEPRECATION_WARNINGS(/etc/ansible/ansible.cfg) = False
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
RETRY_FILES_ENABLED(/etc/ansible/ansible.cfg) = True
RETRY_FILES_SAVE_PATH(/etc/ansible/ansible.cfg) = /etc/ansible/tmp
OS / ENVIRONMENT
  • Testing on a Windows 2019
STEPS TO REPRODUCE
  • Try to add a computer object with the following flag using "microsoft.ad.computer" module:
    protect_from_deletion: true
- Pass the following dictionary for the module to consume:
# AD objects Dictionary
ado_computers:
  - name: "{{ inventory_hostname }}"
    sam_account_name: "{{ inventory_hostname }}"
    dns_hostname: "{{ inventory_hostname }}.test.lab"
    description: "{{ inventory_hostname }} is a test object"
    ou_dn: CN=Computers,DC=test,DC=lab
    enabled: true
    protect_from_deletion: true
    type: computer
    path: CN=Computers,DC=test,DC=lab
EXPECTED RESULTS
  • Computer object gets created successfully with the "protect_from_deletion" attribute as true
ACTUAL RESULTS
  • Task fails as below:
"msg": "New-ADComputer failed: A parameter cannot be found that matches parameter name 'ProtectedFromAccidentalDeletion'."

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions