| 1 |
.. _ansible_collections.microsoft.ad.docsite.guide_migration: |
| 2 |
|
| 3 |
*************** |
| 4 |
Migration guide |
| 5 |
*************** |
| 6 |
|
| 7 |
Some of the modules in this collection have come from the `ansible.windows collection <https://galaxy.ansible.com/ansible/windows>`_ or the `community.windows collection <https://galaxy.ansible.com/community/windows>`_. This document will go through some of the changes made to help ease the transition from the older modules to the ones in this collection. |
| 8 |
|
| 9 |
.. contents:: |
| 10 |
:local: |
| 11 |
:depth: 1 |
| 12 |
|
| 13 |
.. _ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules: |
| 14 |
|
| 15 |
Migrated Modules |
| 16 |
================ |
| 17 |
|
| 18 |
The following modules have been migrated in some shape or form into this collection |
| 19 |
|
| 20 |
* ``ansible.windows.win_domain`` -> ``microsoft.ad.domain`` - :ref:`details <ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain>` |
| 21 |
* ``ansible.windows.win_domain_controller`` -> ``microsoft.ad.domain_controller`` - :ref:`details <ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_controller>` |
| 22 |
* ``ansible.windows.win_domain_membership`` -> ``microsoft.ad.membership`` - :ref:`details <ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_membership>` |
| 23 |
* ``community.windows.win_domain_computer`` -> ``microsoft.ad.computer`` - :ref:`details <ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_computer>` |
| 24 |
* ``community.windows.win_domain_group`` -> ``microsoft.ad.group`` - :ref:`details <ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_group>` |
| 25 |
* ``community.windows.win_domain_group_membership`` -> ``microsoft.ad.group`` - :ref:`details <ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_group_membership>` |
| 26 |
* ``community.windows.win_domain_object_info`` -> ``microsoft.ad.object_info`` - :ref:`details <ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_object_info>` |
| 27 |
* ``community.windows.win_domain_ou`` -> ``microsoft.ad.ou`` - :ref:`details <ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_ou>` |
| 28 |
* ``community.windows.win_domain_user`` -> ``microsoft.ad.user`` - :ref:`details <ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_user>` |
| 29 |
|
| 30 |
While these modules are mostly drop in place compatible there are some breaking changes that need to be considered. See each module entry for more information. |
| 31 |
|
| 32 |
.. _ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain: |
| 33 |
|
| 34 |
Module ``win_domain`` |
| 35 |
--------------------- |
| 36 |
|
| 37 |
Migrated to :ref:`microsoft.ad.domain <ansible_collections.microsoft.ad.domain_module>`. |
| 38 |
|
| 39 |
There are no known breaking changes and should work as a drop in replacement. The ``reboot`` option has been added to have the module handle any reboots that are needed instead of a separate ``ansible.windows.win_reboot`` task. Due to the operations involved with promoting a domain controller, it is highly recommended to use this option. |
| 40 |
|
| 41 |
.. _ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_controller: |
| 42 |
|
| 43 |
Module ``win_domain_controller`` |
| 44 |
-------------------------------- |
| 45 |
|
| 46 |
Migrated to :ref:`microsoft.ad.domain_controller <ansible_collections.microsoft.ad.domain_controller_module>`. |
| 47 |
|
| 48 |
The following options have been removed: |
| 49 |
|
| 50 |
* ``log_path`` - Creating a debug log of module actions is not supported |
| 51 |
|
| 52 |
The ``reboot`` option has been added to have the module handle any reboots instead of a separate ``ansible.windows.win_reboot`` task. Due to the operations involved with promoting a domain controller, it is highly recommended to use this option. |
| 53 |
|
| 54 |
.. _ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_membership: |
| 55 |
|
| 56 |
Module ``win_domain_membership`` |
| 57 |
-------------------------------- |
| 58 |
|
| 59 |
Migrated to :ref:`microsoft.ad.membership <ansible_collections.microsoft.ad.membership_module>`. |
| 60 |
|
| 61 |
The following options have been removed: |
| 62 |
|
| 63 |
* ``log_path`` - Creating a debug log of module actions is not supported |
| 64 |
|
| 65 |
The ``reboot`` option has been added to have the module handle any reboots instead of a separate ``ansible.windows.win_reboot`` task. |
| 66 |
|
| 67 |
.. _ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_computer: |
| 68 |
|
| 69 |
Module ``win_domain_computer`` |
| 70 |
------------------------------ |
| 71 |
|
| 72 |
Migrated to :ref:`microsoft.ad.computer <ansible_collections.microsoft.ad.computer_module>`. |
| 73 |
|
| 74 |
The option ``dns_host_name`` is not required when ``state: present``, the computer object is created without the ``dnsHostName`` LDAP attribute set if it is not defined. |
| 75 |
|
| 76 |
The default for ``enabled`` is nothing, the group will still be enabled when created but it will use the existing status if the option is omitted. |
| 77 |
|
| 78 |
The option ``ou`` is now named ``path`` to match the standard set by other modules. |
| 79 |
|
| 80 |
The options ``offline_domain_join`` and ``odj_blob_path`` has been removed. Use the new module ``microsoft.ad.offline_join`` to generate the offline join blob. For example: |
| 81 |
|
| 82 |
.. code-block:: yaml |
| 83 |
|
| 84 |
- name: create computer object |
| 85 |
microsoft.ad.computer: |
| 86 |
name: MyComputer |
| 87 |
state: present |
| 88 |
register: computer_obj |
| 89 |
|
| 90 |
- name: create offline blob |
| 91 |
microsoft.ad.offline_join: |
| 92 |
identity: '{{ computer_obj.object_guid }}' |
| 93 |
when: computer_obj is changed |
| 94 |
register: offline_blob |
| 95 |
|
| 96 |
- name: display offline blob |
| 97 |
debug: |
| 98 |
var: offline_blob.blob |
| 99 |
when: computer_obj is changed |
| 100 |
|
| 101 |
.. _ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_group: |
| 102 |
|
| 103 |
Module ``win_domain_group`` |
| 104 |
--------------------------- |
| 105 |
|
| 106 |
Migrated to :ref:`microsoft.ad.group <ansible_collections.microsoft.ad.group_module>`. |
| 107 |
|
| 108 |
The following options have changed: |
| 109 |
|
| 110 |
* ``attributes`` - changed format as outlined in :ref:`Attributes guid <ansible_collections.microsoft.ad.docsite.guide_attributes>` |
| 111 |
* ``ignore_protection`` - Has been removed and ``state: absent`` will also remove objects regardless of the protection status |
| 112 |
* ``organizational_unit`` and ``ou`` - Have been removed, use ``path`` instead |
| 113 |
* ``protect`` - Has been renamed to ``protect_from_deletion`` and is now not needed to be unset for ``state: absent`` to remove the group |
| 114 |
|
| 115 |
The return values for ``win_domain_group`` have also been simplified to only return: |
| 116 |
|
| 117 |
* ``distinguished_name`` - The Distinguished Name (``DN``) of the managed OU |
| 118 |
* ``object_guid`` - The Object GUID of the managed OU |
| 119 |
* ``sid`` - The Security Identifier of the managed user |
| 120 |
|
| 121 |
All other return values have been removed, use ``microsoft.ad.object_info`` to get extra values if needed. |
| 122 |
|
| 123 |
.. _ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_group_membership: |
| 124 |
|
| 125 |
Module ``win_domain_group_membership`` |
| 126 |
-------------------------------------- |
| 127 |
|
| 128 |
Migrated to :ref:`microsoft.ad.group <ansible_collections.microsoft.ad.group_module>`. |
| 129 |
|
| 130 |
The functionality of this module has been merged with ``microsoft.ad.group``. Use the ``members`` option to ``add``, ``remove``, or ``set`` to add, remove, or set group members respectively. |
| 131 |
|
| 132 |
One change is ``win_domain_group_membership`` could specify the server to lookup the member using the ``SERVER\member-name`` format. This member format is not supported in ``microsoft.ad.group`` but since v1.6.0 of this collection the same can be achieved by using a dictionary as the member value. For example: |
| 133 |
|
| 134 |
.. code-block:: yaml |
| 135 |
|
| 136 |
- name: Add a domain user/group from another Domain in the multi-domain forest to a domain group |
| 137 |
community.windows.win_domain_group_membership: |
| 138 |
name: GroupinDomainAAA |
| 139 |
domain_server: DomainAAA.cloud |
| 140 |
members: |
| 141 |
- DomainBBB.cloud\UserInDomainBBB |
| 142 |
state: present |
| 143 |
|
| 144 |
- name: Add a domain user/group from another Domain in the multi-domain forest to a domain group |
| 145 |
microsoft.ad.group: |
| 146 |
name: GroupinDomainAAA |
| 147 |
domain_server: DomainAAA.cloud |
| 148 |
members: |
| 149 |
add: |
| 150 |
- name: UserInDomainBBB |
| 151 |
server: DomainBBB.cloud |
| 152 |
state: present |
| 153 |
|
| 154 |
See :ref:`DN Lookup Attributes <ansible_collections.microsoft.ad.docsite.guide_attributes.dn_lookup_attributes>` for more information. |
| 155 |
|
| 156 |
.. _ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_object_info: |
| 157 |
|
| 158 |
Module ``win_domain_object_info`` |
| 159 |
--------------------------------- |
| 160 |
|
| 161 |
Migrated to :ref:`microsoft.ad.object_info <ansible_collections.microsoft.ad.object_info_module>`. |
| 162 |
|
| 163 |
There are no known breaking changes and should work as a drop in replacement. |
| 164 |
|
| 165 |
.. _ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_ou: |
| 166 |
|
| 167 |
Module ``win_domain_ou`` |
| 168 |
------------------------ |
| 169 |
|
| 170 |
Migrated to :ref:`microsoft.ad.ou <ansible_collections.microsoft.ad.ou_module>`. |
| 171 |
|
| 172 |
The following options have changed: |
| 173 |
|
| 174 |
* ``protected`` - Has been renamed to ``protect_from_deletion`` and is now not needed to be unset for ``state: absent`` to remove the OU |
| 175 |
* ``recursive`` - Has been removed and ``state: absent`` will also remove objects recursively |
| 176 |
* ``filter`` - Has been removed, the ``name`` object refers to the OU name and ``identity`` can be used to select the OU by ``DistinguishedName`` or ``ObjectGUID`` if a rename or move is needed |
| 177 |
* ``properties`` - Has been removed, use the new ``attributes`` option |
| 178 |
|
| 179 |
The return values for ``win_domain_ou`` have also been simplified to only return: |
| 180 |
|
| 181 |
* ``distinguished_name`` - The Distinguished Name (``DN``) of the managed OU |
| 182 |
* ``object_guid`` - The Object GUID of the managed OU |
| 183 |
|
| 184 |
All other return values have been removed, use ``microsoft.ad.object_info`` to get extra values if needed. |
| 185 |
|
| 186 |
.. _ansible_collections.microsoft.ad.docsite.guide_migration.migrated_modules.win_domain_user: |
| 187 |
|
| 188 |
Module ``win_domain_user`` |
| 189 |
-------------------------- |
| 190 |
|
| 191 |
Migrated to :ref:`microsoft.ad.user <ansible_collections.microsoft.ad.user_module>`. |
| 192 |
|
| 193 |
The following options have changed: |
| 194 |
|
| 195 |
* ``attributes`` - changed format as outlined in :ref:`Attributes guid <ansible_collections.microsoft.ad.docsite.guide_attributes>` |
| 196 |
* ``delegates`` - changed format as outlined in :ref:`Setting list values <ansible_collections.microsoft.ad.docsite.guide_list_values>` |
| 197 |
* ``groups`` - changed format as outlined in :ref:`Setting list values <ansible_collections.microsoft.ad.docsite.guide_list_values>` |
| 198 |
* ``groups_action`` - has been removed in favour of the new ``groups`` format |
| 199 |
* ``groups_missing_behaviour`` - has been moved into the ``group`` dictionary value as ``missing_behaviour`` |
| 200 |
* ``spn``- changed format as outlined in :ref:`Setting list values <ansible_collections.microsoft.ad.docsite.guide_list_values>` |
| 201 |
* ``spn_action`` - has been removed in favour of the new ``spn`` format |
| 202 |
* ``state`` - No query option - use ``microsoft.ad.object_info`` instead |
| 203 |
* ``enabled`` - Does not default to ``true``. Creating a new user without a password will use ``enabled=false`` but setting a password will use ``enabled=true`` |
| 204 |
|
| 205 |
The ``groups_action`` and ``spn_action`` ``set`` value was renamed to align with common practice. The ``state=query`` functionality has been removed to simplify the module and favour ``microsoft.ad.object_info`` which is designed to return information about AD objects. The ``enabled`` default was removed to allow setting other attributes on an existing AD object without always having to specify ``enabled``. |
| 206 |
|
| 207 |
The return values for ``win_domain_user`` have also been simplified to only return: |
| 208 |
|
| 209 |
* ``distinguished_name`` - The Distinguished Name (``DN``) of the managed user |
| 210 |
* ``object_guid`` - The Object GUID of the managed user |
| 211 |
* ``sid`` - The Security Identifier of the managed user |
| 212 |
|
| 213 |
All other return values have been removed, use ``microsoft.ad.object_info`` to get extra values if needed. |