2020-03-09 10:11:07 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2020-04-13 08:23:38 +02:00
|
|
|
# Copyright (c) 2017-present Alibaba Group Holding Limited. He Guimin <heguimin36@163.com>
|
2022-08-05 12:28:29 +02:00
|
|
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2020-03-09 10:11:07 +01:00
|
|
|
|
2020-06-24 21:50:36 +02:00
|
|
|
from __future__ import (absolute_import, division, print_function)
|
|
|
|
__metaclass__ = type
|
|
|
|
|
2020-03-09 10:11:07 +01:00
|
|
|
|
|
|
|
class ModuleDocFragment(object):
|
|
|
|
|
|
|
|
# Alicloud only documentation fragment
|
|
|
|
DOCUMENTATION = r'''
|
|
|
|
options:
|
|
|
|
alicloud_access_key:
|
|
|
|
description:
|
2023-06-15 09:29:30 +02:00
|
|
|
- Alibaba Cloud access key. If not set then the value of environment variable E(ALICLOUD_ACCESS_KEY),
|
|
|
|
E(ALICLOUD_ACCESS_KEY_ID) will be used instead.
|
2020-04-13 08:23:38 +02:00
|
|
|
aliases: ['access_key_id', 'access_key']
|
2020-03-09 10:11:07 +01:00
|
|
|
type: str
|
|
|
|
alicloud_secret_key:
|
|
|
|
description:
|
2023-06-15 09:29:30 +02:00
|
|
|
- Alibaba Cloud secret key. If not set then the value of environment variable E(ALICLOUD_SECRET_KEY),
|
|
|
|
E(ALICLOUD_SECRET_ACCESS_KEY) will be used instead.
|
2020-04-13 08:23:38 +02:00
|
|
|
aliases: ['secret_access_key', 'secret_key']
|
2020-03-09 10:11:07 +01:00
|
|
|
type: str
|
|
|
|
alicloud_region:
|
|
|
|
description:
|
2020-04-13 08:23:38 +02:00
|
|
|
- The Alibaba Cloud region to use. If not specified then the value of environment variable
|
2023-06-15 09:29:30 +02:00
|
|
|
E(ALICLOUD_REGION), E(ALICLOUD_REGION_ID) will be used instead.
|
2020-04-13 08:23:38 +02:00
|
|
|
aliases: ['region', 'region_id']
|
|
|
|
required: true
|
2020-03-09 10:11:07 +01:00
|
|
|
type: str
|
|
|
|
alicloud_security_token:
|
|
|
|
description:
|
2020-04-13 08:23:38 +02:00
|
|
|
- The Alibaba Cloud security token. If not specified then the value of environment variable
|
2023-06-15 09:29:30 +02:00
|
|
|
E(ALICLOUD_SECURITY_TOKEN) will be used instead.
|
2020-04-13 08:23:38 +02:00
|
|
|
aliases: ['security_token']
|
|
|
|
type: str
|
|
|
|
alicloud_assume_role:
|
|
|
|
description:
|
|
|
|
- If provided with a role ARN, Ansible will attempt to assume this role using the supplied credentials.
|
2023-06-10 09:28:40 +02:00
|
|
|
- The nested assume_role block supports C(alicloud_assume_role_arn), C(alicloud_assume_role_session_name),
|
|
|
|
C(alicloud_assume_role_session_expiration) and C(alicloud_assume_role_policy).
|
2020-04-13 08:23:38 +02:00
|
|
|
type: dict
|
|
|
|
aliases: ['assume_role']
|
|
|
|
alicloud_assume_role_arn:
|
|
|
|
description:
|
2023-11-22 09:13:33 +01:00
|
|
|
- The Alibaba Cloud C(role_arn). The ARN of the role to assume. If ARN is set to an empty string,
|
2023-06-15 09:29:30 +02:00
|
|
|
it does not perform role switching. It supports environment variable E(ALICLOUD_ASSUME_ROLE_ARN).
|
2020-04-13 08:23:38 +02:00
|
|
|
ansible will execute with provided credentials.
|
|
|
|
aliases: ['assume_role_arn']
|
|
|
|
type: str
|
|
|
|
alicloud_assume_role_session_name:
|
|
|
|
description:
|
|
|
|
- The Alibaba Cloud session_name. The session name to use when assuming the role. If omitted,
|
|
|
|
'ansible' is passed to the AssumeRole call as session name. It supports environment variable
|
2023-06-15 09:29:30 +02:00
|
|
|
E(ALICLOUD_ASSUME_ROLE_SESSION_NAME).
|
2020-04-13 08:23:38 +02:00
|
|
|
aliases: ['assume_role_session_name']
|
|
|
|
type: str
|
|
|
|
alicloud_assume_role_session_expiration:
|
|
|
|
description:
|
2023-11-22 09:13:33 +01:00
|
|
|
- The Alibaba Cloud C(session_expiration). The time after which the established session for assuming
|
2020-04-13 08:23:38 +02:00
|
|
|
role expires. Valid value range 900-3600 seconds. Default to 3600 (in this case Alicloud use own default
|
2023-06-15 09:29:30 +02:00
|
|
|
value). It supports environment variable E(ALICLOUD_ASSUME_ROLE_SESSION_EXPIRATION).
|
2020-04-13 08:23:38 +02:00
|
|
|
aliases: ['assume_role_session_expiration']
|
|
|
|
type: int
|
|
|
|
ecs_role_name:
|
|
|
|
description:
|
|
|
|
- The RAM Role Name attached on a ECS instance for API operations. You can retrieve this from the 'Access Control'
|
|
|
|
section of the Alibaba Cloud console.
|
|
|
|
- If you're running Ansible from an ECS instance with RAM Instance using RAM Role, Ansible will just access the
|
|
|
|
metadata U(http://100.100.100.200/latest/meta-data/ram/security-credentials/<ecs_role_name>) to obtain the STS
|
|
|
|
credential. This is a preferred approach over any other when running in ECS as you can avoid hard coding
|
|
|
|
credentials. Instead these are leased on-the-fly by Ansible which reduces the chance of leakage.
|
|
|
|
aliases: ['role_name']
|
|
|
|
type: str
|
|
|
|
profile:
|
|
|
|
description:
|
|
|
|
- This is the Alicloud profile name as set in the shared credentials file. It can also be sourced from the
|
2023-06-15 09:29:30 +02:00
|
|
|
E(ALICLOUD_PROFILE) environment variable.
|
2020-04-13 08:23:38 +02:00
|
|
|
type: str
|
|
|
|
shared_credentials_file:
|
|
|
|
description:
|
2023-06-15 09:29:30 +02:00
|
|
|
- This is the path to the shared credentials file. It can also be sourced from the E(ALICLOUD_SHARED_CREDENTIALS_FILE)
|
2020-04-13 08:23:38 +02:00
|
|
|
environment variable.
|
2023-11-22 09:13:33 +01:00
|
|
|
- If this is not set and a profile is specified, C(~/.aliyun/config.json) will be used.
|
2020-03-09 10:11:07 +01:00
|
|
|
type: str
|
|
|
|
author:
|
2020-04-13 08:23:38 +02:00
|
|
|
- "He Guimin (@xiaozhu36)"
|
2020-03-09 10:11:07 +01:00
|
|
|
requirements:
|
2023-11-22 09:13:33 +01:00
|
|
|
- "Python >= 3.6"
|
2020-03-09 10:11:07 +01:00
|
|
|
notes:
|
|
|
|
- If parameters are not set within the module, the following
|
|
|
|
environment variables can be used in decreasing order of precedence
|
2023-06-15 09:29:30 +02:00
|
|
|
E(ALICLOUD_ACCESS_KEY) or E(ALICLOUD_ACCESS_KEY_ID),
|
|
|
|
E(ALICLOUD_SECRET_KEY) or E(ALICLOUD_SECRET_ACCESS_KEY),
|
|
|
|
E(ALICLOUD_REGION) or E(ALICLOUD_REGION_ID),
|
|
|
|
E(ALICLOUD_SECURITY_TOKEN),
|
|
|
|
E(ALICLOUD_ECS_ROLE_NAME),
|
|
|
|
E(ALICLOUD_SHARED_CREDENTIALS_FILE),
|
|
|
|
E(ALICLOUD_PROFILE),
|
|
|
|
E(ALICLOUD_ASSUME_ROLE_ARN),
|
|
|
|
E(ALICLOUD_ASSUME_ROLE_SESSION_NAME),
|
2023-11-22 09:13:33 +01:00
|
|
|
E(ALICLOUD_ASSUME_ROLE_SESSION_EXPIRATION).
|
2023-06-15 09:29:30 +02:00
|
|
|
- E(ALICLOUD_REGION) or E(ALICLOUD_REGION_ID) can be typically be used to specify the
|
2023-11-22 09:13:33 +01:00
|
|
|
Alicloud region, when required, but this can also be configured in the footmark config file
|
2020-03-09 10:11:07 +01:00
|
|
|
'''
|