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

Revert "fixing update account_enabled bug in azure_rm_aduser.py" #535

Closed
wants to merge 8 commits into from
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Change Log

## v1.6.0 (2021-04-29)

### NEW MODULES
- azure_rm_search: Add new module to deploy Azure Cognitive Search 'azure_rm_cognitivesearch' ([#372](https://github.com/ansible-collections/azure/pull/372))
- azure_rm_search_info: Add new module to deploy Azure Cognitive Search 'azure_rm_cognitivesearch' ([#372](https://github.com/ansible-collections/azure/pull/372))
- azure_rm_apimanagementservice: Added new module for Azure API management service. ([#333](https://github.com/ansible-collections/azure/pull/333#))
- azure_rm_apimanagementservice_info: Added new module for Azure API management service. ([#333](https://github.com/ansible-collections/azure/pull/333#))
- azure_rm_virtualwan: Add new module relate with Virtual WAN ([#329](https://github.com/ansible-collections/azure/pull/329))
- azure_rm_virtualwan_info: Add new module relate with Virtual WAN ([#329](https://github.com/ansible-collections/azure/pull/329))
- azure_rm_vpnsite: Add new module relate with VPN site ([#328](https://github.com/ansible-collections/azure/pull/328))
- azure_rm_vpnsite_info: Add new module relate with VPN site ([#328](https://github.com/ansible-collections/azure/pull/328))
- azure_rm_vpnsitelink_info: Add new module relate with VPN site ([#328](https://github.com/ansible-collections/azure/pull/328))
- azure_rm_aduser: Add new module for AD Users ([#402](https://github.com/ansible-collections/azure/pull/402))
- azure_rm_aduser_info: Add new module for AD Users ([#402](https://github.com/ansible-collections/azure/pull/402))

### FEATURE ENHANCEMENT
- ignore-2.12: Add 2.11 to test matrix, add ignore-2.12.txt ([#480](https://github.com/ansible-collections/azure/pull/480))
- azure_rm_appgateway: Support subnet lookup for app gateway ([#451](https://github.com/ansible-collections/azure/pull/451))
- azure_rm_storageaccount: Update azure_rm_storageaccount relate test yml ([#488](https://github.com/ansible-collections/azure/pull/488))
- pr-pipeline: use python3.8 as default version,and using ubuntu20. ([#509](https://github.com/ansible-collections/azure/pull/509))

### BUG FIXING
- azure: Paultaiton 20210409 requirements doc ([#485](https://github.com/ansible-collections/azure/pull/485))
- azure_rm_storageaccount: Allow storage account type Premium_ZRS for FileStorage and BlockBlobStorage ([#482](https://github.com/ansible-collections/azure/pull/482))
- azure_rm_*: Fix sanity test related errors ([#506](https://github.com/ansible-collections/azure/pull/506))
- azure_rm: Fixing sanity test issue for ansible 2.11 ([#511](http://fanyi.youdao.com/?keyfrom=dict2.index))
- azure_rm: Fixing inventory issue ([#518](https://github.com/ansible-collections/azure/pull/518))
- azure_rm_aduser: fixing update account_enabled bug in azure_rm_aduser.py ([#524](https://github.com/ansible-collections/azure/pull/524))
- azure_rm_common: fixing ad related auth issue when using service principal. ([#525](https://github.com/ansible-collections/azure/pull/525))
- azure_rm_aduser: change class name of azure_rm_aduser ([#526](https://github.com/ansible-collections/azure/pull/526))


## v1.5.0 (2021-03-26)

### NEW MODULES
Expand Down
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace: azure
name: azcollection

# The version of the collection. Must be compatible with semantic versioning
version: 1.5.0
version: 1.6.0

# The path to the Markdown (.md) readme file. This path is relative to the root of the collection
readme: README.md
Expand Down
9 changes: 5 additions & 4 deletions plugins/module_utils/azure_rm_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1427,19 +1427,20 @@ def __init__(self, auth_source=None, profile=None, subscription_id=None, client_
else:
self._adfs_authority_url = self.credentials.get('adfs_authority_url')

# get resource from cloud environment
self._resource = self._cloud_environment.endpoints.active_directory_resource_id

if self.credentials.get('credentials') is not None:
# AzureCLI credentials
self.azure_credentials = self.credentials['credentials']
elif self.credentials.get('client_id') is not None and \
self.credentials.get('secret') is not None and \
self.credentials.get('tenant') is not None:

graph_resource = self._cloud_environment.endpoints.active_directory_graph_resource_id
rm_resource = self._cloud_environment.endpoints.resource_manager
self.azure_credentials = ServicePrincipalCredentials(client_id=self.credentials['client_id'],
secret=self.credentials['secret'],
tenant=self.credentials['tenant'],
cloud_environment=self._cloud_environment,
resource=graph_resource if self.is_ad_resource else rm_resource,
verify=self._cert_validation_mode == 'validate')

elif self.credentials.get('ad_user') is not None and \
Expand All @@ -1449,7 +1450,7 @@ def __init__(self, auth_source=None, profile=None, subscription_id=None, client_

self.azure_credentials = self.acquire_token_with_username_password(
self._adfs_authority_url,
self._resource,
self._cloud_environment.endpoints.active_directory_resource_id,
self.credentials['ad_user'],
self.credentials['password'],
self.credentials['client_id'],
Expand Down
18 changes: 9 additions & 9 deletions plugins/modules/azure_rm_aduser.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
pass


class AzureRMADUserInfo(AzureRMModuleBase):
class AzureRMADUser(AzureRMModuleBase):
def __init__(self):

self.module_arg_spec = dict(
Expand Down Expand Up @@ -271,13 +271,13 @@ def __init__(self):
required_together = [['attribute_name', 'attribute_value']]
required_one_of = [['odata_filter', 'attribute_name', 'object_id', 'user_principal_name']]

super(AzureRMADUserInfo, self).__init__(derived_arg_spec=self.module_arg_spec,
supports_check_mode=False,
supports_tags=False,
mutually_exclusive=mutually_exclusive,
required_together=required_together,
required_one_of=required_one_of,
is_ad_resource=True)
super(AzureRMADUser, self).__init__(derived_arg_spec=self.module_arg_spec,
supports_check_mode=False,
supports_tags=False,
mutually_exclusive=mutually_exclusive,
required_together=required_together,
required_one_of=required_one_of,
is_ad_resource=True)

def exec_module(self, **kwargs):

Expand Down Expand Up @@ -416,7 +416,7 @@ def to_dict(self, object):


def main():
AzureRMADUserInfo()
AzureRMADUser()


if __name__ == '__main__':
Expand Down