Skip to content

Commit

Permalink
Update azure_rm_roledefinition related document (ansible#57927)
Browse files Browse the repository at this point in the history
* Update azure_rm_roledefinition related documentation
  • Loading branch information
Fred-sun authored and acozine committed Jun 19, 2019
1 parent f656959 commit 8cff96e
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 67 deletions.
27 changes: 15 additions & 12 deletions lib/ansible/modules/cloud/azure/azure_rm_roledefinition.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
---
module: azure_rm_roledefinition
version_added: "2.8"
short_description: Manage Azure Role Definition.
short_description: Manage Azure Role Definition
description:
- Create, update and delete instance of Azure Role Definition.
Expand Down Expand Up @@ -48,26 +48,28 @@
- List of denied data actions.
type: list
assignable_scopes:
description: List of assignable scope of this definition.
description:
- List of assignable scopes of this definition.
scope:
description: The scope of the role definition.
description:
- The scope of the role definition.
description:
description:
- The role definition description.
state:
description:
- Assert the state of the role definition.
- Use 'present' to create or update a role definition and 'absent' to delete it.
default: present
choices:
- absent
- present
description:
- Assert the state of the role definition.
- Use C(present) to create or update a role definition; use C(absent) to delete it.
default: present
choices:
- absent
- present
extends_documentation_fragment:
- azure
author:
- "Yunge Zhu(@yungezz)"
- Yunge Zhu(@yungezz)
'''

Expand All @@ -87,7 +89,8 @@

RETURN = '''
id:
description: Id of current role definition.
description:
- ID of current role definition.
returned: always
type: str
sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleDefinitions/roleDefinitionId"
Expand Down
116 changes: 61 additions & 55 deletions lib/ansible/modules/cloud/azure/azure_rm_roledefinition_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
---
module: azure_rm_roledefinition_facts
version_added: "2.8"
short_description: Get Azure Role Definition facts.
short_description: Get Azure Role Definition facts
description:
- Get facts of Azure Role Definition.
Expand All @@ -30,9 +30,11 @@
description:
- Role definition id.
role_name:
description: Role name.
description:
- Role name.
type:
description: Type of role.
description:
- Type of role.
choices:
- system
- custom
Expand All @@ -41,7 +43,7 @@
- azure
author:
- "Yunge Zhu(@yungezz)"
- Yunge Zhu(@yungezz)
'''

Expand All @@ -58,60 +60,64 @@

RETURN = '''
roledefinitions:
description: A list of Role Definition facts.
description:
- A list of Role Definition facts.
returned: always
type: complex
contains:
id:
description: Role Definition id.
returned: always
type: str
sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
role_name:
description: Role name.
returned: always
type: str
sample: myCustomRoleDefinition
name:
description: System assigned role name.
returned: always
type: str
sample: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
assignable_scopes:
description:
- List of assignable scope of this definition.
returned: always
type: list
sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup"
permissions:
description:
- List of Role Definition peremissions.
returned: always
contains:
actions:
description:
- List of allowed actions.
returned: always
type: list
sample: Microsoft.Compute/virtualMachines/read
not_actions:
description:
- List of denied actions.
returned: always
type: list
sample: Microsoft.Compute/virtualMachines/write
data_actions:
description:
- List of allowed data actions.
returned: always
type: list
sample: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read
not_data_actions:
description:
- List of denied actions.
returned: always
type: list
sample: Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write
id:
description:
- Role Definition ID.
returned: always
type: str
sample: "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Authorization/roleDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
role_name:
description:
- Role name.
returned: always
type: str
sample: myCustomRoleDefinition
name:
description:
- System assigned role name.
returned: always
type: str
sample: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
assignable_scopes:
description:
- List of assignable scopes of this definition.
returned: always
type: list
sample: [ "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup" ]
permissions:
description:
- List of Role Definition permissions.
returned: always
contains:
actions:
description:
- List of allowed actions.
returned: always
type: list
sample: [ 'Microsoft.Compute/virtualMachines/read' ]
not_actions:
description:
- List of denied actions.
returned: always
type: list
sample: [ 'Microsoft.Compute/virtualMachines/write' ]
data_actions:
description:
- List of allowed data actions.
returned: always
type: list
sample: [ 'Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read' ]
not_data_actions:
description:
- List of denied data actions.
returned: always
type: list
sample: [ 'Microsoft.Storage/storageAccounts/blobServices/containers/blobs/write' ]
'''

from ansible.module_utils.azure_rm_common import AzureRMModuleBase
Expand Down

0 comments on commit 8cff96e

Please sign in to comment.