Refreshed modules

This commit is contained in:
Chris Houseknecht
2017-04-05 07:29:33 -04:00
parent 8a7f78993f
commit c5f86cc9b8
158 changed files with 5973 additions and 3158 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_binding
@@ -124,7 +124,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -347,17 +347,16 @@ binding:
def main():
try:
module = OpenShiftAnsibleModule('binding', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('binding', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_component_status
@@ -87,7 +87,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -294,17 +294,16 @@ component_status:
def main():
try:
module = OpenShiftAnsibleModule('component_status', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('component_status', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_component_status_list
@@ -65,7 +65,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -312,17 +312,16 @@ component_status_list:
def main():
try:
module = OpenShiftAnsibleModule('component_status_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('component_status_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_config_map
@@ -112,7 +112,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -301,17 +301,16 @@ config_map:
def main():
try:
module = OpenShiftAnsibleModule('config_map', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('config_map', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_config_map_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -318,17 +318,16 @@ config_map_list:
def main():
try:
module = OpenShiftAnsibleModule('config_map_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('config_map_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_endpoints
@@ -116,7 +116,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -456,17 +456,16 @@ endpoints:
def main():
try:
module = OpenShiftAnsibleModule('endpoints', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('endpoints', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_endpoints_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -474,17 +474,16 @@ endpoints_list:
def main():
try:
module = OpenShiftAnsibleModule('endpoints_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('endpoints_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_event
@@ -172,7 +172,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -437,17 +437,16 @@ event:
def main():
try:
module = OpenShiftAnsibleModule('event', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('event', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_event_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -396,17 +396,16 @@ event_list:
def main():
try:
module = OpenShiftAnsibleModule('event_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('event_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_horizontal_pod_autoscaler
@@ -143,7 +143,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -395,17 +395,16 @@ horizontal_pod_autoscaler:
def main():
try:
module = OpenShiftAnsibleModule('horizontal_pod_autoscaler', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('horizontal_pod_autoscaler', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_horizontal_pod_autoscaler_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -381,17 +381,16 @@ horizontal_pod_autoscaler_list:
def main():
try:
module = OpenShiftAnsibleModule('horizontal_pod_autoscaler_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('horizontal_pod_autoscaler_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_job
@@ -355,7 +355,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -2142,80 +2142,6 @@ job:
if the port is other than default (typically TCP ports
860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should populate
this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this setting.
This might be in conflict with other options that affect
the file mode, like fsGroup, and the result can be other
mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API
version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must be
a value between 0 and 0777. If not specified, the
volume defaultMode will be used. This might be in
conflict with other options that affect the file mode,
like fsGroup, and the result can be other mode bits
set.'
type: int
name:
description:
- "Required: Name is the relative path name of the file\
\ to be created. Must not be absolute or contain the\
\ '..' path. Must be utf-8 encoded. The first item\
\ of the relative path must not start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the pod.
@@ -2486,17 +2412,16 @@ job:
def main():
try:
module = OpenShiftAnsibleModule('job', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('job', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_job_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -1934,82 +1934,6 @@ job_list:
ip_addr:port if the port is other than default (typically
TCP ports 860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should
populate this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this
setting. This might be in conflict with other options
that affect the file mode, like fsGroup, and the result
can be other mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified
API version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must
be a value between 0 and 0777. If not specified,
the volume defaultMode will be used. This might
be in conflict with other options that affect
the file mode, like fsGroup, and the result can
be other mode bits set.'
type: int
name:
description:
- "Required: Name is the relative path name of the\
\ file to be created. Must not be absolute or\
\ contain the '..' path. Must be utf-8 encoded.\
\ The first item of the relative path must not\
\ start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory,
requests.cpu and requests.memory) are currently
supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed
resources, defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the
@@ -2308,17 +2232,16 @@ job_list:
def main():
try:
module = OpenShiftAnsibleModule('job_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('job_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_limit_range
@@ -113,7 +113,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -340,17 +340,16 @@ limit_range:
def main():
try:
module = OpenShiftAnsibleModule('limit_range', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('limit_range', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_limit_range_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -356,17 +356,16 @@ limit_range_list:
def main():
try:
module = OpenShiftAnsibleModule('limit_range_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('limit_range_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_namespace
@@ -114,18 +114,18 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
- name: Create a namespace
k8s_v1_namespace:
name: k8s-project
k8s_v1_namespace.yml:
name: k8s-namespace
state: present
- name: Add labels and annotations
k8s_v1_namespace:
name: k8s-project
k8s_v1_namespace.yml:
name: k8s-namespace
state: present
labels:
app_env: production
@@ -134,8 +134,8 @@ EXAMPLES = '''
domain: namespace.com.acmecorp
- name: Update labels and annotations
k8s_v1_namespace:
name: k8s-project
k8s_v1_namespace.yml:
name: k8s-namespace
state: present
labels:
app_env: production
@@ -146,8 +146,8 @@ EXAMPLES = '''
monitoring_group: '1'
- name: Create a namespace
k8s_v1_namespace:
name: search-project
k8s_v1_namespace.yml:
name: search-namespace
state: present
labels:
app: web
@@ -156,8 +156,8 @@ EXAMPLES = '''
company: acme.com
- name: Replace namespace
k8s_v1_namespace:
name: search-project
k8s_v1_namespace.yml:
name: search-namespace
state: replaced
labels:
app: web_app
@@ -166,8 +166,8 @@ EXAMPLES = '''
company: acme.com
- name: Remove namespace
k8s_v1_namespace:
name: search-project
k8s_v1_namespace.yml:
name: search-namespace
state: absent
'''
@@ -368,17 +368,16 @@ namespace:
def main():
try:
module = OpenShiftAnsibleModule('namespace', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('namespace', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_namespace_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -332,17 +332,16 @@ namespace_list:
def main():
try:
module = OpenShiftAnsibleModule('namespace_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('namespace_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_node
@@ -130,7 +130,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -498,17 +498,16 @@ node:
def main():
try:
module = OpenShiftAnsibleModule('node', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('node', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_node_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -498,17 +498,16 @@ node_list:
def main():
try:
module = OpenShiftAnsibleModule('node_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('node_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_persistent_volume
@@ -556,10 +556,20 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
- name: Create persitent volume
k8s_v1_persistent_volume.yml:
name: mypv
state: present
capacity:
storage: 1Gi
access_modes:
- ReadWriteOnce
persistent_volume_reclaim_policy: Recycle
host_path_path: /tmp/test_volume
'''
RETURN = '''
@@ -1269,17 +1279,16 @@ persistent_volume:
def main():
try:
module = OpenShiftAnsibleModule('persistent_volume', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('persistent_volume', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_persistent_volume_claim
@@ -148,10 +148,19 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
- name: Create persitent volume claim
k8s_v1_persistent_volume_claim.yml:
name: mypvc
namespace: demo_project
state: present
access_modes:
- ReadWriteOnce
resources_requests:
storage: 1Gi
'''
RETURN = '''
@@ -420,17 +429,16 @@ persistent_volume_claim:
def main():
try:
module = OpenShiftAnsibleModule('persistent_volume_claim', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('persistent_volume_claim', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_persistent_volume_claim_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -403,17 +403,16 @@ persistent_volume_claim_list:
def main():
try:
module = OpenShiftAnsibleModule('persistent_volume_claim_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('persistent_volume_claim_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_persistent_volume_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -848,17 +848,16 @@ persistent_volume_list:
def main():
try:
module = OpenShiftAnsibleModule('persistent_volume_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('persistent_volume_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_pod
@@ -278,7 +278,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -1768,77 +1768,6 @@ pod:
if the port is other than default (typically TCP ports 860 and
3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should populate this
volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default. Must
be a value between 0 and 0777. Defaults to 0644. Directories within
the path are not affected by this setting. This might be in conflict
with other options that affect the file mode, like fsGroup, and
the result can be other mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations, labels,
name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written in terms
of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must be a value
between 0 and 0777. If not specified, the volume defaultMode
will be used. This might be in conflict with other options
that affect the file mode, like fsGroup, and the result can
be other mode bits set.'
type: int
name:
description:
- "Required: Name is the relative path name of the file to be\
\ created. Must not be absolute or contain the '..' path.\
\ Must be utf-8 encoded. The first item of the relative path\
\ must not start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources limits
and requests (limits.cpu, limits.memory, requests.cpu and
requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional for env
vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the pod.
@@ -2267,17 +2196,16 @@ pod:
def main():
try:
module = OpenShiftAnsibleModule('pod', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('pod', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_pod_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -1625,77 +1625,6 @@ pod_list:
if the port is other than default (typically TCP ports 860
and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should populate
this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default. Must
be a value between 0 and 0777. Defaults to 0644. Directories
within the path are not affected by this setting. This might
be in conflict with other options that affect the file mode,
like fsGroup, and the result can be other mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written in
terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must be a value
between 0 and 0777. If not specified, the volume defaultMode
will be used. This might be in conflict with other options
that affect the file mode, like fsGroup, and the result
can be other mode bits set.'
type: int
name:
description:
- "Required: Name is the relative path name of the file\
\ to be created. Must not be absolute or contain the '..'\
\ path. Must be utf-8 encoded. The first item of the relative\
\ path must not start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources limits
and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional for
env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the pod.
@@ -2148,17 +2077,16 @@ pod_list:
def main():
try:
module = OpenShiftAnsibleModule('pod_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('pod_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_pod_template
@@ -301,7 +301,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -1983,77 +1983,6 @@ pod_template:
if the port is other than default (typically TCP ports 860
and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should populate
this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default. Must
be a value between 0 and 0777. Defaults to 0644. Directories
within the path are not affected by this setting. This might
be in conflict with other options that affect the file mode,
like fsGroup, and the result can be other mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written in
terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must be a value
between 0 and 0777. If not specified, the volume defaultMode
will be used. This might be in conflict with other options
that affect the file mode, like fsGroup, and the result
can be other mode bits set.'
type: int
name:
description:
- "Required: Name is the relative path name of the file\
\ to be created. Must not be absolute or contain the '..'\
\ path. Must be utf-8 encoded. The first item of the relative\
\ path must not start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources limits
and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional for
env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the pod.
@@ -2255,17 +2184,16 @@ pod_template:
def main():
try:
module = OpenShiftAnsibleModule('pod_template', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('pod_template', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_pod_template_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -1820,80 +1820,6 @@ pod_template_list:
if the port is other than default (typically TCP ports
860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should populate
this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this setting.
This might be in conflict with other options that affect
the file mode, like fsGroup, and the result can be other
mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API
version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must be
a value between 0 and 0777. If not specified, the
volume defaultMode will be used. This might be in
conflict with other options that affect the file mode,
like fsGroup, and the result can be other mode bits
set.'
type: int
name:
description:
- "Required: Name is the relative path name of the file\
\ to be created. Must not be absolute or contain the\
\ '..' path. Must be utf-8 encoded. The first item\
\ of the relative path must not start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the pod.
@@ -2123,17 +2049,16 @@ pod_template_list:
def main():
try:
module = OpenShiftAnsibleModule('pod_template_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('pod_template_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_replication_controller
@@ -325,7 +325,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -2065,80 +2065,6 @@ replication_controller:
if the port is other than default (typically TCP ports
860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should populate
this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this setting.
This might be in conflict with other options that affect
the file mode, like fsGroup, and the result can be other
mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API
version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must be
a value between 0 and 0777. If not specified, the
volume defaultMode will be used. This might be in
conflict with other options that affect the file mode,
like fsGroup, and the result can be other mode bits
set.'
type: int
name:
description:
- "Required: Name is the relative path name of the file\
\ to be created. Must not be absolute or contain the\
\ '..' path. Must be utf-8 encoded. The first item\
\ of the relative path must not start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the pod.
@@ -2403,17 +2329,16 @@ replication_controller:
def main():
try:
module = OpenShiftAnsibleModule('replication_controller', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('replication_controller', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_replication_controller_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -1888,82 +1888,6 @@ replication_controller_list:
ip_addr:port if the port is other than default (typically
TCP ports 860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should
populate this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this
setting. This might be in conflict with other options
that affect the file mode, like fsGroup, and the result
can be other mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified
API version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must
be a value between 0 and 0777. If not specified,
the volume defaultMode will be used. This might
be in conflict with other options that affect
the file mode, like fsGroup, and the result can
be other mode bits set.'
type: int
name:
description:
- "Required: Name is the relative path name of the\
\ file to be created. Must not be absolute or\
\ contain the '..' path. Must be utf-8 encoded.\
\ The first item of the relative path must not\
\ start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory,
requests.cpu and requests.memory) are currently
supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed
resources, defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the
@@ -2256,17 +2180,16 @@ replication_controller_list:
def main():
try:
module = OpenShiftAnsibleModule('replication_controller_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('replication_controller_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_resource_quota
@@ -120,7 +120,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -334,17 +334,16 @@ resource_quota:
def main():
try:
module = OpenShiftAnsibleModule('resource_quota', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('resource_quota', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_resource_quota_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -343,17 +343,16 @@ resource_quota_list:
def main():
try:
module = OpenShiftAnsibleModule('resource_quota_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('resource_quota_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_scale
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -297,17 +297,16 @@ scale:
def main():
try:
module = OpenShiftAnsibleModule('scale', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('scale', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_secret
@@ -124,7 +124,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -327,17 +327,16 @@ secret:
def main():
try:
module = OpenShiftAnsibleModule('secret', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('secret', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_secret_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -332,17 +332,16 @@ secret_list:
def main():
try:
module = OpenShiftAnsibleModule('secret_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('secret_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_service
@@ -198,12 +198,12 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
- name: Create service
k8s_v1_service:
k8s_v1_service.yml:
name: myservice
namespace: k8s-project
state: present
@@ -216,7 +216,7 @@ EXAMPLES = '''
type: ClusterIP
- name: Patch service
k8s_v1_service:
k8s_v1_service.yml:
name: myservice
namespace: k8s-project
state: present
@@ -233,7 +233,7 @@ EXAMPLES = '''
type: NodePort
- name: Create service
k8s_v1_service:
k8s_v1_service.yml:
name: myservice01
namespace: k8s-project
state: present
@@ -247,7 +247,7 @@ EXAMPLES = '''
type: ClusterIP
- name: Patch service
k8s_v1_service:
k8s_v1_service.yml:
name: myservice01
namespace: k8s-project
state: present
@@ -260,7 +260,7 @@ EXAMPLES = '''
name: http
- name: Repace service
k8s_v1_service:
k8s_v1_service.yml:
name: myservice01
namespace: k8s-project
state: replaced
@@ -608,17 +608,16 @@ service:
def main():
try:
module = OpenShiftAnsibleModule('service', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('service', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_service_account
@@ -119,7 +119,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -355,17 +355,16 @@ service_account:
def main():
try:
module = OpenShiftAnsibleModule('service_account', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('service_account', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_service_account_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -366,17 +366,16 @@ service_account_list:
def main():
try:
module = OpenShiftAnsibleModule('service_account_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('service_account_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_service_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -468,17 +468,16 @@ service_list:
def main():
try:
module = OpenShiftAnsibleModule('service_list', 'V1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('service_list', 'V1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1alpha1_certificate_signing_request
@@ -125,7 +125,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -360,17 +360,16 @@ certificate_signing_request:
def main():
try:
module = OpenShiftAnsibleModule('certificate_signing_request', 'V1alpha1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('certificate_signing_request', 'V1alpha1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1alpha1_certificate_signing_request_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -362,17 +362,16 @@ certificate_signing_request_list:
def main():
try:
module = OpenShiftAnsibleModule('certificate_signing_request_list', 'V1alpha1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('certificate_signing_request_list', 'V1alpha1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,362 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1alpha1_cluster_role
short_description: Kubernetes ClusterRole
description:
- Manage the lifecycle of a cluster_role object. Supports check mode, and attempts
to to be idempotent.
version_added: 2.3.0
author: OpenShift (@openshift)
options:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource that may
be set by external tools to store and retrieve arbitrary metadata. They are
not queryable and should be preserved when modifying objects.
type: dict
api_key:
description:
- Token used to connect to the API.
cert_file:
description:
- Path to a certificate used to authenticate with the API.
type: path
context:
description:
- The name of a context found in the Kubernetes config file.
debug:
description:
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
default: false
type: bool
force:
description:
- If set to C(True), and I(state) is C(present), an existing object will updated,
and lists will be replaced, rather than merged.
default: false
type: bool
host:
description:
- Provide a URL for acessing the Kubernetes API.
key_file:
description:
- Path to a key file used to authenticate with the API.
type: path
kubeconfig:
description:
- Path to an existing Kubernetes config file. If not provided, and no other connection
options are provided, the openshift client will attempt to load the default
configuration file from I(~/.kube/config.json).
type: path
labels:
description:
- Map of string keys and values that can be used to organize and categorize (scope
and select) objects. May match selectors of replication controllers and services.
type: dict
name:
description:
- Name must be unique within a namespace. Is required when creating resources,
although some resources may allow a client to request the generation of an appropriate
name automatically. Name is primarily intended for creation idempotence and
configuration definition. Cannot be updated.
namespace:
description:
- Namespace defines the space within each name must be unique. An empty namespace
is equivalent to the "default" namespace, but "default" is the canonical representation.
Not all objects are required to be scoped to a namespace - the value of this
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
password:
description:
- Provide a password for connecting to the API. Use in conjunction with I(username).
resource_definition:
description:
- Provide the YAML definition for the object, bypassing any modules parameters
intended to define object attributes.
type: dict
rules:
description:
- Rules holds all the PolicyRules for this ClusterRole
type: list
src:
description:
- Provide a path to a file containing the YAML definition of the object. Mutually
exclusive with I(resource_definition).
type: path
ssl_ca_cert:
description:
- Path to a CA certificate used to authenticate with the API.
type: path
state:
description:
- Determines if an object should be created, patched, or deleted. When set to
C(present), the object will be created, if it does not exist, or patched, if
parameter values differ from the existing object's attributes, and deleted,
if set to C(absent). A patch operation results in merging lists and updating
dictionaries, with lists being merged into a unique set of values. If a list
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
is performed, where individual elements with a matching I(name_) or I(type)
are merged. To force the replacement of lists, set the I(force) option to C(True).
default: present
choices:
- present
- absent
username:
description:
- Provide a username for connecting to the API.
verify_ssl:
description:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- kubernetes == 1.0.0
'''
EXAMPLES = '''
'''
RETURN = '''
api_version:
type: string
description: Requested API version
cluster_role:
type: complex
returned: when I(state) = C(present)
contains:
api_version:
description:
- APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
type: str
kind:
description:
- Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to. Cannot
be updated. In CamelCase.
type: str
metadata:
description:
- Standard object's metadata.
type: complex
contains:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource that
may be set by external tools to store and retrieve arbitrary metadata.
They are not queryable and should be preserved when modifying objects.
type: complex
contains: str, str
cluster_name:
description:
- The name of the cluster which the object belongs to. This is used to distinguish
resources with same name and namespace in different clusters. This field
is not set anywhere right now and apiserver is going to ignore it if set
in create or update request.
type: str
creation_timestamp:
description:
- CreationTimestamp is a timestamp representing the server time when this
object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC. Populated by the system. Read-only. Null
for lists.
type: complex
contains: {}
deletion_grace_period_seconds:
description:
- Number of seconds allowed for this object to gracefully terminate before
it will be removed from the system. Only set when deletionTimestamp is
also set. May only be shortened. Read-only.
type: int
deletion_timestamp:
description:
- DeletionTimestamp is RFC 3339 date and time at which this resource will
be deleted. This field is set by the server when a graceful deletion is
requested by the user, and is not directly settable by a client. The resource
is expected to be deleted (no longer visible from resource lists, and
not reachable by name) after the time in this field. Once set, this value
may not be unset or be set further into the future, although it may be
shortened or the resource may be deleted prior to this time. For example,
a user may request that a pod is deleted in 30 seconds. The Kubelet will
react by sending a graceful termination signal to the containers in the
pod. After that 30 seconds, the Kubelet will send a hard termination signal
(SIGKILL) to the container and after cleanup, remove the pod from the
API. In the presence of network partitions, this object may still exist
after this timestamp, until an administrator or automated process can
determine the resource is fully terminated. If not set, graceful deletion
of the object has not been requested. Populated by the system when a graceful
deletion is requested. Read-only.
type: complex
contains: {}
finalizers:
description:
- Must be empty before the object is deleted from the registry. Each entry
is an identifier for the responsible component that will remove the entry
from the list. If the deletionTimestamp of the object is non-nil, entries
in this list can only be removed.
type: list
contains: str
generate_name:
description:
- GenerateName is an optional prefix, used by the server, to generate a
unique name ONLY IF the Name field has not been provided. If this field
is used, the name returned to the client will be different than the name
passed. This value will also be combined with a unique suffix. The provided
value has the same validation rules as the Name field, and may be truncated
by the length of the suffix required to make the value unique on the server.
If this field is specified and the generated name exists, the server will
NOT return a 409 - instead, it will either return 201 Created or 500 with
Reason ServerTimeout indicating a unique name could not be found in the
time allotted, and the client should retry (optionally after the time
indicated in the Retry-After header). Applied only if Name is not specified.
type: str
generation:
description:
- A sequence number representing a specific generation of the desired state.
Populated by the system. Read-only.
type: int
labels:
description:
- Map of string keys and values that can be used to organize and categorize
(scope and select) objects. May match selectors of replication controllers
and services.
type: complex
contains: str, str
name:
description:
- Name must be unique within a namespace. Is required when creating resources,
although some resources may allow a client to request the generation of
an appropriate name automatically. Name is primarily intended for creation
idempotence and configuration definition. Cannot be updated.
type: str
namespace:
description:
- Namespace defines the space within each name must be unique. An empty
namespace is equivalent to the "default" namespace, but "default" is the
canonical representation. Not all objects are required to be scoped to
a namespace - the value of this field for those objects will be empty.
Must be a DNS_LABEL. Cannot be updated.
type: str
owner_references:
description:
- List of objects depended by this object. If ALL objects in the list have
been deleted, this object will be garbage collected. If this object is
managed by a controller, then an entry in this list will point to this
controller, with the controller field set to true. There cannot be more
than one managing controller.
type: list
contains:
api_version:
description:
- API version of the referent.
type: str
controller:
description:
- If true, this reference points to the managing controller.
type: bool
kind:
description:
- Kind of the referent.
type: str
name:
description:
- Name of the referent.
type: str
uid:
description:
- UID of the referent.
type: str
resource_version:
description:
- An opaque value that represents the internal version of this object that
can be used by clients to determine when objects have changed. May be
used for optimistic concurrency, change detection, and the watch operation
on a resource or set of resources. Clients must treat these values as
opaque and passed unmodified back to the server. They may only be valid
for a particular resource or set of resources. Populated by the system.
Read-only. Value must be treated as opaque by clients and .
type: str
self_link:
description:
- SelfLink is a URL representing this object. Populated by the system. Read-only.
type: str
uid:
description:
- UID is the unique in time and space value for this object. It is typically
generated by the server on successful creation of a resource and is not
allowed to change on PUT operations. Populated by the system. Read-only.
type: str
rules:
description:
- Rules holds all the PolicyRules for this ClusterRole
type: list
contains:
api_groups:
description:
- APIGroups is the name of the APIGroup that contains the resources. If
multiple API groups are specified, any action requested against one of
the enumerated resources in any API group will be allowed.
type: list
contains: str
attribute_restrictions:
description:
- AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder
pair supports. If the Authorizer does not recognize how to handle the
AttributeRestrictions, the Authorizer should report an error.
type: complex
contains:
raw:
description:
- Raw is the underlying serialization of this object.
type: str
non_resource_ur_ls:
description:
- NonResourceURLs is a set of partial urls that a user should have access
to. *s are allowed, but only as the full, final step in the path This
name is intentionally different than the internal type so that the DefaultConvert
works nicely and because the ordering may be different. Since non-resource
URLs are not namespaced, this field is only applicable for ClusterRoles
referenced from a ClusterRoleBinding. Rules can either apply to API resources
(such as "pods" or "secrets") or non-resource URL paths (such as "/api"),
but not both.
type: list
contains: str
resource_names:
description:
- ResourceNames is an optional white list of names that the rule applies
to. An empty set means that everything is allowed.
type: list
contains: str
resources:
description:
- Resources is a list of resources this rule applies to. ResourceAll represents
all resources.
type: list
contains: str
verbs:
description:
- Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions
contained in this rule. VerbAll represents all kinds.
type: list
contains: str
'''
def main():
try:
module = KubernetesAnsibleModule('cluster_role', 'V1alpha1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,367 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1alpha1_cluster_role_binding
short_description: Kubernetes ClusterRoleBinding
description:
- Manage the lifecycle of a cluster_role_binding object. Supports check mode, and
attempts to to be idempotent.
version_added: 2.3.0
author: OpenShift (@openshift)
options:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource that may
be set by external tools to store and retrieve arbitrary metadata. They are
not queryable and should be preserved when modifying objects.
type: dict
api_key:
description:
- Token used to connect to the API.
cert_file:
description:
- Path to a certificate used to authenticate with the API.
type: path
context:
description:
- The name of a context found in the Kubernetes config file.
debug:
description:
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
default: false
type: bool
force:
description:
- If set to C(True), and I(state) is C(present), an existing object will updated,
and lists will be replaced, rather than merged.
default: false
type: bool
host:
description:
- Provide a URL for acessing the Kubernetes API.
key_file:
description:
- Path to a key file used to authenticate with the API.
type: path
kubeconfig:
description:
- Path to an existing Kubernetes config file. If not provided, and no other connection
options are provided, the openshift client will attempt to load the default
configuration file from I(~/.kube/config.json).
type: path
labels:
description:
- Map of string keys and values that can be used to organize and categorize (scope
and select) objects. May match selectors of replication controllers and services.
type: dict
name:
description:
- Name must be unique within a namespace. Is required when creating resources,
although some resources may allow a client to request the generation of an appropriate
name automatically. Name is primarily intended for creation idempotence and
configuration definition. Cannot be updated.
namespace:
description:
- Namespace defines the space within each name must be unique. An empty namespace
is equivalent to the "default" namespace, but "default" is the canonical representation.
Not all objects are required to be scoped to a namespace - the value of this
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
password:
description:
- Provide a password for connecting to the API. Use in conjunction with I(username).
resource_definition:
description:
- Provide the YAML definition for the object, bypassing any modules parameters
intended to define object attributes.
type: dict
role_ref_api_group:
description:
- APIGroup is the group for the resource being referenced
aliases:
- api_group
role_ref_kind:
description:
- Kind is the type of resource being referenced
aliases:
- kind
role_ref_name:
description:
- Name is the name of resource being referenced
aliases:
- name
src:
description:
- Provide a path to a file containing the YAML definition of the object. Mutually
exclusive with I(resource_definition).
type: path
ssl_ca_cert:
description:
- Path to a CA certificate used to authenticate with the API.
type: path
state:
description:
- Determines if an object should be created, patched, or deleted. When set to
C(present), the object will be created, if it does not exist, or patched, if
parameter values differ from the existing object's attributes, and deleted,
if set to C(absent). A patch operation results in merging lists and updating
dictionaries, with lists being merged into a unique set of values. If a list
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
is performed, where individual elements with a matching I(name_) or I(type)
are merged. To force the replacement of lists, set the I(force) option to C(True).
default: present
choices:
- present
- absent
subjects:
description:
- Subjects holds references to the objects the role applies to.
type: list
username:
description:
- Provide a username for connecting to the API.
verify_ssl:
description:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- kubernetes == 1.0.0
'''
EXAMPLES = '''
'''
RETURN = '''
api_version:
type: string
description: Requested API version
cluster_role_binding:
type: complex
returned: when I(state) = C(present)
contains:
api_version:
description:
- APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
type: str
kind:
description:
- Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to. Cannot
be updated. In CamelCase.
type: str
metadata:
description:
- Standard object's metadata.
type: complex
contains:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource that
may be set by external tools to store and retrieve arbitrary metadata.
They are not queryable and should be preserved when modifying objects.
type: complex
contains: str, str
cluster_name:
description:
- The name of the cluster which the object belongs to. This is used to distinguish
resources with same name and namespace in different clusters. This field
is not set anywhere right now and apiserver is going to ignore it if set
in create or update request.
type: str
creation_timestamp:
description:
- CreationTimestamp is a timestamp representing the server time when this
object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC. Populated by the system. Read-only. Null
for lists.
type: complex
contains: {}
deletion_grace_period_seconds:
description:
- Number of seconds allowed for this object to gracefully terminate before
it will be removed from the system. Only set when deletionTimestamp is
also set. May only be shortened. Read-only.
type: int
deletion_timestamp:
description:
- DeletionTimestamp is RFC 3339 date and time at which this resource will
be deleted. This field is set by the server when a graceful deletion is
requested by the user, and is not directly settable by a client. The resource
is expected to be deleted (no longer visible from resource lists, and
not reachable by name) after the time in this field. Once set, this value
may not be unset or be set further into the future, although it may be
shortened or the resource may be deleted prior to this time. For example,
a user may request that a pod is deleted in 30 seconds. The Kubelet will
react by sending a graceful termination signal to the containers in the
pod. After that 30 seconds, the Kubelet will send a hard termination signal
(SIGKILL) to the container and after cleanup, remove the pod from the
API. In the presence of network partitions, this object may still exist
after this timestamp, until an administrator or automated process can
determine the resource is fully terminated. If not set, graceful deletion
of the object has not been requested. Populated by the system when a graceful
deletion is requested. Read-only.
type: complex
contains: {}
finalizers:
description:
- Must be empty before the object is deleted from the registry. Each entry
is an identifier for the responsible component that will remove the entry
from the list. If the deletionTimestamp of the object is non-nil, entries
in this list can only be removed.
type: list
contains: str
generate_name:
description:
- GenerateName is an optional prefix, used by the server, to generate a
unique name ONLY IF the Name field has not been provided. If this field
is used, the name returned to the client will be different than the name
passed. This value will also be combined with a unique suffix. The provided
value has the same validation rules as the Name field, and may be truncated
by the length of the suffix required to make the value unique on the server.
If this field is specified and the generated name exists, the server will
NOT return a 409 - instead, it will either return 201 Created or 500 with
Reason ServerTimeout indicating a unique name could not be found in the
time allotted, and the client should retry (optionally after the time
indicated in the Retry-After header). Applied only if Name is not specified.
type: str
generation:
description:
- A sequence number representing a specific generation of the desired state.
Populated by the system. Read-only.
type: int
labels:
description:
- Map of string keys and values that can be used to organize and categorize
(scope and select) objects. May match selectors of replication controllers
and services.
type: complex
contains: str, str
name:
description:
- Name must be unique within a namespace. Is required when creating resources,
although some resources may allow a client to request the generation of
an appropriate name automatically. Name is primarily intended for creation
idempotence and configuration definition. Cannot be updated.
type: str
namespace:
description:
- Namespace defines the space within each name must be unique. An empty
namespace is equivalent to the "default" namespace, but "default" is the
canonical representation. Not all objects are required to be scoped to
a namespace - the value of this field for those objects will be empty.
Must be a DNS_LABEL. Cannot be updated.
type: str
owner_references:
description:
- List of objects depended by this object. If ALL objects in the list have
been deleted, this object will be garbage collected. If this object is
managed by a controller, then an entry in this list will point to this
controller, with the controller field set to true. There cannot be more
than one managing controller.
type: list
contains:
api_version:
description:
- API version of the referent.
type: str
controller:
description:
- If true, this reference points to the managing controller.
type: bool
kind:
description:
- Kind of the referent.
type: str
name:
description:
- Name of the referent.
type: str
uid:
description:
- UID of the referent.
type: str
resource_version:
description:
- An opaque value that represents the internal version of this object that
can be used by clients to determine when objects have changed. May be
used for optimistic concurrency, change detection, and the watch operation
on a resource or set of resources. Clients must treat these values as
opaque and passed unmodified back to the server. They may only be valid
for a particular resource or set of resources. Populated by the system.
Read-only. Value must be treated as opaque by clients and .
type: str
self_link:
description:
- SelfLink is a URL representing this object. Populated by the system. Read-only.
type: str
uid:
description:
- UID is the unique in time and space value for this object. It is typically
generated by the server on successful creation of a resource and is not
allowed to change on PUT operations. Populated by the system. Read-only.
type: str
role_ref:
description:
- RoleRef can only reference a ClusterRole in the global namespace. If the RoleRef
cannot be resolved, the Authorizer must return an error.
type: complex
contains:
api_group:
description:
- APIGroup is the group for the resource being referenced
type: str
kind:
description:
- Kind is the type of resource being referenced
type: str
name:
description:
- Name is the name of resource being referenced
type: str
subjects:
description:
- Subjects holds references to the objects the role applies to.
type: list
contains:
api_version:
description:
- APIVersion holds the API group and version of the referenced object.
type: str
kind:
description:
- Kind of object being referenced. Values defined by this API group are
"User", "Group", and "ServiceAccount". If the Authorizer does not recognized
the kind value, the Authorizer should report an error.
type: str
name:
description:
- Name of the object being referenced.
type: str
namespace:
description:
- Namespace of the referenced object. If the object kind is non-namespace,
such as "User" or "Group", and this value is not empty the Authorizer
should report an error.
type: str
'''
def main():
try:
module = KubernetesAnsibleModule('cluster_role_binding', 'V1alpha1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,370 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1alpha1_cluster_role_binding_list
short_description: Kubernetes ClusterRoleBindingList
description:
- Retrieve a list of cluster_role_bindings. List operations provide a snapshot read
of the underlying objects, returning a resource_version representing a consistent
version of the listed objects.
version_added: 2.3.0
author: OpenShift (@openshift)
options:
api_key:
description:
- Token used to connect to the API.
cert_file:
description:
- Path to a certificate used to authenticate with the API.
type: path
context:
description:
- The name of a context found in the Kubernetes config file.
debug:
description:
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
default: false
type: bool
force:
description:
- If set to C(True), and I(state) is C(present), an existing object will updated,
and lists will be replaced, rather than merged.
default: false
type: bool
host:
description:
- Provide a URL for acessing the Kubernetes API.
key_file:
description:
- Path to a key file used to authenticate with the API.
type: path
kubeconfig:
description:
- Path to an existing Kubernetes config file. If not provided, and no other connection
options are provided, the openshift client will attempt to load the default
configuration file from I(~/.kube/config.json).
type: path
namespace:
description:
- Namespaces provide a scope for names. Names of resources need to be unique within
a namespace, but not across namespaces. Provide the namespace for the object.
password:
description:
- Provide a password for connecting to the API. Use in conjunction with I(username).
resource_definition:
description:
- Provide the YAML definition for the object, bypassing any modules parameters
intended to define object attributes.
type: dict
src:
description:
- Provide a path to a file containing the YAML definition of the object. Mutually
exclusive with I(resource_definition).
type: path
ssl_ca_cert:
description:
- Path to a CA certificate used to authenticate with the API.
type: path
state:
description:
- Determines if an object should be created, patched, or deleted. When set to
C(present), the object will be created, if it does not exist, or patched, if
parameter values differ from the existing object's attributes, and deleted,
if set to C(absent). A patch operation results in merging lists and updating
dictionaries, with lists being merged into a unique set of values. If a list
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
is performed, where individual elements with a matching I(name_) or I(type)
are merged. To force the replacement of lists, set the I(force) option to C(True).
default: present
choices:
- present
- absent
username:
description:
- Provide a username for connecting to the API.
verify_ssl:
description:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- kubernetes == 1.0.0
'''
EXAMPLES = '''
'''
RETURN = '''
api_version:
type: string
description: Requested API version
cluster_role_binding_list:
type: complex
returned: when I(state) = C(present)
contains:
api_version:
description:
- APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
type: str
items:
description:
- Items is a list of ClusterRoleBindings
type: list
contains:
api_version:
description:
- APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value,
and may reject unrecognized values.
type: str
kind:
description:
- Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated. In CamelCase.
type: str
metadata:
description:
- Standard object's metadata.
type: complex
contains:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource
that may be set by external tools to store and retrieve arbitrary
metadata. They are not queryable and should be preserved when modifying
objects.
type: complex
contains: str, str
cluster_name:
description:
- The name of the cluster which the object belongs to. This is used
to distinguish resources with same name and namespace in different
clusters. This field is not set anywhere right now and apiserver is
going to ignore it if set in create or update request.
type: str
creation_timestamp:
description:
- CreationTimestamp is a timestamp representing the server time when
this object was created. It is not guaranteed to be set in happens-before
order across separate operations. Clients may not set this value.
It is represented in RFC3339 form and is in UTC. Populated by the
system. Read-only. Null for lists.
type: complex
contains: {}
deletion_grace_period_seconds:
description:
- Number of seconds allowed for this object to gracefully terminate
before it will be removed from the system. Only set when deletionTimestamp
is also set. May only be shortened. Read-only.
type: int
deletion_timestamp:
description:
- DeletionTimestamp is RFC 3339 date and time at which this resource
will be deleted. This field is set by the server when a graceful deletion
is requested by the user, and is not directly settable by a client.
The resource is expected to be deleted (no longer visible from resource
lists, and not reachable by name) after the time in this field. Once
set, this value may not be unset or be set further into the future,
although it may be shortened or the resource may be deleted prior
to this time. For example, a user may request that a pod is deleted
in 30 seconds. The Kubelet will react by sending a graceful termination
signal to the containers in the pod. After that 30 seconds, the Kubelet
will send a hard termination signal (SIGKILL) to the container and
after cleanup, remove the pod from the API. In the presence of network
partitions, this object may still exist after this timestamp, until
an administrator or automated process can determine the resource is
fully terminated. If not set, graceful deletion of the object has
not been requested. Populated by the system when a graceful deletion
is requested. Read-only.
type: complex
contains: {}
finalizers:
description:
- Must be empty before the object is deleted from the registry. Each
entry is an identifier for the responsible component that will remove
the entry from the list. If the deletionTimestamp of the object is
non-nil, entries in this list can only be removed.
type: list
contains: str
generate_name:
description:
- GenerateName is an optional prefix, used by the server, to generate
a unique name ONLY IF the Name field has not been provided. If this
field is used, the name returned to the client will be different than
the name passed. This value will also be combined with a unique suffix.
The provided value has the same validation rules as the Name field,
and may be truncated by the length of the suffix required to make
the value unique on the server. If this field is specified and the
generated name exists, the server will NOT return a 409 - instead,
it will either return 201 Created or 500 with Reason ServerTimeout
indicating a unique name could not be found in the time allotted,
and the client should retry (optionally after the time indicated in
the Retry-After header). Applied only if Name is not specified.
type: str
generation:
description:
- A sequence number representing a specific generation of the desired
state. Populated by the system. Read-only.
type: int
labels:
description:
- Map of string keys and values that can be used to organize and categorize
(scope and select) objects. May match selectors of replication controllers
and services.
type: complex
contains: str, str
name:
description:
- Name must be unique within a namespace. Is required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically. Name is primarily
intended for creation idempotence and configuration definition. Cannot
be updated.
type: str
namespace:
description:
- Namespace defines the space within each name must be unique. An empty
namespace is equivalent to the "default" namespace, but "default"
is the canonical representation. Not all objects are required to be
scoped to a namespace - the value of this field for those objects
will be empty. Must be a DNS_LABEL. Cannot be updated.
type: str
owner_references:
description:
- List of objects depended by this object. If ALL objects in the list
have been deleted, this object will be garbage collected. If this
object is managed by a controller, then an entry in this list will
point to this controller, with the controller field set to true. There
cannot be more than one managing controller.
type: list
contains:
api_version:
description:
- API version of the referent.
type: str
controller:
description:
- If true, this reference points to the managing controller.
type: bool
kind:
description:
- Kind of the referent.
type: str
name:
description:
- Name of the referent.
type: str
uid:
description:
- UID of the referent.
type: str
resource_version:
description:
- An opaque value that represents the internal version of this object
that can be used by clients to determine when objects have changed.
May be used for optimistic concurrency, change detection, and the
watch operation on a resource or set of resources. Clients must treat
these values as opaque and passed unmodified back to the server. They
may only be valid for a particular resource or set of resources. Populated
by the system. Read-only. Value must be treated as opaque by clients
and .
type: str
self_link:
description:
- SelfLink is a URL representing this object. Populated by the system.
Read-only.
type: str
uid:
description:
- UID is the unique in time and space value for this object. It is typically
generated by the server on successful creation of a resource and is
not allowed to change on PUT operations. Populated by the system.
Read-only.
type: str
role_ref:
description:
- RoleRef can only reference a ClusterRole in the global namespace. If the
RoleRef cannot be resolved, the Authorizer must return an error.
type: complex
contains:
api_group:
description:
- APIGroup is the group for the resource being referenced
type: str
kind:
description:
- Kind is the type of resource being referenced
type: str
name:
description:
- Name is the name of resource being referenced
type: str
subjects:
description:
- Subjects holds references to the objects the role applies to.
type: list
contains:
api_version:
description:
- APIVersion holds the API group and version of the referenced object.
type: str
kind:
description:
- Kind of object being referenced. Values defined by this API group
are "User", "Group", and "ServiceAccount". If the Authorizer does
not recognized the kind value, the Authorizer should report an error.
type: str
name:
description:
- Name of the object being referenced.
type: str
namespace:
description:
- Namespace of the referenced object. If the object kind is non-namespace,
such as "User" or "Group", and this value is not empty the Authorizer
should report an error.
type: str
kind:
description:
- Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to. Cannot
be updated. In CamelCase.
type: str
metadata:
description:
- Standard object's metadata.
type: complex
contains:
resource_version:
description:
- String that identifies the server's internal version of this object that
can be used by clients to determine when objects have changed. Value must
be treated as opaque by clients and passed unmodified back to the server.
Populated by the system. Read-only.
type: str
self_link:
description:
- SelfLink is a URL representing this object. Populated by the system. Read-only.
type: str
'''
def main():
try:
module = KubernetesAnsibleModule('cluster_role_binding_list', 'V1alpha1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,380 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1alpha1_cluster_role_list
short_description: Kubernetes ClusterRoleList
description:
- Retrieve a list of cluster_roles. List operations provide a snapshot read of the
underlying objects, returning a resource_version representing a consistent version
of the listed objects.
version_added: 2.3.0
author: OpenShift (@openshift)
options:
api_key:
description:
- Token used to connect to the API.
cert_file:
description:
- Path to a certificate used to authenticate with the API.
type: path
context:
description:
- The name of a context found in the Kubernetes config file.
debug:
description:
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
default: false
type: bool
force:
description:
- If set to C(True), and I(state) is C(present), an existing object will updated,
and lists will be replaced, rather than merged.
default: false
type: bool
host:
description:
- Provide a URL for acessing the Kubernetes API.
key_file:
description:
- Path to a key file used to authenticate with the API.
type: path
kubeconfig:
description:
- Path to an existing Kubernetes config file. If not provided, and no other connection
options are provided, the openshift client will attempt to load the default
configuration file from I(~/.kube/config.json).
type: path
namespace:
description:
- Namespaces provide a scope for names. Names of resources need to be unique within
a namespace, but not across namespaces. Provide the namespace for the object.
password:
description:
- Provide a password for connecting to the API. Use in conjunction with I(username).
resource_definition:
description:
- Provide the YAML definition for the object, bypassing any modules parameters
intended to define object attributes.
type: dict
src:
description:
- Provide a path to a file containing the YAML definition of the object. Mutually
exclusive with I(resource_definition).
type: path
ssl_ca_cert:
description:
- Path to a CA certificate used to authenticate with the API.
type: path
state:
description:
- Determines if an object should be created, patched, or deleted. When set to
C(present), the object will be created, if it does not exist, or patched, if
parameter values differ from the existing object's attributes, and deleted,
if set to C(absent). A patch operation results in merging lists and updating
dictionaries, with lists being merged into a unique set of values. If a list
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
is performed, where individual elements with a matching I(name_) or I(type)
are merged. To force the replacement of lists, set the I(force) option to C(True).
default: present
choices:
- present
- absent
username:
description:
- Provide a username for connecting to the API.
verify_ssl:
description:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- kubernetes == 1.0.0
'''
EXAMPLES = '''
'''
RETURN = '''
api_version:
type: string
description: Requested API version
cluster_role_list:
type: complex
returned: when I(state) = C(present)
contains:
api_version:
description:
- APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
type: str
items:
description:
- Items is a list of ClusterRoles
type: list
contains:
api_version:
description:
- APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value,
and may reject unrecognized values.
type: str
kind:
description:
- Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated. In CamelCase.
type: str
metadata:
description:
- Standard object's metadata.
type: complex
contains:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource
that may be set by external tools to store and retrieve arbitrary
metadata. They are not queryable and should be preserved when modifying
objects.
type: complex
contains: str, str
cluster_name:
description:
- The name of the cluster which the object belongs to. This is used
to distinguish resources with same name and namespace in different
clusters. This field is not set anywhere right now and apiserver is
going to ignore it if set in create or update request.
type: str
creation_timestamp:
description:
- CreationTimestamp is a timestamp representing the server time when
this object was created. It is not guaranteed to be set in happens-before
order across separate operations. Clients may not set this value.
It is represented in RFC3339 form and is in UTC. Populated by the
system. Read-only. Null for lists.
type: complex
contains: {}
deletion_grace_period_seconds:
description:
- Number of seconds allowed for this object to gracefully terminate
before it will be removed from the system. Only set when deletionTimestamp
is also set. May only be shortened. Read-only.
type: int
deletion_timestamp:
description:
- DeletionTimestamp is RFC 3339 date and time at which this resource
will be deleted. This field is set by the server when a graceful deletion
is requested by the user, and is not directly settable by a client.
The resource is expected to be deleted (no longer visible from resource
lists, and not reachable by name) after the time in this field. Once
set, this value may not be unset or be set further into the future,
although it may be shortened or the resource may be deleted prior
to this time. For example, a user may request that a pod is deleted
in 30 seconds. The Kubelet will react by sending a graceful termination
signal to the containers in the pod. After that 30 seconds, the Kubelet
will send a hard termination signal (SIGKILL) to the container and
after cleanup, remove the pod from the API. In the presence of network
partitions, this object may still exist after this timestamp, until
an administrator or automated process can determine the resource is
fully terminated. If not set, graceful deletion of the object has
not been requested. Populated by the system when a graceful deletion
is requested. Read-only.
type: complex
contains: {}
finalizers:
description:
- Must be empty before the object is deleted from the registry. Each
entry is an identifier for the responsible component that will remove
the entry from the list. If the deletionTimestamp of the object is
non-nil, entries in this list can only be removed.
type: list
contains: str
generate_name:
description:
- GenerateName is an optional prefix, used by the server, to generate
a unique name ONLY IF the Name field has not been provided. If this
field is used, the name returned to the client will be different than
the name passed. This value will also be combined with a unique suffix.
The provided value has the same validation rules as the Name field,
and may be truncated by the length of the suffix required to make
the value unique on the server. If this field is specified and the
generated name exists, the server will NOT return a 409 - instead,
it will either return 201 Created or 500 with Reason ServerTimeout
indicating a unique name could not be found in the time allotted,
and the client should retry (optionally after the time indicated in
the Retry-After header). Applied only if Name is not specified.
type: str
generation:
description:
- A sequence number representing a specific generation of the desired
state. Populated by the system. Read-only.
type: int
labels:
description:
- Map of string keys and values that can be used to organize and categorize
(scope and select) objects. May match selectors of replication controllers
and services.
type: complex
contains: str, str
name:
description:
- Name must be unique within a namespace. Is required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically. Name is primarily
intended for creation idempotence and configuration definition. Cannot
be updated.
type: str
namespace:
description:
- Namespace defines the space within each name must be unique. An empty
namespace is equivalent to the "default" namespace, but "default"
is the canonical representation. Not all objects are required to be
scoped to a namespace - the value of this field for those objects
will be empty. Must be a DNS_LABEL. Cannot be updated.
type: str
owner_references:
description:
- List of objects depended by this object. If ALL objects in the list
have been deleted, this object will be garbage collected. If this
object is managed by a controller, then an entry in this list will
point to this controller, with the controller field set to true. There
cannot be more than one managing controller.
type: list
contains:
api_version:
description:
- API version of the referent.
type: str
controller:
description:
- If true, this reference points to the managing controller.
type: bool
kind:
description:
- Kind of the referent.
type: str
name:
description:
- Name of the referent.
type: str
uid:
description:
- UID of the referent.
type: str
resource_version:
description:
- An opaque value that represents the internal version of this object
that can be used by clients to determine when objects have changed.
May be used for optimistic concurrency, change detection, and the
watch operation on a resource or set of resources. Clients must treat
these values as opaque and passed unmodified back to the server. They
may only be valid for a particular resource or set of resources. Populated
by the system. Read-only. Value must be treated as opaque by clients
and .
type: str
self_link:
description:
- SelfLink is a URL representing this object. Populated by the system.
Read-only.
type: str
uid:
description:
- UID is the unique in time and space value for this object. It is typically
generated by the server on successful creation of a resource and is
not allowed to change on PUT operations. Populated by the system.
Read-only.
type: str
rules:
description:
- Rules holds all the PolicyRules for this ClusterRole
type: list
contains:
api_groups:
description:
- APIGroups is the name of the APIGroup that contains the resources.
If multiple API groups are specified, any action requested against
one of the enumerated resources in any API group will be allowed.
type: list
contains: str
attribute_restrictions:
description:
- AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder
pair supports. If the Authorizer does not recognize how to handle
the AttributeRestrictions, the Authorizer should report an error.
type: complex
contains:
raw:
description:
- Raw is the underlying serialization of this object.
type: str
non_resource_ur_ls:
description:
- NonResourceURLs is a set of partial urls that a user should have access
to. *s are allowed, but only as the full, final step in the path This
name is intentionally different than the internal type so that the
DefaultConvert works nicely and because the ordering may be different.
Since non-resource URLs are not namespaced, this field is only applicable
for ClusterRoles referenced from a ClusterRoleBinding. Rules can either
apply to API resources (such as "pods" or "secrets") or non-resource
URL paths (such as "/api"), but not both.
type: list
contains: str
resource_names:
description:
- ResourceNames is an optional white list of names that the rule applies
to. An empty set means that everything is allowed.
type: list
contains: str
resources:
description:
- Resources is a list of resources this rule applies to. ResourceAll
represents all resources.
type: list
contains: str
verbs:
description:
- Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions
contained in this rule. VerbAll represents all kinds.
type: list
contains: str
kind:
description:
- Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to. Cannot
be updated. In CamelCase.
type: str
metadata:
description:
- Standard object's metadata.
type: complex
contains:
resource_version:
description:
- String that identifies the server's internal version of this object that
can be used by clients to determine when objects have changed. Value must
be treated as opaque by clients and passed unmodified back to the server.
Populated by the system. Read-only.
type: str
self_link:
description:
- SelfLink is a URL representing this object. Populated by the system. Read-only.
type: str
'''
def main():
try:
module = KubernetesAnsibleModule('cluster_role_list', 'V1alpha1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,362 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1alpha1_role
short_description: Kubernetes Role
description:
- Manage the lifecycle of a role object. Supports check mode, and attempts to to be
idempotent.
version_added: 2.3.0
author: OpenShift (@openshift)
options:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource that may
be set by external tools to store and retrieve arbitrary metadata. They are
not queryable and should be preserved when modifying objects.
type: dict
api_key:
description:
- Token used to connect to the API.
cert_file:
description:
- Path to a certificate used to authenticate with the API.
type: path
context:
description:
- The name of a context found in the Kubernetes config file.
debug:
description:
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
default: false
type: bool
force:
description:
- If set to C(True), and I(state) is C(present), an existing object will updated,
and lists will be replaced, rather than merged.
default: false
type: bool
host:
description:
- Provide a URL for acessing the Kubernetes API.
key_file:
description:
- Path to a key file used to authenticate with the API.
type: path
kubeconfig:
description:
- Path to an existing Kubernetes config file. If not provided, and no other connection
options are provided, the openshift client will attempt to load the default
configuration file from I(~/.kube/config.json).
type: path
labels:
description:
- Map of string keys and values that can be used to organize and categorize (scope
and select) objects. May match selectors of replication controllers and services.
type: dict
name:
description:
- Name must be unique within a namespace. Is required when creating resources,
although some resources may allow a client to request the generation of an appropriate
name automatically. Name is primarily intended for creation idempotence and
configuration definition. Cannot be updated.
namespace:
description:
- Namespace defines the space within each name must be unique. An empty namespace
is equivalent to the "default" namespace, but "default" is the canonical representation.
Not all objects are required to be scoped to a namespace - the value of this
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
password:
description:
- Provide a password for connecting to the API. Use in conjunction with I(username).
resource_definition:
description:
- Provide the YAML definition for the object, bypassing any modules parameters
intended to define object attributes.
type: dict
rules:
description:
- Rules holds all the PolicyRules for this Role
type: list
src:
description:
- Provide a path to a file containing the YAML definition of the object. Mutually
exclusive with I(resource_definition).
type: path
ssl_ca_cert:
description:
- Path to a CA certificate used to authenticate with the API.
type: path
state:
description:
- Determines if an object should be created, patched, or deleted. When set to
C(present), the object will be created, if it does not exist, or patched, if
parameter values differ from the existing object's attributes, and deleted,
if set to C(absent). A patch operation results in merging lists and updating
dictionaries, with lists being merged into a unique set of values. If a list
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
is performed, where individual elements with a matching I(name_) or I(type)
are merged. To force the replacement of lists, set the I(force) option to C(True).
default: present
choices:
- present
- absent
username:
description:
- Provide a username for connecting to the API.
verify_ssl:
description:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- kubernetes == 1.0.0
'''
EXAMPLES = '''
'''
RETURN = '''
api_version:
type: string
description: Requested API version
role:
type: complex
returned: when I(state) = C(present)
contains:
api_version:
description:
- APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
type: str
kind:
description:
- Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to. Cannot
be updated. In CamelCase.
type: str
metadata:
description:
- Standard object's metadata.
type: complex
contains:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource that
may be set by external tools to store and retrieve arbitrary metadata.
They are not queryable and should be preserved when modifying objects.
type: complex
contains: str, str
cluster_name:
description:
- The name of the cluster which the object belongs to. This is used to distinguish
resources with same name and namespace in different clusters. This field
is not set anywhere right now and apiserver is going to ignore it if set
in create or update request.
type: str
creation_timestamp:
description:
- CreationTimestamp is a timestamp representing the server time when this
object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC. Populated by the system. Read-only. Null
for lists.
type: complex
contains: {}
deletion_grace_period_seconds:
description:
- Number of seconds allowed for this object to gracefully terminate before
it will be removed from the system. Only set when deletionTimestamp is
also set. May only be shortened. Read-only.
type: int
deletion_timestamp:
description:
- DeletionTimestamp is RFC 3339 date and time at which this resource will
be deleted. This field is set by the server when a graceful deletion is
requested by the user, and is not directly settable by a client. The resource
is expected to be deleted (no longer visible from resource lists, and
not reachable by name) after the time in this field. Once set, this value
may not be unset or be set further into the future, although it may be
shortened or the resource may be deleted prior to this time. For example,
a user may request that a pod is deleted in 30 seconds. The Kubelet will
react by sending a graceful termination signal to the containers in the
pod. After that 30 seconds, the Kubelet will send a hard termination signal
(SIGKILL) to the container and after cleanup, remove the pod from the
API. In the presence of network partitions, this object may still exist
after this timestamp, until an administrator or automated process can
determine the resource is fully terminated. If not set, graceful deletion
of the object has not been requested. Populated by the system when a graceful
deletion is requested. Read-only.
type: complex
contains: {}
finalizers:
description:
- Must be empty before the object is deleted from the registry. Each entry
is an identifier for the responsible component that will remove the entry
from the list. If the deletionTimestamp of the object is non-nil, entries
in this list can only be removed.
type: list
contains: str
generate_name:
description:
- GenerateName is an optional prefix, used by the server, to generate a
unique name ONLY IF the Name field has not been provided. If this field
is used, the name returned to the client will be different than the name
passed. This value will also be combined with a unique suffix. The provided
value has the same validation rules as the Name field, and may be truncated
by the length of the suffix required to make the value unique on the server.
If this field is specified and the generated name exists, the server will
NOT return a 409 - instead, it will either return 201 Created or 500 with
Reason ServerTimeout indicating a unique name could not be found in the
time allotted, and the client should retry (optionally after the time
indicated in the Retry-After header). Applied only if Name is not specified.
type: str
generation:
description:
- A sequence number representing a specific generation of the desired state.
Populated by the system. Read-only.
type: int
labels:
description:
- Map of string keys and values that can be used to organize and categorize
(scope and select) objects. May match selectors of replication controllers
and services.
type: complex
contains: str, str
name:
description:
- Name must be unique within a namespace. Is required when creating resources,
although some resources may allow a client to request the generation of
an appropriate name automatically. Name is primarily intended for creation
idempotence and configuration definition. Cannot be updated.
type: str
namespace:
description:
- Namespace defines the space within each name must be unique. An empty
namespace is equivalent to the "default" namespace, but "default" is the
canonical representation. Not all objects are required to be scoped to
a namespace - the value of this field for those objects will be empty.
Must be a DNS_LABEL. Cannot be updated.
type: str
owner_references:
description:
- List of objects depended by this object. If ALL objects in the list have
been deleted, this object will be garbage collected. If this object is
managed by a controller, then an entry in this list will point to this
controller, with the controller field set to true. There cannot be more
than one managing controller.
type: list
contains:
api_version:
description:
- API version of the referent.
type: str
controller:
description:
- If true, this reference points to the managing controller.
type: bool
kind:
description:
- Kind of the referent.
type: str
name:
description:
- Name of the referent.
type: str
uid:
description:
- UID of the referent.
type: str
resource_version:
description:
- An opaque value that represents the internal version of this object that
can be used by clients to determine when objects have changed. May be
used for optimistic concurrency, change detection, and the watch operation
on a resource or set of resources. Clients must treat these values as
opaque and passed unmodified back to the server. They may only be valid
for a particular resource or set of resources. Populated by the system.
Read-only. Value must be treated as opaque by clients and .
type: str
self_link:
description:
- SelfLink is a URL representing this object. Populated by the system. Read-only.
type: str
uid:
description:
- UID is the unique in time and space value for this object. It is typically
generated by the server on successful creation of a resource and is not
allowed to change on PUT operations. Populated by the system. Read-only.
type: str
rules:
description:
- Rules holds all the PolicyRules for this Role
type: list
contains:
api_groups:
description:
- APIGroups is the name of the APIGroup that contains the resources. If
multiple API groups are specified, any action requested against one of
the enumerated resources in any API group will be allowed.
type: list
contains: str
attribute_restrictions:
description:
- AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder
pair supports. If the Authorizer does not recognize how to handle the
AttributeRestrictions, the Authorizer should report an error.
type: complex
contains:
raw:
description:
- Raw is the underlying serialization of this object.
type: str
non_resource_ur_ls:
description:
- NonResourceURLs is a set of partial urls that a user should have access
to. *s are allowed, but only as the full, final step in the path This
name is intentionally different than the internal type so that the DefaultConvert
works nicely and because the ordering may be different. Since non-resource
URLs are not namespaced, this field is only applicable for ClusterRoles
referenced from a ClusterRoleBinding. Rules can either apply to API resources
(such as "pods" or "secrets") or non-resource URL paths (such as "/api"),
but not both.
type: list
contains: str
resource_names:
description:
- ResourceNames is an optional white list of names that the rule applies
to. An empty set means that everything is allowed.
type: list
contains: str
resources:
description:
- Resources is a list of resources this rule applies to. ResourceAll represents
all resources.
type: list
contains: str
verbs:
description:
- Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions
contained in this rule. VerbAll represents all kinds.
type: list
contains: str
'''
def main():
try:
module = KubernetesAnsibleModule('role', 'V1alpha1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,368 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1alpha1_role_binding
short_description: Kubernetes RoleBinding
description:
- Manage the lifecycle of a role_binding object. Supports check mode, and attempts
to to be idempotent.
version_added: 2.3.0
author: OpenShift (@openshift)
options:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource that may
be set by external tools to store and retrieve arbitrary metadata. They are
not queryable and should be preserved when modifying objects.
type: dict
api_key:
description:
- Token used to connect to the API.
cert_file:
description:
- Path to a certificate used to authenticate with the API.
type: path
context:
description:
- The name of a context found in the Kubernetes config file.
debug:
description:
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
default: false
type: bool
force:
description:
- If set to C(True), and I(state) is C(present), an existing object will updated,
and lists will be replaced, rather than merged.
default: false
type: bool
host:
description:
- Provide a URL for acessing the Kubernetes API.
key_file:
description:
- Path to a key file used to authenticate with the API.
type: path
kubeconfig:
description:
- Path to an existing Kubernetes config file. If not provided, and no other connection
options are provided, the openshift client will attempt to load the default
configuration file from I(~/.kube/config.json).
type: path
labels:
description:
- Map of string keys and values that can be used to organize and categorize (scope
and select) objects. May match selectors of replication controllers and services.
type: dict
name:
description:
- Name must be unique within a namespace. Is required when creating resources,
although some resources may allow a client to request the generation of an appropriate
name automatically. Name is primarily intended for creation idempotence and
configuration definition. Cannot be updated.
namespace:
description:
- Namespace defines the space within each name must be unique. An empty namespace
is equivalent to the "default" namespace, but "default" is the canonical representation.
Not all objects are required to be scoped to a namespace - the value of this
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
password:
description:
- Provide a password for connecting to the API. Use in conjunction with I(username).
resource_definition:
description:
- Provide the YAML definition for the object, bypassing any modules parameters
intended to define object attributes.
type: dict
role_ref_api_group:
description:
- APIGroup is the group for the resource being referenced
aliases:
- api_group
role_ref_kind:
description:
- Kind is the type of resource being referenced
aliases:
- kind
role_ref_name:
description:
- Name is the name of resource being referenced
aliases:
- name
src:
description:
- Provide a path to a file containing the YAML definition of the object. Mutually
exclusive with I(resource_definition).
type: path
ssl_ca_cert:
description:
- Path to a CA certificate used to authenticate with the API.
type: path
state:
description:
- Determines if an object should be created, patched, or deleted. When set to
C(present), the object will be created, if it does not exist, or patched, if
parameter values differ from the existing object's attributes, and deleted,
if set to C(absent). A patch operation results in merging lists and updating
dictionaries, with lists being merged into a unique set of values. If a list
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
is performed, where individual elements with a matching I(name_) or I(type)
are merged. To force the replacement of lists, set the I(force) option to C(True).
default: present
choices:
- present
- absent
subjects:
description:
- Subjects holds references to the objects the role applies to.
type: list
username:
description:
- Provide a username for connecting to the API.
verify_ssl:
description:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- kubernetes == 1.0.0
'''
EXAMPLES = '''
'''
RETURN = '''
api_version:
type: string
description: Requested API version
role_binding:
type: complex
returned: when I(state) = C(present)
contains:
api_version:
description:
- APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
type: str
kind:
description:
- Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to. Cannot
be updated. In CamelCase.
type: str
metadata:
description:
- Standard object's metadata.
type: complex
contains:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource that
may be set by external tools to store and retrieve arbitrary metadata.
They are not queryable and should be preserved when modifying objects.
type: complex
contains: str, str
cluster_name:
description:
- The name of the cluster which the object belongs to. This is used to distinguish
resources with same name and namespace in different clusters. This field
is not set anywhere right now and apiserver is going to ignore it if set
in create or update request.
type: str
creation_timestamp:
description:
- CreationTimestamp is a timestamp representing the server time when this
object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC. Populated by the system. Read-only. Null
for lists.
type: complex
contains: {}
deletion_grace_period_seconds:
description:
- Number of seconds allowed for this object to gracefully terminate before
it will be removed from the system. Only set when deletionTimestamp is
also set. May only be shortened. Read-only.
type: int
deletion_timestamp:
description:
- DeletionTimestamp is RFC 3339 date and time at which this resource will
be deleted. This field is set by the server when a graceful deletion is
requested by the user, and is not directly settable by a client. The resource
is expected to be deleted (no longer visible from resource lists, and
not reachable by name) after the time in this field. Once set, this value
may not be unset or be set further into the future, although it may be
shortened or the resource may be deleted prior to this time. For example,
a user may request that a pod is deleted in 30 seconds. The Kubelet will
react by sending a graceful termination signal to the containers in the
pod. After that 30 seconds, the Kubelet will send a hard termination signal
(SIGKILL) to the container and after cleanup, remove the pod from the
API. In the presence of network partitions, this object may still exist
after this timestamp, until an administrator or automated process can
determine the resource is fully terminated. If not set, graceful deletion
of the object has not been requested. Populated by the system when a graceful
deletion is requested. Read-only.
type: complex
contains: {}
finalizers:
description:
- Must be empty before the object is deleted from the registry. Each entry
is an identifier for the responsible component that will remove the entry
from the list. If the deletionTimestamp of the object is non-nil, entries
in this list can only be removed.
type: list
contains: str
generate_name:
description:
- GenerateName is an optional prefix, used by the server, to generate a
unique name ONLY IF the Name field has not been provided. If this field
is used, the name returned to the client will be different than the name
passed. This value will also be combined with a unique suffix. The provided
value has the same validation rules as the Name field, and may be truncated
by the length of the suffix required to make the value unique on the server.
If this field is specified and the generated name exists, the server will
NOT return a 409 - instead, it will either return 201 Created or 500 with
Reason ServerTimeout indicating a unique name could not be found in the
time allotted, and the client should retry (optionally after the time
indicated in the Retry-After header). Applied only if Name is not specified.
type: str
generation:
description:
- A sequence number representing a specific generation of the desired state.
Populated by the system. Read-only.
type: int
labels:
description:
- Map of string keys and values that can be used to organize and categorize
(scope and select) objects. May match selectors of replication controllers
and services.
type: complex
contains: str, str
name:
description:
- Name must be unique within a namespace. Is required when creating resources,
although some resources may allow a client to request the generation of
an appropriate name automatically. Name is primarily intended for creation
idempotence and configuration definition. Cannot be updated.
type: str
namespace:
description:
- Namespace defines the space within each name must be unique. An empty
namespace is equivalent to the "default" namespace, but "default" is the
canonical representation. Not all objects are required to be scoped to
a namespace - the value of this field for those objects will be empty.
Must be a DNS_LABEL. Cannot be updated.
type: str
owner_references:
description:
- List of objects depended by this object. If ALL objects in the list have
been deleted, this object will be garbage collected. If this object is
managed by a controller, then an entry in this list will point to this
controller, with the controller field set to true. There cannot be more
than one managing controller.
type: list
contains:
api_version:
description:
- API version of the referent.
type: str
controller:
description:
- If true, this reference points to the managing controller.
type: bool
kind:
description:
- Kind of the referent.
type: str
name:
description:
- Name of the referent.
type: str
uid:
description:
- UID of the referent.
type: str
resource_version:
description:
- An opaque value that represents the internal version of this object that
can be used by clients to determine when objects have changed. May be
used for optimistic concurrency, change detection, and the watch operation
on a resource or set of resources. Clients must treat these values as
opaque and passed unmodified back to the server. They may only be valid
for a particular resource or set of resources. Populated by the system.
Read-only. Value must be treated as opaque by clients and .
type: str
self_link:
description:
- SelfLink is a URL representing this object. Populated by the system. Read-only.
type: str
uid:
description:
- UID is the unique in time and space value for this object. It is typically
generated by the server on successful creation of a resource and is not
allowed to change on PUT operations. Populated by the system. Read-only.
type: str
role_ref:
description:
- RoleRef can reference a Role in the current namespace or a ClusterRole in
the global namespace. If the RoleRef cannot be resolved, the Authorizer must
return an error.
type: complex
contains:
api_group:
description:
- APIGroup is the group for the resource being referenced
type: str
kind:
description:
- Kind is the type of resource being referenced
type: str
name:
description:
- Name is the name of resource being referenced
type: str
subjects:
description:
- Subjects holds references to the objects the role applies to.
type: list
contains:
api_version:
description:
- APIVersion holds the API group and version of the referenced object.
type: str
kind:
description:
- Kind of object being referenced. Values defined by this API group are
"User", "Group", and "ServiceAccount". If the Authorizer does not recognized
the kind value, the Authorizer should report an error.
type: str
name:
description:
- Name of the object being referenced.
type: str
namespace:
description:
- Namespace of the referenced object. If the object kind is non-namespace,
such as "User" or "Group", and this value is not empty the Authorizer
should report an error.
type: str
'''
def main():
try:
module = KubernetesAnsibleModule('role_binding', 'V1alpha1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,371 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1alpha1_role_binding_list
short_description: Kubernetes RoleBindingList
description:
- Retrieve a list of role_bindings. List operations provide a snapshot read of the
underlying objects, returning a resource_version representing a consistent version
of the listed objects.
version_added: 2.3.0
author: OpenShift (@openshift)
options:
api_key:
description:
- Token used to connect to the API.
cert_file:
description:
- Path to a certificate used to authenticate with the API.
type: path
context:
description:
- The name of a context found in the Kubernetes config file.
debug:
description:
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
default: false
type: bool
force:
description:
- If set to C(True), and I(state) is C(present), an existing object will updated,
and lists will be replaced, rather than merged.
default: false
type: bool
host:
description:
- Provide a URL for acessing the Kubernetes API.
key_file:
description:
- Path to a key file used to authenticate with the API.
type: path
kubeconfig:
description:
- Path to an existing Kubernetes config file. If not provided, and no other connection
options are provided, the openshift client will attempt to load the default
configuration file from I(~/.kube/config.json).
type: path
namespace:
description:
- Namespaces provide a scope for names. Names of resources need to be unique within
a namespace, but not across namespaces. Provide the namespace for the object.
password:
description:
- Provide a password for connecting to the API. Use in conjunction with I(username).
resource_definition:
description:
- Provide the YAML definition for the object, bypassing any modules parameters
intended to define object attributes.
type: dict
src:
description:
- Provide a path to a file containing the YAML definition of the object. Mutually
exclusive with I(resource_definition).
type: path
ssl_ca_cert:
description:
- Path to a CA certificate used to authenticate with the API.
type: path
state:
description:
- Determines if an object should be created, patched, or deleted. When set to
C(present), the object will be created, if it does not exist, or patched, if
parameter values differ from the existing object's attributes, and deleted,
if set to C(absent). A patch operation results in merging lists and updating
dictionaries, with lists being merged into a unique set of values. If a list
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
is performed, where individual elements with a matching I(name_) or I(type)
are merged. To force the replacement of lists, set the I(force) option to C(True).
default: present
choices:
- present
- absent
username:
description:
- Provide a username for connecting to the API.
verify_ssl:
description:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- kubernetes == 1.0.0
'''
EXAMPLES = '''
'''
RETURN = '''
api_version:
type: string
description: Requested API version
role_binding_list:
type: complex
returned: when I(state) = C(present)
contains:
api_version:
description:
- APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
type: str
items:
description:
- Items is a list of RoleBindings
type: list
contains:
api_version:
description:
- APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value,
and may reject unrecognized values.
type: str
kind:
description:
- Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated. In CamelCase.
type: str
metadata:
description:
- Standard object's metadata.
type: complex
contains:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource
that may be set by external tools to store and retrieve arbitrary
metadata. They are not queryable and should be preserved when modifying
objects.
type: complex
contains: str, str
cluster_name:
description:
- The name of the cluster which the object belongs to. This is used
to distinguish resources with same name and namespace in different
clusters. This field is not set anywhere right now and apiserver is
going to ignore it if set in create or update request.
type: str
creation_timestamp:
description:
- CreationTimestamp is a timestamp representing the server time when
this object was created. It is not guaranteed to be set in happens-before
order across separate operations. Clients may not set this value.
It is represented in RFC3339 form and is in UTC. Populated by the
system. Read-only. Null for lists.
type: complex
contains: {}
deletion_grace_period_seconds:
description:
- Number of seconds allowed for this object to gracefully terminate
before it will be removed from the system. Only set when deletionTimestamp
is also set. May only be shortened. Read-only.
type: int
deletion_timestamp:
description:
- DeletionTimestamp is RFC 3339 date and time at which this resource
will be deleted. This field is set by the server when a graceful deletion
is requested by the user, and is not directly settable by a client.
The resource is expected to be deleted (no longer visible from resource
lists, and not reachable by name) after the time in this field. Once
set, this value may not be unset or be set further into the future,
although it may be shortened or the resource may be deleted prior
to this time. For example, a user may request that a pod is deleted
in 30 seconds. The Kubelet will react by sending a graceful termination
signal to the containers in the pod. After that 30 seconds, the Kubelet
will send a hard termination signal (SIGKILL) to the container and
after cleanup, remove the pod from the API. In the presence of network
partitions, this object may still exist after this timestamp, until
an administrator or automated process can determine the resource is
fully terminated. If not set, graceful deletion of the object has
not been requested. Populated by the system when a graceful deletion
is requested. Read-only.
type: complex
contains: {}
finalizers:
description:
- Must be empty before the object is deleted from the registry. Each
entry is an identifier for the responsible component that will remove
the entry from the list. If the deletionTimestamp of the object is
non-nil, entries in this list can only be removed.
type: list
contains: str
generate_name:
description:
- GenerateName is an optional prefix, used by the server, to generate
a unique name ONLY IF the Name field has not been provided. If this
field is used, the name returned to the client will be different than
the name passed. This value will also be combined with a unique suffix.
The provided value has the same validation rules as the Name field,
and may be truncated by the length of the suffix required to make
the value unique on the server. If this field is specified and the
generated name exists, the server will NOT return a 409 - instead,
it will either return 201 Created or 500 with Reason ServerTimeout
indicating a unique name could not be found in the time allotted,
and the client should retry (optionally after the time indicated in
the Retry-After header). Applied only if Name is not specified.
type: str
generation:
description:
- A sequence number representing a specific generation of the desired
state. Populated by the system. Read-only.
type: int
labels:
description:
- Map of string keys and values that can be used to organize and categorize
(scope and select) objects. May match selectors of replication controllers
and services.
type: complex
contains: str, str
name:
description:
- Name must be unique within a namespace. Is required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically. Name is primarily
intended for creation idempotence and configuration definition. Cannot
be updated.
type: str
namespace:
description:
- Namespace defines the space within each name must be unique. An empty
namespace is equivalent to the "default" namespace, but "default"
is the canonical representation. Not all objects are required to be
scoped to a namespace - the value of this field for those objects
will be empty. Must be a DNS_LABEL. Cannot be updated.
type: str
owner_references:
description:
- List of objects depended by this object. If ALL objects in the list
have been deleted, this object will be garbage collected. If this
object is managed by a controller, then an entry in this list will
point to this controller, with the controller field set to true. There
cannot be more than one managing controller.
type: list
contains:
api_version:
description:
- API version of the referent.
type: str
controller:
description:
- If true, this reference points to the managing controller.
type: bool
kind:
description:
- Kind of the referent.
type: str
name:
description:
- Name of the referent.
type: str
uid:
description:
- UID of the referent.
type: str
resource_version:
description:
- An opaque value that represents the internal version of this object
that can be used by clients to determine when objects have changed.
May be used for optimistic concurrency, change detection, and the
watch operation on a resource or set of resources. Clients must treat
these values as opaque and passed unmodified back to the server. They
may only be valid for a particular resource or set of resources. Populated
by the system. Read-only. Value must be treated as opaque by clients
and .
type: str
self_link:
description:
- SelfLink is a URL representing this object. Populated by the system.
Read-only.
type: str
uid:
description:
- UID is the unique in time and space value for this object. It is typically
generated by the server on successful creation of a resource and is
not allowed to change on PUT operations. Populated by the system.
Read-only.
type: str
role_ref:
description:
- RoleRef can reference a Role in the current namespace or a ClusterRole
in the global namespace. If the RoleRef cannot be resolved, the Authorizer
must return an error.
type: complex
contains:
api_group:
description:
- APIGroup is the group for the resource being referenced
type: str
kind:
description:
- Kind is the type of resource being referenced
type: str
name:
description:
- Name is the name of resource being referenced
type: str
subjects:
description:
- Subjects holds references to the objects the role applies to.
type: list
contains:
api_version:
description:
- APIVersion holds the API group and version of the referenced object.
type: str
kind:
description:
- Kind of object being referenced. Values defined by this API group
are "User", "Group", and "ServiceAccount". If the Authorizer does
not recognized the kind value, the Authorizer should report an error.
type: str
name:
description:
- Name of the object being referenced.
type: str
namespace:
description:
- Namespace of the referenced object. If the object kind is non-namespace,
such as "User" or "Group", and this value is not empty the Authorizer
should report an error.
type: str
kind:
description:
- Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to. Cannot
be updated. In CamelCase.
type: str
metadata:
description:
- Standard object's metadata.
type: complex
contains:
resource_version:
description:
- String that identifies the server's internal version of this object that
can be used by clients to determine when objects have changed. Value must
be treated as opaque by clients and passed unmodified back to the server.
Populated by the system. Read-only.
type: str
self_link:
description:
- SelfLink is a URL representing this object. Populated by the system. Read-only.
type: str
'''
def main():
try:
module = KubernetesAnsibleModule('role_binding_list', 'V1alpha1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,380 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1alpha1_role_list
short_description: Kubernetes RoleList
description:
- Retrieve a list of roles. List operations provide a snapshot read of the underlying
objects, returning a resource_version representing a consistent version of the listed
objects.
version_added: 2.3.0
author: OpenShift (@openshift)
options:
api_key:
description:
- Token used to connect to the API.
cert_file:
description:
- Path to a certificate used to authenticate with the API.
type: path
context:
description:
- The name of a context found in the Kubernetes config file.
debug:
description:
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
default: false
type: bool
force:
description:
- If set to C(True), and I(state) is C(present), an existing object will updated,
and lists will be replaced, rather than merged.
default: false
type: bool
host:
description:
- Provide a URL for acessing the Kubernetes API.
key_file:
description:
- Path to a key file used to authenticate with the API.
type: path
kubeconfig:
description:
- Path to an existing Kubernetes config file. If not provided, and no other connection
options are provided, the openshift client will attempt to load the default
configuration file from I(~/.kube/config.json).
type: path
namespace:
description:
- Namespaces provide a scope for names. Names of resources need to be unique within
a namespace, but not across namespaces. Provide the namespace for the object.
password:
description:
- Provide a password for connecting to the API. Use in conjunction with I(username).
resource_definition:
description:
- Provide the YAML definition for the object, bypassing any modules parameters
intended to define object attributes.
type: dict
src:
description:
- Provide a path to a file containing the YAML definition of the object. Mutually
exclusive with I(resource_definition).
type: path
ssl_ca_cert:
description:
- Path to a CA certificate used to authenticate with the API.
type: path
state:
description:
- Determines if an object should be created, patched, or deleted. When set to
C(present), the object will be created, if it does not exist, or patched, if
parameter values differ from the existing object's attributes, and deleted,
if set to C(absent). A patch operation results in merging lists and updating
dictionaries, with lists being merged into a unique set of values. If a list
contains a dictionary with a I(name) or I(type) attribute, a strategic merge
is performed, where individual elements with a matching I(name_) or I(type)
are merged. To force the replacement of lists, set the I(force) option to C(True).
default: present
choices:
- present
- absent
username:
description:
- Provide a username for connecting to the API.
verify_ssl:
description:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- kubernetes == 1.0.0
'''
EXAMPLES = '''
'''
RETURN = '''
api_version:
type: string
description: Requested API version
role_list:
type: complex
returned: when I(state) = C(present)
contains:
api_version:
description:
- APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
type: str
items:
description:
- Items is a list of Roles
type: list
contains:
api_version:
description:
- APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value,
and may reject unrecognized values.
type: str
kind:
description:
- Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated. In CamelCase.
type: str
metadata:
description:
- Standard object's metadata.
type: complex
contains:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource
that may be set by external tools to store and retrieve arbitrary
metadata. They are not queryable and should be preserved when modifying
objects.
type: complex
contains: str, str
cluster_name:
description:
- The name of the cluster which the object belongs to. This is used
to distinguish resources with same name and namespace in different
clusters. This field is not set anywhere right now and apiserver is
going to ignore it if set in create or update request.
type: str
creation_timestamp:
description:
- CreationTimestamp is a timestamp representing the server time when
this object was created. It is not guaranteed to be set in happens-before
order across separate operations. Clients may not set this value.
It is represented in RFC3339 form and is in UTC. Populated by the
system. Read-only. Null for lists.
type: complex
contains: {}
deletion_grace_period_seconds:
description:
- Number of seconds allowed for this object to gracefully terminate
before it will be removed from the system. Only set when deletionTimestamp
is also set. May only be shortened. Read-only.
type: int
deletion_timestamp:
description:
- DeletionTimestamp is RFC 3339 date and time at which this resource
will be deleted. This field is set by the server when a graceful deletion
is requested by the user, and is not directly settable by a client.
The resource is expected to be deleted (no longer visible from resource
lists, and not reachable by name) after the time in this field. Once
set, this value may not be unset or be set further into the future,
although it may be shortened or the resource may be deleted prior
to this time. For example, a user may request that a pod is deleted
in 30 seconds. The Kubelet will react by sending a graceful termination
signal to the containers in the pod. After that 30 seconds, the Kubelet
will send a hard termination signal (SIGKILL) to the container and
after cleanup, remove the pod from the API. In the presence of network
partitions, this object may still exist after this timestamp, until
an administrator or automated process can determine the resource is
fully terminated. If not set, graceful deletion of the object has
not been requested. Populated by the system when a graceful deletion
is requested. Read-only.
type: complex
contains: {}
finalizers:
description:
- Must be empty before the object is deleted from the registry. Each
entry is an identifier for the responsible component that will remove
the entry from the list. If the deletionTimestamp of the object is
non-nil, entries in this list can only be removed.
type: list
contains: str
generate_name:
description:
- GenerateName is an optional prefix, used by the server, to generate
a unique name ONLY IF the Name field has not been provided. If this
field is used, the name returned to the client will be different than
the name passed. This value will also be combined with a unique suffix.
The provided value has the same validation rules as the Name field,
and may be truncated by the length of the suffix required to make
the value unique on the server. If this field is specified and the
generated name exists, the server will NOT return a 409 - instead,
it will either return 201 Created or 500 with Reason ServerTimeout
indicating a unique name could not be found in the time allotted,
and the client should retry (optionally after the time indicated in
the Retry-After header). Applied only if Name is not specified.
type: str
generation:
description:
- A sequence number representing a specific generation of the desired
state. Populated by the system. Read-only.
type: int
labels:
description:
- Map of string keys and values that can be used to organize and categorize
(scope and select) objects. May match selectors of replication controllers
and services.
type: complex
contains: str, str
name:
description:
- Name must be unique within a namespace. Is required when creating
resources, although some resources may allow a client to request the
generation of an appropriate name automatically. Name is primarily
intended for creation idempotence and configuration definition. Cannot
be updated.
type: str
namespace:
description:
- Namespace defines the space within each name must be unique. An empty
namespace is equivalent to the "default" namespace, but "default"
is the canonical representation. Not all objects are required to be
scoped to a namespace - the value of this field for those objects
will be empty. Must be a DNS_LABEL. Cannot be updated.
type: str
owner_references:
description:
- List of objects depended by this object. If ALL objects in the list
have been deleted, this object will be garbage collected. If this
object is managed by a controller, then an entry in this list will
point to this controller, with the controller field set to true. There
cannot be more than one managing controller.
type: list
contains:
api_version:
description:
- API version of the referent.
type: str
controller:
description:
- If true, this reference points to the managing controller.
type: bool
kind:
description:
- Kind of the referent.
type: str
name:
description:
- Name of the referent.
type: str
uid:
description:
- UID of the referent.
type: str
resource_version:
description:
- An opaque value that represents the internal version of this object
that can be used by clients to determine when objects have changed.
May be used for optimistic concurrency, change detection, and the
watch operation on a resource or set of resources. Clients must treat
these values as opaque and passed unmodified back to the server. They
may only be valid for a particular resource or set of resources. Populated
by the system. Read-only. Value must be treated as opaque by clients
and .
type: str
self_link:
description:
- SelfLink is a URL representing this object. Populated by the system.
Read-only.
type: str
uid:
description:
- UID is the unique in time and space value for this object. It is typically
generated by the server on successful creation of a resource and is
not allowed to change on PUT operations. Populated by the system.
Read-only.
type: str
rules:
description:
- Rules holds all the PolicyRules for this Role
type: list
contains:
api_groups:
description:
- APIGroups is the name of the APIGroup that contains the resources.
If multiple API groups are specified, any action requested against
one of the enumerated resources in any API group will be allowed.
type: list
contains: str
attribute_restrictions:
description:
- AttributeRestrictions will vary depending on what the Authorizer/AuthorizationAttributeBuilder
pair supports. If the Authorizer does not recognize how to handle
the AttributeRestrictions, the Authorizer should report an error.
type: complex
contains:
raw:
description:
- Raw is the underlying serialization of this object.
type: str
non_resource_ur_ls:
description:
- NonResourceURLs is a set of partial urls that a user should have access
to. *s are allowed, but only as the full, final step in the path This
name is intentionally different than the internal type so that the
DefaultConvert works nicely and because the ordering may be different.
Since non-resource URLs are not namespaced, this field is only applicable
for ClusterRoles referenced from a ClusterRoleBinding. Rules can either
apply to API resources (such as "pods" or "secrets") or non-resource
URL paths (such as "/api"), but not both.
type: list
contains: str
resource_names:
description:
- ResourceNames is an optional white list of names that the rule applies
to. An empty set means that everything is allowed.
type: list
contains: str
resources:
description:
- Resources is a list of resources this rule applies to. ResourceAll
represents all resources.
type: list
contains: str
verbs:
description:
- Verbs is a list of Verbs that apply to ALL the ResourceKinds and AttributeRestrictions
contained in this rule. VerbAll represents all kinds.
type: list
contains: str
kind:
description:
- Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to. Cannot
be updated. In CamelCase.
type: str
metadata:
description:
- Standard object's metadata.
type: complex
contains:
resource_version:
description:
- String that identifies the server's internal version of this object that
can be used by clients to determine when objects have changed. Value must
be treated as opaque by clients and passed unmodified back to the server.
Populated by the system. Read-only.
type: str
self_link:
description:
- SelfLink is a URL representing this object. Populated by the system. Read-only.
type: str
'''
def main():
try:
module = KubernetesAnsibleModule('role_list', 'V1alpha1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_daemon_set
@@ -317,7 +317,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -2075,80 +2075,6 @@ daemon_set:
if the port is other than default (typically TCP ports
860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should populate
this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this setting.
This might be in conflict with other options that affect
the file mode, like fsGroup, and the result can be other
mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API
version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must be
a value between 0 and 0777. If not specified, the
volume defaultMode will be used. This might be in
conflict with other options that affect the file mode,
like fsGroup, and the result can be other mode bits
set.'
type: int
name:
description:
- "Required: Name is the relative path name of the file\
\ to be created. Must not be absolute or contain the\
\ '..' path. Must be utf-8 encoded. The first item\
\ of the relative path must not start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the pod.
@@ -2382,17 +2308,16 @@ daemon_set:
def main():
try:
module = OpenShiftAnsibleModule('daemon_set', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('daemon_set', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_daemon_set_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -1903,82 +1903,6 @@ daemon_set_list:
ip_addr:port if the port is other than default (typically
TCP ports 860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should
populate this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this
setting. This might be in conflict with other options
that affect the file mode, like fsGroup, and the result
can be other mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified
API version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must
be a value between 0 and 0777. If not specified,
the volume defaultMode will be used. This might
be in conflict with other options that affect
the file mode, like fsGroup, and the result can
be other mode bits set.'
type: int
name:
description:
- "Required: Name is the relative path name of the\
\ file to be created. Must not be absolute or\
\ contain the '..' path. Must be utf-8 encoded.\
\ The first item of the relative path must not\
\ start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory,
requests.cpu and requests.memory) are currently
supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed
resources, defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the
@@ -2241,17 +2165,16 @@ daemon_set_list:
def main():
try:
module = OpenShiftAnsibleModule('daemon_set_list', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('daemon_set_list', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_deployment
@@ -394,7 +394,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -2234,80 +2234,6 @@ deployment:
if the port is other than default (typically TCP ports
860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should populate
this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this setting.
This might be in conflict with other options that affect
the file mode, like fsGroup, and the result can be other
mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API
version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must be
a value between 0 and 0777. If not specified, the
volume defaultMode will be used. This might be in
conflict with other options that affect the file mode,
like fsGroup, and the result can be other mode bits
set.'
type: int
name:
description:
- "Required: Name is the relative path name of the file\
\ to be created. Must not be absolute or contain the\
\ '..' path. Must be utf-8 encoded. The first item\
\ of the relative path must not start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the pod.
@@ -2575,17 +2501,16 @@ deployment:
def main():
try:
module = OpenShiftAnsibleModule('deployment', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('deployment', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_deployment_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -1988,82 +1988,6 @@ deployment_list:
ip_addr:port if the port is other than default (typically
TCP ports 860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should
populate this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this
setting. This might be in conflict with other options
that affect the file mode, like fsGroup, and the result
can be other mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified
API version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must
be a value between 0 and 0777. If not specified,
the volume defaultMode will be used. This might
be in conflict with other options that affect
the file mode, like fsGroup, and the result can
be other mode bits set.'
type: int
name:
description:
- "Required: Name is the relative path name of the\
\ file to be created. Must not be absolute or\
\ contain the '..' path. Must be utf-8 encoded.\
\ The first item of the relative path must not\
\ start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory,
requests.cpu and requests.memory) are currently
supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed
resources, defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the
@@ -2359,17 +2283,16 @@ deployment_list:
def main():
try:
module = OpenShiftAnsibleModule('deployment_list', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('deployment_list', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_eviction
@@ -118,7 +118,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -341,17 +341,16 @@ eviction:
def main():
try:
module = OpenShiftAnsibleModule('eviction', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('eviction', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_horizontal_pod_autoscaler
@@ -148,7 +148,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -410,17 +410,16 @@ horizontal_pod_autoscaler:
def main():
try:
module = OpenShiftAnsibleModule('horizontal_pod_autoscaler', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('horizontal_pod_autoscaler', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_horizontal_pod_autoscaler_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -391,17 +391,16 @@ horizontal_pod_autoscaler_list:
def main():
try:
module = OpenShiftAnsibleModule('horizontal_pod_autoscaler_list', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('horizontal_pod_autoscaler_list', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_ingress
@@ -133,7 +133,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -442,17 +442,16 @@ ingress:
def main():
try:
module = OpenShiftAnsibleModule('ingress', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('ingress', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_ingress_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -439,17 +439,16 @@ ingress_list:
def main():
try:
module = OpenShiftAnsibleModule('ingress_list', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('ingress_list', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_job
@@ -352,7 +352,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -2135,80 +2135,6 @@ job:
if the port is other than default (typically TCP ports
860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should populate
this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this setting.
This might be in conflict with other options that affect
the file mode, like fsGroup, and the result can be other
mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API
version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must be
a value between 0 and 0777. If not specified, the
volume defaultMode will be used. This might be in
conflict with other options that affect the file mode,
like fsGroup, and the result can be other mode bits
set.'
type: int
name:
description:
- "Required: Name is the relative path name of the file\
\ to be created. Must not be absolute or contain the\
\ '..' path. Must be utf-8 encoded. The first item\
\ of the relative path must not start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the pod.
@@ -2479,17 +2405,16 @@ job:
def main():
try:
module = OpenShiftAnsibleModule('job', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('job', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_job_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -1930,82 +1930,6 @@ job_list:
ip_addr:port if the port is other than default (typically
TCP ports 860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should
populate this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this
setting. This might be in conflict with other options
that affect the file mode, like fsGroup, and the result
can be other mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified
API version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must
be a value between 0 and 0777. If not specified,
the volume defaultMode will be used. This might
be in conflict with other options that affect
the file mode, like fsGroup, and the result can
be other mode bits set.'
type: int
name:
description:
- "Required: Name is the relative path name of the\
\ file to be created. Must not be absolute or\
\ contain the '..' path. Must be utf-8 encoded.\
\ The first item of the relative path must not\
\ start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory,
requests.cpu and requests.memory) are currently
supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed
resources, defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the
@@ -2304,17 +2228,16 @@ job_list:
def main():
try:
module = OpenShiftAnsibleModule('job_list', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('job_list', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,448 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_local_subject_access_review
short_description: Kubernetes LocalSubjectAccessReview
description:
- Manage the lifecycle of a local_subject_access_review object. Supports check mode,
and attempts to to be idempotent.
version_added: 2.3.0
author: OpenShift (@openshift)
options:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource that may
be set by external tools to store and retrieve arbitrary metadata. They are
not queryable and should be preserved when modifying objects.
type: dict
api_key:
description:
- Token used to connect to the API.
cert_file:
description:
- Path to a certificate used to authenticate with the API.
type: path
context:
description:
- The name of a context found in the Kubernetes config file.
debug:
description:
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
default: false
type: bool
force:
description:
- If set to C(True), and I(state) is C(present), an existing object will updated,
and lists will be replaced, rather than merged.
default: false
type: bool
host:
description:
- Provide a URL for acessing the Kubernetes API.
key_file:
description:
- Path to a key file used to authenticate with the API.
type: path
kubeconfig:
description:
- Path to an existing Kubernetes config file. If not provided, and no other connection
options are provided, the openshift client will attempt to load the default
configuration file from I(~/.kube/config.json).
type: path
labels:
description:
- Map of string keys and values that can be used to organize and categorize (scope
and select) objects. May match selectors of replication controllers and services.
type: dict
name:
description:
- Name must be unique within a namespace. Is required when creating resources,
although some resources may allow a client to request the generation of an appropriate
name automatically. Name is primarily intended for creation idempotence and
configuration definition. Cannot be updated.
namespace:
description:
- Namespace defines the space within each name must be unique. An empty namespace
is equivalent to the "default" namespace, but "default" is the canonical representation.
Not all objects are required to be scoped to a namespace - the value of this
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
password:
description:
- Provide a password for connecting to the API. Use in conjunction with I(username).
spec_extra:
description:
- Extra corresponds to the user.Info.GetExtra() method from the authenticator.
Since that is input to the authorizer it needs a reflection here.
aliases:
- extra
type: dict
spec_group:
description:
- Groups is the groups you're testing for.
aliases:
- group
type: list
spec_non_resource_attributes_path:
description:
- Path is the URL path of the request
aliases:
- non_resource_attributes_path
spec_non_resource_attributes_verb:
description:
- Verb is the standard HTTP verb
aliases:
- non_resource_attributes_verb
spec_resource_attributes_group:
description:
- Group is the API Group of the Resource. "*" means all.
aliases:
- resource_attributes_group
spec_resource_attributes_name:
description:
- Name is the name of the resource being requested for a "get" or deleted for
a "delete". "" (empty) means all.
aliases:
- resource_attributes_name
spec_resource_attributes_namespace:
description:
- Namespace is the namespace of the action being requested. Currently, there is
no distinction between no namespace and all namespaces "" (empty) is defaulted
for LocalSubjectAccessReviews "" (empty) is empty for cluster-scoped resources
"" (empty) means "all" for namespace scoped resources from a SubjectAccessReview
or SelfSubjectAccessReview
aliases:
- resource_attributes_namespace
spec_resource_attributes_resource:
description:
- Resource is one of the existing resource types. "*" means all.
aliases:
- resource_attributes_resource
spec_resource_attributes_subresource:
description:
- Subresource is one of the existing resource types. "" means none.
aliases:
- resource_attributes_subresource
spec_resource_attributes_verb:
description:
- 'Verb is a kubernetes resource API verb, like: get, list, watch, create, update,
delete, proxy. "*" means all.'
aliases:
- resource_attributes_verb
spec_resource_attributes_version:
description:
- Version is the API Version of the Resource. "*" means all.
aliases:
- resource_attributes_version
spec_user:
description:
- User is the user you're testing for. If you specify "User" but not "Group",
then is it interpreted as "What if User were not a member of any groups
aliases:
- user
ssl_ca_cert:
description:
- Path to a CA certificate used to authenticate with the API.
type: path
username:
description:
- Provide a username for connecting to the API.
verify_ssl:
description:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- kubernetes == 1.0.0
'''
EXAMPLES = '''
'''
RETURN = '''
api_version:
type: string
description: Requested API version
local_subject_access_review:
type: complex
returned: on success
contains:
api_version:
description:
- APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
type: str
kind:
description:
- Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to. Cannot
be updated. In CamelCase.
type: str
metadata:
description: []
type: complex
contains:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource that
may be set by external tools to store and retrieve arbitrary metadata.
They are not queryable and should be preserved when modifying objects.
type: complex
contains: str, str
cluster_name:
description:
- The name of the cluster which the object belongs to. This is used to distinguish
resources with same name and namespace in different clusters. This field
is not set anywhere right now and apiserver is going to ignore it if set
in create or update request.
type: str
creation_timestamp:
description:
- CreationTimestamp is a timestamp representing the server time when this
object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC. Populated by the system. Read-only. Null
for lists.
type: complex
contains: {}
deletion_grace_period_seconds:
description:
- Number of seconds allowed for this object to gracefully terminate before
it will be removed from the system. Only set when deletionTimestamp is
also set. May only be shortened. Read-only.
type: int
deletion_timestamp:
description:
- DeletionTimestamp is RFC 3339 date and time at which this resource will
be deleted. This field is set by the server when a graceful deletion is
requested by the user, and is not directly settable by a client. The resource
is expected to be deleted (no longer visible from resource lists, and
not reachable by name) after the time in this field. Once set, this value
may not be unset or be set further into the future, although it may be
shortened or the resource may be deleted prior to this time. For example,
a user may request that a pod is deleted in 30 seconds. The Kubelet will
react by sending a graceful termination signal to the containers in the
pod. After that 30 seconds, the Kubelet will send a hard termination signal
(SIGKILL) to the container and after cleanup, remove the pod from the
API. In the presence of network partitions, this object may still exist
after this timestamp, until an administrator or automated process can
determine the resource is fully terminated. If not set, graceful deletion
of the object has not been requested. Populated by the system when a graceful
deletion is requested. Read-only.
type: complex
contains: {}
finalizers:
description:
- Must be empty before the object is deleted from the registry. Each entry
is an identifier for the responsible component that will remove the entry
from the list. If the deletionTimestamp of the object is non-nil, entries
in this list can only be removed.
type: list
contains: str
generate_name:
description:
- GenerateName is an optional prefix, used by the server, to generate a
unique name ONLY IF the Name field has not been provided. If this field
is used, the name returned to the client will be different than the name
passed. This value will also be combined with a unique suffix. The provided
value has the same validation rules as the Name field, and may be truncated
by the length of the suffix required to make the value unique on the server.
If this field is specified and the generated name exists, the server will
NOT return a 409 - instead, it will either return 201 Created or 500 with
Reason ServerTimeout indicating a unique name could not be found in the
time allotted, and the client should retry (optionally after the time
indicated in the Retry-After header). Applied only if Name is not specified.
type: str
generation:
description:
- A sequence number representing a specific generation of the desired state.
Populated by the system. Read-only.
type: int
labels:
description:
- Map of string keys and values that can be used to organize and categorize
(scope and select) objects. May match selectors of replication controllers
and services.
type: complex
contains: str, str
name:
description:
- Name must be unique within a namespace. Is required when creating resources,
although some resources may allow a client to request the generation of
an appropriate name automatically. Name is primarily intended for creation
idempotence and configuration definition. Cannot be updated.
type: str
namespace:
description:
- Namespace defines the space within each name must be unique. An empty
namespace is equivalent to the "default" namespace, but "default" is the
canonical representation. Not all objects are required to be scoped to
a namespace - the value of this field for those objects will be empty.
Must be a DNS_LABEL. Cannot be updated.
type: str
owner_references:
description:
- List of objects depended by this object. If ALL objects in the list have
been deleted, this object will be garbage collected. If this object is
managed by a controller, then an entry in this list will point to this
controller, with the controller field set to true. There cannot be more
than one managing controller.
type: list
contains:
api_version:
description:
- API version of the referent.
type: str
controller:
description:
- If true, this reference points to the managing controller.
type: bool
kind:
description:
- Kind of the referent.
type: str
name:
description:
- Name of the referent.
type: str
uid:
description:
- UID of the referent.
type: str
resource_version:
description:
- An opaque value that represents the internal version of this object that
can be used by clients to determine when objects have changed. May be
used for optimistic concurrency, change detection, and the watch operation
on a resource or set of resources. Clients must treat these values as
opaque and passed unmodified back to the server. They may only be valid
for a particular resource or set of resources. Populated by the system.
Read-only. Value must be treated as opaque by clients and .
type: str
self_link:
description:
- SelfLink is a URL representing this object. Populated by the system. Read-only.
type: str
uid:
description:
- UID is the unique in time and space value for this object. It is typically
generated by the server on successful creation of a resource and is not
allowed to change on PUT operations. Populated by the system. Read-only.
type: str
spec:
description:
- Spec holds information about the request being evaluated. spec.namespace must
be equal to the namespace you made the request against. If empty, it is defaulted.
type: complex
contains:
extra:
description:
- Extra corresponds to the user.Info.GetExtra() method from the authenticator.
Since that is input to the authorizer it needs a reflection here.
type: complex
contains: str, list[str]
group:
description:
- Groups is the groups you're testing for.
type: list
contains: str
non_resource_attributes:
description:
- NonResourceAttributes describes information for a non-resource access
request
type: complex
contains:
path:
description:
- Path is the URL path of the request
type: str
verb:
description:
- Verb is the standard HTTP verb
type: str
resource_attributes:
description:
- ResourceAuthorizationAttributes describes information for a resource access
request
type: complex
contains:
group:
description:
- Group is the API Group of the Resource. "*" means all.
type: str
name:
description:
- Name is the name of the resource being requested for a "get" or deleted
for a "delete". "" (empty) means all.
type: str
namespace:
description:
- Namespace is the namespace of the action being requested. Currently,
there is no distinction between no namespace and all namespaces ""
(empty) is defaulted for LocalSubjectAccessReviews "" (empty) is empty
for cluster-scoped resources "" (empty) means "all" for namespace
scoped resources from a SubjectAccessReview or SelfSubjectAccessReview
type: str
resource:
description:
- Resource is one of the existing resource types. "*" means all.
type: str
subresource:
description:
- Subresource is one of the existing resource types. "" means none.
type: str
verb:
description:
- 'Verb is a kubernetes resource API verb, like: get, list, watch, create,
update, delete, proxy. "*" means all.'
type: str
version:
description:
- Version is the API Version of the Resource. "*" means all.
type: str
user:
description:
- User is the user you're testing for. If you specify "User" but not "Group",
then is it interpreted as "What if User were not a member of any groups
type: str
status:
description:
- Status is filled in by the server and indicates whether the request is allowed
or not
type: complex
contains:
allowed:
description:
- Allowed is required. True if the action would be allowed, false otherwise.
type: bool
evaluation_error:
description:
- EvaluationError is an indication that some error occurred during the authorization
check. It is entirely possible to get an error and be able to continue
determine authorization status in spite of it. For instance, RBAC can
be missing a role, but enough roles are still present and bound to reason
about the request.
type: str
reason:
description:
- Reason is optional. It indicates why a request was allowed or denied.
type: str
'''
def main():
try:
module = KubernetesAnsibleModule('local_subject_access_review', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_network_policy
@@ -136,7 +136,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -493,17 +493,16 @@ network_policy:
def main():
try:
module = OpenShiftAnsibleModule('network_policy', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('network_policy', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_network_policy_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -492,17 +492,16 @@ network_policy_list:
def main():
try:
module = OpenShiftAnsibleModule('network_policy_list', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('network_policy_list', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_pod_disruption_budget
@@ -131,7 +131,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -405,17 +405,16 @@ pod_disruption_budget:
def main():
try:
module = OpenShiftAnsibleModule('pod_disruption_budget', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('pod_disruption_budget', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_pod_disruption_budget_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -402,17 +402,16 @@ pod_disruption_budget_list:
def main():
try:
module = OpenShiftAnsibleModule('pod_disruption_budget_list', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('pod_disruption_budget_list', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_replica_set
@@ -332,7 +332,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -2101,80 +2101,6 @@ replica_set:
if the port is other than default (typically TCP ports
860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should populate
this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this setting.
This might be in conflict with other options that affect
the file mode, like fsGroup, and the result can be other
mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API
version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must be
a value between 0 and 0777. If not specified, the
volume defaultMode will be used. This might be in
conflict with other options that affect the file mode,
like fsGroup, and the result can be other mode bits
set.'
type: int
name:
description:
- "Required: Name is the relative path name of the file\
\ to be created. Must not be absolute or contain the\
\ '..' path. Must be utf-8 encoded. The first item\
\ of the relative path must not start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the pod.
@@ -2438,17 +2364,16 @@ replica_set:
def main():
try:
module = OpenShiftAnsibleModule('replica_set', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('replica_set', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_replica_set_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -1915,82 +1915,6 @@ replica_set_list:
ip_addr:port if the port is other than default (typically
TCP ports 860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should
populate this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this
setting. This might be in conflict with other options
that affect the file mode, like fsGroup, and the result
can be other mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified
API version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must
be a value between 0 and 0777. If not specified,
the volume defaultMode will be used. This might
be in conflict with other options that affect
the file mode, like fsGroup, and the result can
be other mode bits set.'
type: int
name:
description:
- "Required: Name is the relative path name of the\
\ file to be created. Must not be absolute or\
\ contain the '..' path. Must be utf-8 encoded.\
\ The first item of the relative path must not\
\ start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory,
requests.cpu and requests.memory) are currently
supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed
resources, defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the
@@ -2282,17 +2206,16 @@ replica_set_list:
def main():
try:
module = OpenShiftAnsibleModule('replica_set_list', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('replica_set_list', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_scale
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -304,17 +304,16 @@ scale:
def main():
try:
module = OpenShiftAnsibleModule('scale', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('scale', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,413 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_self_subject_access_review
short_description: Kubernetes SelfSubjectAccessReview
description:
- Manage the lifecycle of a self_subject_access_review object. Supports check mode,
and attempts to to be idempotent.
version_added: 2.3.0
author: OpenShift (@openshift)
options:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource that may
be set by external tools to store and retrieve arbitrary metadata. They are
not queryable and should be preserved when modifying objects.
type: dict
api_key:
description:
- Token used to connect to the API.
cert_file:
description:
- Path to a certificate used to authenticate with the API.
type: path
context:
description:
- The name of a context found in the Kubernetes config file.
debug:
description:
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
default: false
type: bool
force:
description:
- If set to C(True), and I(state) is C(present), an existing object will updated,
and lists will be replaced, rather than merged.
default: false
type: bool
host:
description:
- Provide a URL for acessing the Kubernetes API.
key_file:
description:
- Path to a key file used to authenticate with the API.
type: path
kubeconfig:
description:
- Path to an existing Kubernetes config file. If not provided, and no other connection
options are provided, the openshift client will attempt to load the default
configuration file from I(~/.kube/config.json).
type: path
labels:
description:
- Map of string keys and values that can be used to organize and categorize (scope
and select) objects. May match selectors of replication controllers and services.
type: dict
name:
description:
- Name must be unique within a namespace. Is required when creating resources,
although some resources may allow a client to request the generation of an appropriate
name automatically. Name is primarily intended for creation idempotence and
configuration definition. Cannot be updated.
namespace:
description:
- Namespace defines the space within each name must be unique. An empty namespace
is equivalent to the "default" namespace, but "default" is the canonical representation.
Not all objects are required to be scoped to a namespace - the value of this
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
password:
description:
- Provide a password for connecting to the API. Use in conjunction with I(username).
spec_non_resource_attributes_path:
description:
- Path is the URL path of the request
aliases:
- non_resource_attributes_path
spec_non_resource_attributes_verb:
description:
- Verb is the standard HTTP verb
aliases:
- non_resource_attributes_verb
spec_resource_attributes_group:
description:
- Group is the API Group of the Resource. "*" means all.
aliases:
- resource_attributes_group
spec_resource_attributes_name:
description:
- Name is the name of the resource being requested for a "get" or deleted for
a "delete". "" (empty) means all.
aliases:
- resource_attributes_name
spec_resource_attributes_namespace:
description:
- Namespace is the namespace of the action being requested. Currently, there is
no distinction between no namespace and all namespaces "" (empty) is defaulted
for LocalSubjectAccessReviews "" (empty) is empty for cluster-scoped resources
"" (empty) means "all" for namespace scoped resources from a SubjectAccessReview
or SelfSubjectAccessReview
aliases:
- resource_attributes_namespace
spec_resource_attributes_resource:
description:
- Resource is one of the existing resource types. "*" means all.
aliases:
- resource_attributes_resource
spec_resource_attributes_subresource:
description:
- Subresource is one of the existing resource types. "" means none.
aliases:
- resource_attributes_subresource
spec_resource_attributes_verb:
description:
- 'Verb is a kubernetes resource API verb, like: get, list, watch, create, update,
delete, proxy. "*" means all.'
aliases:
- resource_attributes_verb
spec_resource_attributes_version:
description:
- Version is the API Version of the Resource. "*" means all.
aliases:
- resource_attributes_version
ssl_ca_cert:
description:
- Path to a CA certificate used to authenticate with the API.
type: path
username:
description:
- Provide a username for connecting to the API.
verify_ssl:
description:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- kubernetes == 1.0.0
'''
EXAMPLES = '''
'''
RETURN = '''
api_version:
type: string
description: Requested API version
self_subject_access_review:
type: complex
returned: on success
contains:
api_version:
description:
- APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
type: str
kind:
description:
- Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to. Cannot
be updated. In CamelCase.
type: str
metadata:
description: []
type: complex
contains:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource that
may be set by external tools to store and retrieve arbitrary metadata.
They are not queryable and should be preserved when modifying objects.
type: complex
contains: str, str
cluster_name:
description:
- The name of the cluster which the object belongs to. This is used to distinguish
resources with same name and namespace in different clusters. This field
is not set anywhere right now and apiserver is going to ignore it if set
in create or update request.
type: str
creation_timestamp:
description:
- CreationTimestamp is a timestamp representing the server time when this
object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC. Populated by the system. Read-only. Null
for lists.
type: complex
contains: {}
deletion_grace_period_seconds:
description:
- Number of seconds allowed for this object to gracefully terminate before
it will be removed from the system. Only set when deletionTimestamp is
also set. May only be shortened. Read-only.
type: int
deletion_timestamp:
description:
- DeletionTimestamp is RFC 3339 date and time at which this resource will
be deleted. This field is set by the server when a graceful deletion is
requested by the user, and is not directly settable by a client. The resource
is expected to be deleted (no longer visible from resource lists, and
not reachable by name) after the time in this field. Once set, this value
may not be unset or be set further into the future, although it may be
shortened or the resource may be deleted prior to this time. For example,
a user may request that a pod is deleted in 30 seconds. The Kubelet will
react by sending a graceful termination signal to the containers in the
pod. After that 30 seconds, the Kubelet will send a hard termination signal
(SIGKILL) to the container and after cleanup, remove the pod from the
API. In the presence of network partitions, this object may still exist
after this timestamp, until an administrator or automated process can
determine the resource is fully terminated. If not set, graceful deletion
of the object has not been requested. Populated by the system when a graceful
deletion is requested. Read-only.
type: complex
contains: {}
finalizers:
description:
- Must be empty before the object is deleted from the registry. Each entry
is an identifier for the responsible component that will remove the entry
from the list. If the deletionTimestamp of the object is non-nil, entries
in this list can only be removed.
type: list
contains: str
generate_name:
description:
- GenerateName is an optional prefix, used by the server, to generate a
unique name ONLY IF the Name field has not been provided. If this field
is used, the name returned to the client will be different than the name
passed. This value will also be combined with a unique suffix. The provided
value has the same validation rules as the Name field, and may be truncated
by the length of the suffix required to make the value unique on the server.
If this field is specified and the generated name exists, the server will
NOT return a 409 - instead, it will either return 201 Created or 500 with
Reason ServerTimeout indicating a unique name could not be found in the
time allotted, and the client should retry (optionally after the time
indicated in the Retry-After header). Applied only if Name is not specified.
type: str
generation:
description:
- A sequence number representing a specific generation of the desired state.
Populated by the system. Read-only.
type: int
labels:
description:
- Map of string keys and values that can be used to organize and categorize
(scope and select) objects. May match selectors of replication controllers
and services.
type: complex
contains: str, str
name:
description:
- Name must be unique within a namespace. Is required when creating resources,
although some resources may allow a client to request the generation of
an appropriate name automatically. Name is primarily intended for creation
idempotence and configuration definition. Cannot be updated.
type: str
namespace:
description:
- Namespace defines the space within each name must be unique. An empty
namespace is equivalent to the "default" namespace, but "default" is the
canonical representation. Not all objects are required to be scoped to
a namespace - the value of this field for those objects will be empty.
Must be a DNS_LABEL. Cannot be updated.
type: str
owner_references:
description:
- List of objects depended by this object. If ALL objects in the list have
been deleted, this object will be garbage collected. If this object is
managed by a controller, then an entry in this list will point to this
controller, with the controller field set to true. There cannot be more
than one managing controller.
type: list
contains:
api_version:
description:
- API version of the referent.
type: str
controller:
description:
- If true, this reference points to the managing controller.
type: bool
kind:
description:
- Kind of the referent.
type: str
name:
description:
- Name of the referent.
type: str
uid:
description:
- UID of the referent.
type: str
resource_version:
description:
- An opaque value that represents the internal version of this object that
can be used by clients to determine when objects have changed. May be
used for optimistic concurrency, change detection, and the watch operation
on a resource or set of resources. Clients must treat these values as
opaque and passed unmodified back to the server. They may only be valid
for a particular resource or set of resources. Populated by the system.
Read-only. Value must be treated as opaque by clients and .
type: str
self_link:
description:
- SelfLink is a URL representing this object. Populated by the system. Read-only.
type: str
uid:
description:
- UID is the unique in time and space value for this object. It is typically
generated by the server on successful creation of a resource and is not
allowed to change on PUT operations. Populated by the system. Read-only.
type: str
spec:
description:
- Spec holds information about the request being evaluated. user and groups
must be empty
type: complex
contains:
non_resource_attributes:
description:
- NonResourceAttributes describes information for a non-resource access
request
type: complex
contains:
path:
description:
- Path is the URL path of the request
type: str
verb:
description:
- Verb is the standard HTTP verb
type: str
resource_attributes:
description:
- ResourceAuthorizationAttributes describes information for a resource access
request
type: complex
contains:
group:
description:
- Group is the API Group of the Resource. "*" means all.
type: str
name:
description:
- Name is the name of the resource being requested for a "get" or deleted
for a "delete". "" (empty) means all.
type: str
namespace:
description:
- Namespace is the namespace of the action being requested. Currently,
there is no distinction between no namespace and all namespaces ""
(empty) is defaulted for LocalSubjectAccessReviews "" (empty) is empty
for cluster-scoped resources "" (empty) means "all" for namespace
scoped resources from a SubjectAccessReview or SelfSubjectAccessReview
type: str
resource:
description:
- Resource is one of the existing resource types. "*" means all.
type: str
subresource:
description:
- Subresource is one of the existing resource types. "" means none.
type: str
verb:
description:
- 'Verb is a kubernetes resource API verb, like: get, list, watch, create,
update, delete, proxy. "*" means all.'
type: str
version:
description:
- Version is the API Version of the Resource. "*" means all.
type: str
status:
description:
- Status is filled in by the server and indicates whether the request is allowed
or not
type: complex
contains:
allowed:
description:
- Allowed is required. True if the action would be allowed, false otherwise.
type: bool
evaluation_error:
description:
- EvaluationError is an indication that some error occurred during the authorization
check. It is entirely possible to get an error and be able to continue
determine authorization status in spite of it. For instance, RBAC can
be missing a role, but enough roles are still present and bound to reason
about the request.
type: str
reason:
description:
- Reason is optional. It indicates why a request was allowed or denied.
type: str
'''
def main():
try:
module = KubernetesAnsibleModule('self_subject_access_review', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_stateful_set
@@ -345,7 +345,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -2116,80 +2116,6 @@ stateful_set:
if the port is other than default (typically TCP ports
860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should populate
this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this setting.
This might be in conflict with other options that affect
the file mode, like fsGroup, and the result can be other
mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API
version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must be
a value between 0 and 0777. If not specified, the
volume defaultMode will be used. This might be in
conflict with other options that affect the file mode,
like fsGroup, and the result can be other mode bits
set.'
type: int
name:
description:
- "Required: Name is the relative path name of the file\
\ to be created. Must not be absolute or contain the\
\ '..' path. Must be utf-8 encoded. The first item\
\ of the relative path must not start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the pod.
@@ -2688,17 +2614,16 @@ stateful_set:
def main():
try:
module = OpenShiftAnsibleModule('stateful_set', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('stateful_set', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_stateful_set_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -1915,82 +1915,6 @@ stateful_set_list:
ip_addr:port if the port is other than default (typically
TCP ports 860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should
populate this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this
setting. This might be in conflict with other options
that affect the file mode, like fsGroup, and the result
can be other mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified
API version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must
be a value between 0 and 0777. If not specified,
the volume defaultMode will be used. This might
be in conflict with other options that affect
the file mode, like fsGroup, and the result can
be other mode bits set.'
type: int
name:
description:
- "Required: Name is the relative path name of the\
\ file to be created. Must not be absolute or\
\ contain the '..' path. Must be utf-8 encoded.\
\ The first item of the relative path must not\
\ start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory,
requests.cpu and requests.memory) are currently
supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed
resources, defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the
@@ -2527,17 +2451,16 @@ stateful_set_list:
def main():
try:
module = OpenShiftAnsibleModule('stateful_set_list', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('stateful_set_list', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_storage_class
@@ -115,7 +115,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -308,17 +308,16 @@ storage_class:
def main():
try:
module = OpenShiftAnsibleModule('storage_class', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('storage_class', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_storage_class_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -322,17 +322,16 @@ storage_class_list:
def main():
try:
module = OpenShiftAnsibleModule('storage_class_list', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('storage_class_list', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,447 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_subject_access_review
short_description: Kubernetes SubjectAccessReview
description:
- Manage the lifecycle of a subject_access_review object. Supports check mode, and
attempts to to be idempotent.
version_added: 2.3.0
author: OpenShift (@openshift)
options:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource that may
be set by external tools to store and retrieve arbitrary metadata. They are
not queryable and should be preserved when modifying objects.
type: dict
api_key:
description:
- Token used to connect to the API.
cert_file:
description:
- Path to a certificate used to authenticate with the API.
type: path
context:
description:
- The name of a context found in the Kubernetes config file.
debug:
description:
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
default: false
type: bool
force:
description:
- If set to C(True), and I(state) is C(present), an existing object will updated,
and lists will be replaced, rather than merged.
default: false
type: bool
host:
description:
- Provide a URL for acessing the Kubernetes API.
key_file:
description:
- Path to a key file used to authenticate with the API.
type: path
kubeconfig:
description:
- Path to an existing Kubernetes config file. If not provided, and no other connection
options are provided, the openshift client will attempt to load the default
configuration file from I(~/.kube/config.json).
type: path
labels:
description:
- Map of string keys and values that can be used to organize and categorize (scope
and select) objects. May match selectors of replication controllers and services.
type: dict
name:
description:
- Name must be unique within a namespace. Is required when creating resources,
although some resources may allow a client to request the generation of an appropriate
name automatically. Name is primarily intended for creation idempotence and
configuration definition. Cannot be updated.
namespace:
description:
- Namespace defines the space within each name must be unique. An empty namespace
is equivalent to the "default" namespace, but "default" is the canonical representation.
Not all objects are required to be scoped to a namespace - the value of this
field for those objects will be empty. Must be a DNS_LABEL. Cannot be updated.
password:
description:
- Provide a password for connecting to the API. Use in conjunction with I(username).
spec_extra:
description:
- Extra corresponds to the user.Info.GetExtra() method from the authenticator.
Since that is input to the authorizer it needs a reflection here.
aliases:
- extra
type: dict
spec_group:
description:
- Groups is the groups you're testing for.
aliases:
- group
type: list
spec_non_resource_attributes_path:
description:
- Path is the URL path of the request
aliases:
- non_resource_attributes_path
spec_non_resource_attributes_verb:
description:
- Verb is the standard HTTP verb
aliases:
- non_resource_attributes_verb
spec_resource_attributes_group:
description:
- Group is the API Group of the Resource. "*" means all.
aliases:
- resource_attributes_group
spec_resource_attributes_name:
description:
- Name is the name of the resource being requested for a "get" or deleted for
a "delete". "" (empty) means all.
aliases:
- resource_attributes_name
spec_resource_attributes_namespace:
description:
- Namespace is the namespace of the action being requested. Currently, there is
no distinction between no namespace and all namespaces "" (empty) is defaulted
for LocalSubjectAccessReviews "" (empty) is empty for cluster-scoped resources
"" (empty) means "all" for namespace scoped resources from a SubjectAccessReview
or SelfSubjectAccessReview
aliases:
- resource_attributes_namespace
spec_resource_attributes_resource:
description:
- Resource is one of the existing resource types. "*" means all.
aliases:
- resource_attributes_resource
spec_resource_attributes_subresource:
description:
- Subresource is one of the existing resource types. "" means none.
aliases:
- resource_attributes_subresource
spec_resource_attributes_verb:
description:
- 'Verb is a kubernetes resource API verb, like: get, list, watch, create, update,
delete, proxy. "*" means all.'
aliases:
- resource_attributes_verb
spec_resource_attributes_version:
description:
- Version is the API Version of the Resource. "*" means all.
aliases:
- resource_attributes_version
spec_user:
description:
- User is the user you're testing for. If you specify "User" but not "Group",
then is it interpreted as "What if User were not a member of any groups
aliases:
- user
ssl_ca_cert:
description:
- Path to a CA certificate used to authenticate with the API.
type: path
username:
description:
- Provide a username for connecting to the API.
verify_ssl:
description:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- kubernetes == 1.0.0
'''
EXAMPLES = '''
'''
RETURN = '''
api_version:
type: string
description: Requested API version
subject_access_review:
type: complex
returned: on success
contains:
api_version:
description:
- APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
type: str
kind:
description:
- Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to. Cannot
be updated. In CamelCase.
type: str
metadata:
description: []
type: complex
contains:
annotations:
description:
- Annotations is an unstructured key value map stored with a resource that
may be set by external tools to store and retrieve arbitrary metadata.
They are not queryable and should be preserved when modifying objects.
type: complex
contains: str, str
cluster_name:
description:
- The name of the cluster which the object belongs to. This is used to distinguish
resources with same name and namespace in different clusters. This field
is not set anywhere right now and apiserver is going to ignore it if set
in create or update request.
type: str
creation_timestamp:
description:
- CreationTimestamp is a timestamp representing the server time when this
object was created. It is not guaranteed to be set in happens-before order
across separate operations. Clients may not set this value. It is represented
in RFC3339 form and is in UTC. Populated by the system. Read-only. Null
for lists.
type: complex
contains: {}
deletion_grace_period_seconds:
description:
- Number of seconds allowed for this object to gracefully terminate before
it will be removed from the system. Only set when deletionTimestamp is
also set. May only be shortened. Read-only.
type: int
deletion_timestamp:
description:
- DeletionTimestamp is RFC 3339 date and time at which this resource will
be deleted. This field is set by the server when a graceful deletion is
requested by the user, and is not directly settable by a client. The resource
is expected to be deleted (no longer visible from resource lists, and
not reachable by name) after the time in this field. Once set, this value
may not be unset or be set further into the future, although it may be
shortened or the resource may be deleted prior to this time. For example,
a user may request that a pod is deleted in 30 seconds. The Kubelet will
react by sending a graceful termination signal to the containers in the
pod. After that 30 seconds, the Kubelet will send a hard termination signal
(SIGKILL) to the container and after cleanup, remove the pod from the
API. In the presence of network partitions, this object may still exist
after this timestamp, until an administrator or automated process can
determine the resource is fully terminated. If not set, graceful deletion
of the object has not been requested. Populated by the system when a graceful
deletion is requested. Read-only.
type: complex
contains: {}
finalizers:
description:
- Must be empty before the object is deleted from the registry. Each entry
is an identifier for the responsible component that will remove the entry
from the list. If the deletionTimestamp of the object is non-nil, entries
in this list can only be removed.
type: list
contains: str
generate_name:
description:
- GenerateName is an optional prefix, used by the server, to generate a
unique name ONLY IF the Name field has not been provided. If this field
is used, the name returned to the client will be different than the name
passed. This value will also be combined with a unique suffix. The provided
value has the same validation rules as the Name field, and may be truncated
by the length of the suffix required to make the value unique on the server.
If this field is specified and the generated name exists, the server will
NOT return a 409 - instead, it will either return 201 Created or 500 with
Reason ServerTimeout indicating a unique name could not be found in the
time allotted, and the client should retry (optionally after the time
indicated in the Retry-After header). Applied only if Name is not specified.
type: str
generation:
description:
- A sequence number representing a specific generation of the desired state.
Populated by the system. Read-only.
type: int
labels:
description:
- Map of string keys and values that can be used to organize and categorize
(scope and select) objects. May match selectors of replication controllers
and services.
type: complex
contains: str, str
name:
description:
- Name must be unique within a namespace. Is required when creating resources,
although some resources may allow a client to request the generation of
an appropriate name automatically. Name is primarily intended for creation
idempotence and configuration definition. Cannot be updated.
type: str
namespace:
description:
- Namespace defines the space within each name must be unique. An empty
namespace is equivalent to the "default" namespace, but "default" is the
canonical representation. Not all objects are required to be scoped to
a namespace - the value of this field for those objects will be empty.
Must be a DNS_LABEL. Cannot be updated.
type: str
owner_references:
description:
- List of objects depended by this object. If ALL objects in the list have
been deleted, this object will be garbage collected. If this object is
managed by a controller, then an entry in this list will point to this
controller, with the controller field set to true. There cannot be more
than one managing controller.
type: list
contains:
api_version:
description:
- API version of the referent.
type: str
controller:
description:
- If true, this reference points to the managing controller.
type: bool
kind:
description:
- Kind of the referent.
type: str
name:
description:
- Name of the referent.
type: str
uid:
description:
- UID of the referent.
type: str
resource_version:
description:
- An opaque value that represents the internal version of this object that
can be used by clients to determine when objects have changed. May be
used for optimistic concurrency, change detection, and the watch operation
on a resource or set of resources. Clients must treat these values as
opaque and passed unmodified back to the server. They may only be valid
for a particular resource or set of resources. Populated by the system.
Read-only. Value must be treated as opaque by clients and .
type: str
self_link:
description:
- SelfLink is a URL representing this object. Populated by the system. Read-only.
type: str
uid:
description:
- UID is the unique in time and space value for this object. It is typically
generated by the server on successful creation of a resource and is not
allowed to change on PUT operations. Populated by the system. Read-only.
type: str
spec:
description:
- Spec holds information about the request being evaluated
type: complex
contains:
extra:
description:
- Extra corresponds to the user.Info.GetExtra() method from the authenticator.
Since that is input to the authorizer it needs a reflection here.
type: complex
contains: str, list[str]
group:
description:
- Groups is the groups you're testing for.
type: list
contains: str
non_resource_attributes:
description:
- NonResourceAttributes describes information for a non-resource access
request
type: complex
contains:
path:
description:
- Path is the URL path of the request
type: str
verb:
description:
- Verb is the standard HTTP verb
type: str
resource_attributes:
description:
- ResourceAuthorizationAttributes describes information for a resource access
request
type: complex
contains:
group:
description:
- Group is the API Group of the Resource. "*" means all.
type: str
name:
description:
- Name is the name of the resource being requested for a "get" or deleted
for a "delete". "" (empty) means all.
type: str
namespace:
description:
- Namespace is the namespace of the action being requested. Currently,
there is no distinction between no namespace and all namespaces ""
(empty) is defaulted for LocalSubjectAccessReviews "" (empty) is empty
for cluster-scoped resources "" (empty) means "all" for namespace
scoped resources from a SubjectAccessReview or SelfSubjectAccessReview
type: str
resource:
description:
- Resource is one of the existing resource types. "*" means all.
type: str
subresource:
description:
- Subresource is one of the existing resource types. "" means none.
type: str
verb:
description:
- 'Verb is a kubernetes resource API verb, like: get, list, watch, create,
update, delete, proxy. "*" means all.'
type: str
version:
description:
- Version is the API Version of the Resource. "*" means all.
type: str
user:
description:
- User is the user you're testing for. If you specify "User" but not "Group",
then is it interpreted as "What if User were not a member of any groups
type: str
status:
description:
- Status is filled in by the server and indicates whether the request is allowed
or not
type: complex
contains:
allowed:
description:
- Allowed is required. True if the action would be allowed, false otherwise.
type: bool
evaluation_error:
description:
- EvaluationError is an indication that some error occurred during the authorization
check. It is entirely possible to get an error and be able to continue
determine authorization status in spite of it. For instance, RBAC can
be missing a role, but enough roles are still present and bound to reason
about the request.
type: str
reason:
description:
- Reason is optional. It indicates why a request was allowed or denied.
type: str
'''
def main():
try:
module = KubernetesAnsibleModule('subject_access_review', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_third_party_resource
@@ -114,7 +114,7 @@ options:
- Versions are versions for this third party object
type: list
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -310,17 +310,16 @@ third_party_resource:
def main():
try:
module = OpenShiftAnsibleModule('third_party_resource', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('third_party_resource', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_third_party_resource_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -325,17 +325,16 @@ third_party_resource_list:
def main():
try:
module = OpenShiftAnsibleModule('third_party_resource_list', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('third_party_resource_list', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1beta1_token_review
@@ -88,7 +88,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -318,17 +318,16 @@ token_review:
def main():
try:
module = OpenShiftAnsibleModule('token_review', 'V1beta1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('token_review', 'V1beta1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v2alpha1_cron_job
@@ -418,7 +418,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -2466,84 +2466,6 @@ cron_job:
or ip_addr:port if the port is other than default
(typically TCP ports 860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should
populate this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by
default. Must be a value between 0 and 0777. Defaults
to 0644. Directories within the path are not affected
by this setting. This might be in conflict with
other options that affect the file mode, like
fsGroup, and the result can be other mode bits
set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only
annotations, labels, name and namespace are
supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is
written in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified
API version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file,
must be a value between 0 and 0777. If not
specified, the volume defaultMode will be
used. This might be in conflict with other
options that affect the file mode, like fsGroup,
and the result can be other mode bits set.'
type: int
name:
description:
- "Required: Name is the relative path name\
\ of the file to be created. Must not be absolute\
\ or contain the '..' path. Must be utf-8\
\ encoded. The first item of the relative\
\ path must not start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only
resources limits and requests (limits.cpu,
limits.memory, requests.cpu and requests.memory)
are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes,
optional for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed
resources, defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within
@@ -2833,17 +2755,16 @@ cron_job:
def main():
try:
module = OpenShiftAnsibleModule('cron_job', 'V2alpha1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('cron_job', 'V2alpha1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v2alpha1_cron_job_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -2232,88 +2232,6 @@ cron_job_list:
than default (typically TCP ports 860 and
3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that
should populate this volume Deprecated: Use downwardAPI
instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files
by default. Must be a value between 0 and
0777. Defaults to 0644. Directories within
the path are not affected by this setting.
This might be in conflict with other options
that affect the file mode, like fsGroup, and
the result can be other mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod:
only annotations, labels, name and namespace
are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath
is written in terms of, defaults to
"v1".
type: str
field_path:
description:
- Path of the field to select in the
specified API version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file,
must be a value between 0 and 0777. If
not specified, the volume defaultMode
will be used. This might be in conflict
with other options that affect the file
mode, like fsGroup, and the result can
be other mode bits set.'
type: int
name:
description:
- "Required: Name is the relative path name\
\ of the file to be created. Must not\
\ be absolute or contain the '..' path.\
\ Must be utf-8 encoded. The first item\
\ of the relative path must not start\
\ with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container:
only resources limits and requests (limits.cpu,
limits.memory, requests.cpu and requests.memory)
are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes,
optional for env vars'
type: str
divisor:
description:
- Specifies the output format of the
exposed resources, defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique
@@ -2632,17 +2550,16 @@ cron_job_list:
def main():
try:
module = OpenShiftAnsibleModule('cron_job_list', 'V2alpha1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('cron_job_list', 'V2alpha1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v2alpha1_job
@@ -355,7 +355,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -2142,80 +2142,6 @@ job:
if the port is other than default (typically TCP ports
860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should populate
this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this setting.
This might be in conflict with other options that affect
the file mode, like fsGroup, and the result can be other
mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API
version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must be
a value between 0 and 0777. If not specified, the
volume defaultMode will be used. This might be in
conflict with other options that affect the file mode,
like fsGroup, and the result can be other mode bits
set.'
type: int
name:
description:
- "Required: Name is the relative path name of the file\
\ to be created. Must not be absolute or contain the\
\ '..' path. Must be utf-8 encoded. The first item\
\ of the relative path must not start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the pod.
@@ -2486,17 +2412,16 @@ job:
def main():
try:
module = OpenShiftAnsibleModule('job', 'V2alpha1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('job', 'V2alpha1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v2alpha1_job_list
@@ -89,7 +89,7 @@ options:
- Whether or not to verify the API server's SSL certificates.
type: bool
requirements:
- openshift == 1.0.0-snapshot
- kubernetes == 1.0.0
'''
EXAMPLES = '''
@@ -1934,82 +1934,6 @@ job_list:
ip_addr:port if the port is other than default (typically
TCP ports 860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should
populate this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this
setting. This might be in conflict with other options
that affect the file mode, like fsGroup, and the result
can be other mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified
API version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must
be a value between 0 and 0777. If not specified,
the volume defaultMode will be used. This might
be in conflict with other options that affect
the file mode, like fsGroup, and the result can
be other mode bits set.'
type: int
name:
description:
- "Required: Name is the relative path name of the\
\ file to be created. Must not be absolute or\
\ contain the '..' path. Must be utf-8 encoded.\
\ The first item of the relative path must not\
\ start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory,
requests.cpu and requests.memory) are currently
supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed
resources, defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the
@@ -2308,17 +2232,16 @@ job_list:
def main():
try:
module = OpenShiftAnsibleModule('job_list', 'V2alpha1')
except OpenShiftAnsibleException as exc:
module = KubernetesAnsibleModule('job_list', 'V2alpha1')
except KubernetesAnsibleException as exc:
# The helper failed to init, so there is no module object. All we can do is raise the error.
raise Exception(exc.message)
try:
module.execute_module()
except OpenShiftAnsibleException as exc:
except KubernetesAnsibleException as exc:
module.fail_json(msg="Module failed!", error=str(exc))
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_applied_cluster_resource_quota
short_description: Kubernetes AppliedClusterResourceQuota
module: openshift_v1_applied_cluster_resource_quota
short_description: OpenShift AppliedClusterResourceQuota
description:
- Manage the lifecycle of a applied_cluster_resource_quota object. Supports check
mode, and attempts to to be idempotent.
@@ -433,4 +433,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_applied_cluster_resource_quota_list
short_description: Kubernetes AppliedClusterResourceQuotaList
module: openshift_v1_applied_cluster_resource_quota_list
short_description: OpenShift AppliedClusterResourceQuotaList
description:
- Retrieve a list of applied_cluster_resource_quotas. List operations provide a snapshot
read of the underlying objects, returning a resource_version representing a consistent
@@ -423,4 +423,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_build
short_description: Kubernetes Build
module: openshift_v1_build
short_description: OpenShift Build
description:
- Manage the lifecycle of a build object. Supports check mode, and attempts to to
be idempotent.
@@ -358,7 +358,7 @@ options:
spec_strategy_custom_strategy_env:
description:
- env contains additional environment variables you want to pass into a builder
container
container. ValueFrom is not supported.
aliases:
- strategy_custom_strategy_env
type: list
@@ -428,6 +428,13 @@ options:
- UID of the referent.
aliases:
- strategy_docker_strategy__from_uid
spec_strategy_docker_strategy_build_args:
description:
- buildArgs contains build arguments that will be resolved in the Dockerfile.
See
aliases:
- strategy_docker_strategy_build_args
type: list
spec_strategy_docker_strategy_dockerfile_path:
description:
- dockerfilePath is the path of the Dockerfile that will be used to build the
@@ -437,7 +444,7 @@ options:
spec_strategy_docker_strategy_env:
description:
- env contains additional environment variables you want to pass into a builder
container
container. ValueFrom is not supported.
aliases:
- strategy_docker_strategy_env
type: list
@@ -448,6 +455,18 @@ options:
aliases:
- strategy_docker_strategy_force_pull
type: bool
spec_strategy_docker_strategy_image_optimization_policy:
description:
- imageOptimizationPolicy describes what optimizations the system can use when
building images to reduce the final size or time spent building the image. The
default policy is 'None' which means the final build image will be equivalent
to an image created by the Docker build API. The experimental policy 'SkipLayers'
will avoid commiting new layers in between each image step, and will fail if
the Dockerfile cannot provide compatibility with the 'None' policy. An additional
experimental policy 'SkipLayersAndWarn' is the same as 'SkipLayers' but simply
warns if compatibility cannot be preserved.
aliases:
- strategy_docker_strategy_image_optimization_policy
spec_strategy_docker_strategy_no_cache:
description:
- noCache if set to true indicates that the docker build must be executed with
@@ -460,6 +479,13 @@ options:
- Name of the referent.
aliases:
- strategy_docker_strategy_pull_secret_name
spec_strategy_jenkins_pipeline_strategy_env:
description:
- env contains additional environment variables you want to pass into a build
pipeline. ValueFrom is not supported.
aliases:
- strategy_jenkins_pipeline_strategy_env
type: list
spec_strategy_jenkins_pipeline_strategy_jenkinsfile:
description:
- Jenkinsfile defines the optional raw contents of a Jenkinsfile which defines
@@ -518,7 +544,7 @@ options:
spec_strategy_source_strategy_env:
description:
- env contains additional environment variables you want to pass into a builder
container
container. ValueFrom is not supported.
aliases:
- strategy_source_strategy_env
type: list
@@ -542,11 +568,12 @@ options:
- strategy_source_strategy_pull_secret_name
spec_strategy_source_strategy_runtime_artifacts:
description:
- runtimeArtifacts specifies a list of source/destination pairs that will be copied
from the builder to the runtime image. sourcePath can be a file or directory.
- 'runtimeArtifacts specifies a list of source/destination pairs that will be
copied from the builder to the runtime image. sourcePath can be a file or directory.
destinationDir must be a directory. destinationDir can also be empty or equal
to ".", in this case it just refers to the root of WORKDIR. This field and the
feature it enables are in tech preview.
to ".", in this case it just refers to the root of WORKDIR. Deprecated: This
feature will be removed in a future release. Use ImageSource to copy binary
artifacts created from one build into a separate runtime image.'
aliases:
- strategy_source_strategy_runtime_artifacts
type: list
@@ -1272,7 +1299,7 @@ build:
env:
description:
- env contains additional environment variables you want to pass
into a builder container
into a builder container. ValueFrom is not supported.
type: list
contains:
name:
@@ -1451,6 +1478,97 @@ build:
description:
- UID of the referent.
type: str
build_args:
description:
- buildArgs contains build arguments that will be resolved in the
Dockerfile. See
type: list
contains:
name:
description:
- Name of the environment variable. Must be a C_IDENTIFIER.
type: str
value:
description:
- 'Variable references $(VAR_NAME) are expanded using the previous
defined environment variables in the container and any service
environment variables. If a variable cannot be resolved, the
reference in the input string will be unchanged. The $(VAR_NAME)
syntax can be escaped with a double $$, ie: $$(VAR_NAME).
Escaped references will never be expanded, regardless of whether
the variable exists or not. Defaults to "".'
type: str
value_from:
description:
- Source for the environment variable's value. Cannot be used
if value is not empty.
type: complex
contains:
config_map_key_ref:
description:
- Selects a key of a ConfigMap.
type: complex
contains:
key:
description:
- The key to select.
type: str
name:
description:
- Name of the referent.
type: str
field_ref:
description:
- 'Selects a field of the pod: supports metadata.name, metadata.namespace,
metadata.labels, metadata.annotations, spec.nodeName,
spec.serviceAccountName, status.podIP.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written in
terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API version.
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources limits
and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional for
env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
secret_key_ref:
description:
- Selects a key of a secret in the pod's namespace
type: complex
contains:
key:
description:
- The key of the secret to select from. Must be a valid
secret key.
type: str
name:
description:
- Name of the referent.
type: str
dockerfile_path:
description:
- dockerfilePath is the path of the Dockerfile that will be used
@@ -1460,7 +1578,7 @@ build:
env:
description:
- env contains additional environment variables you want to pass
into a builder container
into a builder container. ValueFrom is not supported.
type: list
contains:
name:
@@ -1553,6 +1671,19 @@ build:
- forcePull describes if the builder should pull the images from
registry prior to building.
type: bool
image_optimization_policy:
description:
- imageOptimizationPolicy describes what optimizations the system
can use when building images to reduce the final size or time
spent building the image. The default policy is 'None' which means
the final build image will be equivalent to an image created by
the Docker build API. The experimental policy 'SkipLayers' will
avoid commiting new layers in between each image step, and will
fail if the Dockerfile cannot provide compatibility with the 'None'
policy. An additional experimental policy 'SkipLayersAndWarn'
is the same as 'SkipLayers' but simply warns if compatibility
cannot be preserved.
type: str
no_cache:
description:
- noCache if set to true indicates that the docker build must be
@@ -1575,6 +1706,97 @@ build:
build strategy. This strategy is in tech preview.
type: complex
contains:
env:
description:
- env contains additional environment variables you want to pass
into a build pipeline. ValueFrom is not supported.
type: list
contains:
name:
description:
- Name of the environment variable. Must be a C_IDENTIFIER.
type: str
value:
description:
- 'Variable references $(VAR_NAME) are expanded using the previous
defined environment variables in the container and any service
environment variables. If a variable cannot be resolved, the
reference in the input string will be unchanged. The $(VAR_NAME)
syntax can be escaped with a double $$, ie: $$(VAR_NAME).
Escaped references will never be expanded, regardless of whether
the variable exists or not. Defaults to "".'
type: str
value_from:
description:
- Source for the environment variable's value. Cannot be used
if value is not empty.
type: complex
contains:
config_map_key_ref:
description:
- Selects a key of a ConfigMap.
type: complex
contains:
key:
description:
- The key to select.
type: str
name:
description:
- Name of the referent.
type: str
field_ref:
description:
- 'Selects a field of the pod: supports metadata.name, metadata.namespace,
metadata.labels, metadata.annotations, spec.nodeName,
spec.serviceAccountName, status.podIP.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written in
terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API version.
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources limits
and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional for
env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
secret_key_ref:
description:
- Selects a key of a secret in the pod's namespace
type: complex
contains:
key:
description:
- The key of the secret to select from. Must be a valid
secret key.
type: str
name:
description:
- Name of the referent.
type: str
jenkinsfile:
description:
- Jenkinsfile defines the optional raw contents of a Jenkinsfile
@@ -1640,7 +1862,7 @@ build:
env:
description:
- env contains additional environment variables you want to pass
into a builder container
into a builder container. ValueFrom is not supported.
type: list
contains:
name:
@@ -1751,12 +1973,13 @@ build:
type: str
runtime_artifacts:
description:
- runtimeArtifacts specifies a list of source/destination pairs
- 'runtimeArtifacts specifies a list of source/destination pairs
that will be copied from the builder to the runtime image. sourcePath
can be a file or directory. destinationDir must be a directory.
destinationDir can also be empty or equal to ".", in this case
it just refers to the root of WORKDIR. This field and the feature
it enables are in tech preview.
it just refers to the root of WORKDIR. Deprecated: This feature
will be removed in a future release. Use ImageSource to copy binary
artifacts created from one build into a separate runtime image.'
type: list
contains:
destination_dir:
@@ -1771,11 +1994,13 @@ build:
type: str
runtime_image:
description:
- runtimeImage is an optional image that is used to run an application
- 'runtimeImage is an optional image that is used to run an application
without unneeded dependencies installed. The building of the application
is still done in the builder image but, post build, you can copy
the needed artifacts in the runtime image for use. This field
and the feature it enables are in tech preview.
the needed artifacts in the runtime image for use. Deprecated:
This feature will be removed in a future release. Use ImageSource
to copy binary artifacts created from one build into a separate
runtime image.'
type: complex
contains:
api_version:
@@ -2134,4 +2359,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_build_config
short_description: Kubernetes BuildConfig
module: openshift_v1_build_config
short_description: OpenShift BuildConfig
description:
- Manage the lifecycle of a build_config object. Supports check mode, and attempts
to to be idempotent.
@@ -365,7 +365,7 @@ options:
spec_strategy_custom_strategy_env:
description:
- env contains additional environment variables you want to pass into a builder
container
container. ValueFrom is not supported.
aliases:
- strategy_custom_strategy_env
type: list
@@ -435,6 +435,13 @@ options:
- UID of the referent.
aliases:
- strategy_docker_strategy__from_uid
spec_strategy_docker_strategy_build_args:
description:
- buildArgs contains build arguments that will be resolved in the Dockerfile.
See
aliases:
- strategy_docker_strategy_build_args
type: list
spec_strategy_docker_strategy_dockerfile_path:
description:
- dockerfilePath is the path of the Dockerfile that will be used to build the
@@ -444,7 +451,7 @@ options:
spec_strategy_docker_strategy_env:
description:
- env contains additional environment variables you want to pass into a builder
container
container. ValueFrom is not supported.
aliases:
- strategy_docker_strategy_env
type: list
@@ -455,6 +462,18 @@ options:
aliases:
- strategy_docker_strategy_force_pull
type: bool
spec_strategy_docker_strategy_image_optimization_policy:
description:
- imageOptimizationPolicy describes what optimizations the system can use when
building images to reduce the final size or time spent building the image. The
default policy is 'None' which means the final build image will be equivalent
to an image created by the Docker build API. The experimental policy 'SkipLayers'
will avoid commiting new layers in between each image step, and will fail if
the Dockerfile cannot provide compatibility with the 'None' policy. An additional
experimental policy 'SkipLayersAndWarn' is the same as 'SkipLayers' but simply
warns if compatibility cannot be preserved.
aliases:
- strategy_docker_strategy_image_optimization_policy
spec_strategy_docker_strategy_no_cache:
description:
- noCache if set to true indicates that the docker build must be executed with
@@ -467,6 +486,13 @@ options:
- Name of the referent.
aliases:
- strategy_docker_strategy_pull_secret_name
spec_strategy_jenkins_pipeline_strategy_env:
description:
- env contains additional environment variables you want to pass into a build
pipeline. ValueFrom is not supported.
aliases:
- strategy_jenkins_pipeline_strategy_env
type: list
spec_strategy_jenkins_pipeline_strategy_jenkinsfile:
description:
- Jenkinsfile defines the optional raw contents of a Jenkinsfile which defines
@@ -525,7 +551,7 @@ options:
spec_strategy_source_strategy_env:
description:
- env contains additional environment variables you want to pass into a builder
container
container. ValueFrom is not supported.
aliases:
- strategy_source_strategy_env
type: list
@@ -549,11 +575,12 @@ options:
- strategy_source_strategy_pull_secret_name
spec_strategy_source_strategy_runtime_artifacts:
description:
- runtimeArtifacts specifies a list of source/destination pairs that will be copied
from the builder to the runtime image. sourcePath can be a file or directory.
- 'runtimeArtifacts specifies a list of source/destination pairs that will be
copied from the builder to the runtime image. sourcePath can be a file or directory.
destinationDir must be a directory. destinationDir can also be empty or equal
to ".", in this case it just refers to the root of WORKDIR. This field and the
feature it enables are in tech preview.
to ".", in this case it just refers to the root of WORKDIR. Deprecated: This
feature will be removed in a future release. Use ImageSource to copy binary
artifacts created from one build into a separate runtime image.'
aliases:
- strategy_source_strategy_runtime_artifacts
type: list
@@ -1287,7 +1314,7 @@ build_config:
env:
description:
- env contains additional environment variables you want to pass
into a builder container
into a builder container. ValueFrom is not supported.
type: list
contains:
name:
@@ -1466,6 +1493,97 @@ build_config:
description:
- UID of the referent.
type: str
build_args:
description:
- buildArgs contains build arguments that will be resolved in the
Dockerfile. See
type: list
contains:
name:
description:
- Name of the environment variable. Must be a C_IDENTIFIER.
type: str
value:
description:
- 'Variable references $(VAR_NAME) are expanded using the previous
defined environment variables in the container and any service
environment variables. If a variable cannot be resolved, the
reference in the input string will be unchanged. The $(VAR_NAME)
syntax can be escaped with a double $$, ie: $$(VAR_NAME).
Escaped references will never be expanded, regardless of whether
the variable exists or not. Defaults to "".'
type: str
value_from:
description:
- Source for the environment variable's value. Cannot be used
if value is not empty.
type: complex
contains:
config_map_key_ref:
description:
- Selects a key of a ConfigMap.
type: complex
contains:
key:
description:
- The key to select.
type: str
name:
description:
- Name of the referent.
type: str
field_ref:
description:
- 'Selects a field of the pod: supports metadata.name, metadata.namespace,
metadata.labels, metadata.annotations, spec.nodeName,
spec.serviceAccountName, status.podIP.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written in
terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API version.
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources limits
and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional for
env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
secret_key_ref:
description:
- Selects a key of a secret in the pod's namespace
type: complex
contains:
key:
description:
- The key of the secret to select from. Must be a valid
secret key.
type: str
name:
description:
- Name of the referent.
type: str
dockerfile_path:
description:
- dockerfilePath is the path of the Dockerfile that will be used
@@ -1475,7 +1593,7 @@ build_config:
env:
description:
- env contains additional environment variables you want to pass
into a builder container
into a builder container. ValueFrom is not supported.
type: list
contains:
name:
@@ -1568,6 +1686,19 @@ build_config:
- forcePull describes if the builder should pull the images from
registry prior to building.
type: bool
image_optimization_policy:
description:
- imageOptimizationPolicy describes what optimizations the system
can use when building images to reduce the final size or time
spent building the image. The default policy is 'None' which means
the final build image will be equivalent to an image created by
the Docker build API. The experimental policy 'SkipLayers' will
avoid commiting new layers in between each image step, and will
fail if the Dockerfile cannot provide compatibility with the 'None'
policy. An additional experimental policy 'SkipLayersAndWarn'
is the same as 'SkipLayers' but simply warns if compatibility
cannot be preserved.
type: str
no_cache:
description:
- noCache if set to true indicates that the docker build must be
@@ -1590,6 +1721,97 @@ build_config:
build strategy. This strategy is in tech preview.
type: complex
contains:
env:
description:
- env contains additional environment variables you want to pass
into a build pipeline. ValueFrom is not supported.
type: list
contains:
name:
description:
- Name of the environment variable. Must be a C_IDENTIFIER.
type: str
value:
description:
- 'Variable references $(VAR_NAME) are expanded using the previous
defined environment variables in the container and any service
environment variables. If a variable cannot be resolved, the
reference in the input string will be unchanged. The $(VAR_NAME)
syntax can be escaped with a double $$, ie: $$(VAR_NAME).
Escaped references will never be expanded, regardless of whether
the variable exists or not. Defaults to "".'
type: str
value_from:
description:
- Source for the environment variable's value. Cannot be used
if value is not empty.
type: complex
contains:
config_map_key_ref:
description:
- Selects a key of a ConfigMap.
type: complex
contains:
key:
description:
- The key to select.
type: str
name:
description:
- Name of the referent.
type: str
field_ref:
description:
- 'Selects a field of the pod: supports metadata.name, metadata.namespace,
metadata.labels, metadata.annotations, spec.nodeName,
spec.serviceAccountName, status.podIP.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written in
terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API version.
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources limits
and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional for
env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
secret_key_ref:
description:
- Selects a key of a secret in the pod's namespace
type: complex
contains:
key:
description:
- The key of the secret to select from. Must be a valid
secret key.
type: str
name:
description:
- Name of the referent.
type: str
jenkinsfile:
description:
- Jenkinsfile defines the optional raw contents of a Jenkinsfile
@@ -1655,7 +1877,7 @@ build_config:
env:
description:
- env contains additional environment variables you want to pass
into a builder container
into a builder container. ValueFrom is not supported.
type: list
contains:
name:
@@ -1766,12 +1988,13 @@ build_config:
type: str
runtime_artifacts:
description:
- runtimeArtifacts specifies a list of source/destination pairs
- 'runtimeArtifacts specifies a list of source/destination pairs
that will be copied from the builder to the runtime image. sourcePath
can be a file or directory. destinationDir must be a directory.
destinationDir can also be empty or equal to ".", in this case
it just refers to the root of WORKDIR. This field and the feature
it enables are in tech preview.
it just refers to the root of WORKDIR. Deprecated: This feature
will be removed in a future release. Use ImageSource to copy binary
artifacts created from one build into a separate runtime image.'
type: list
contains:
destination_dir:
@@ -1786,11 +2009,13 @@ build_config:
type: str
runtime_image:
description:
- runtimeImage is an optional image that is used to run an application
- 'runtimeImage is an optional image that is used to run an application
without unneeded dependencies installed. The building of the application
is still done in the builder image but, post build, you can copy
the needed artifacts in the runtime image for use. This field
and the feature it enables are in tech preview.
the needed artifacts in the runtime image for use. Deprecated:
This feature will be removed in a future release. Use ImageSource
to copy binary artifacts created from one build into a separate
runtime image.'
type: complex
contains:
api_version:
@@ -1961,4 +2186,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_build_config_list
short_description: Kubernetes BuildConfigList
module: openshift_v1_build_config_list
short_description: OpenShift BuildConfigList
description:
- Retrieve a list of build_configs. List operations provide a snapshot read of the
underlying objects, returning a resource_version representing a consistent version
@@ -758,7 +758,7 @@ build_config_list:
env:
description:
- env contains additional environment variables you want to
pass into a builder container
pass into a builder container. ValueFrom is not supported.
type: list
contains:
name:
@@ -940,6 +940,99 @@ build_config_list:
description:
- UID of the referent.
type: str
build_args:
description:
- buildArgs contains build arguments that will be resolved in
the Dockerfile. See
type: list
contains:
name:
description:
- Name of the environment variable. Must be a C_IDENTIFIER.
type: str
value:
description:
- 'Variable references $(VAR_NAME) are expanded using the
previous defined environment variables in the container
and any service environment variables. If a variable cannot
be resolved, the reference in the input string will be
unchanged. The $(VAR_NAME) syntax can be escaped with
a double $$, ie: $$(VAR_NAME). Escaped references will
never be expanded, regardless of whether the variable
exists or not. Defaults to "".'
type: str
value_from:
description:
- Source for the environment variable's value. Cannot be
used if value is not empty.
type: complex
contains:
config_map_key_ref:
description:
- Selects a key of a ConfigMap.
type: complex
contains:
key:
description:
- The key to select.
type: str
name:
description:
- Name of the referent.
type: str
field_ref:
description:
- 'Selects a field of the pod: supports metadata.name,
metadata.namespace, metadata.labels, metadata.annotations,
spec.nodeName, spec.serviceAccountName, status.podIP.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API
version.
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
secret_key_ref:
description:
- Selects a key of a secret in the pod's namespace
type: complex
contains:
key:
description:
- The key of the secret to select from. Must be
a valid secret key.
type: str
name:
description:
- Name of the referent.
type: str
dockerfile_path:
description:
- dockerfilePath is the path of the Dockerfile that will be
@@ -949,7 +1042,7 @@ build_config_list:
env:
description:
- env contains additional environment variables you want to
pass into a builder container
pass into a builder container. ValueFrom is not supported.
type: list
contains:
name:
@@ -1044,6 +1137,19 @@ build_config_list:
- forcePull describes if the builder should pull the images
from registry prior to building.
type: bool
image_optimization_policy:
description:
- imageOptimizationPolicy describes what optimizations the system
can use when building images to reduce the final size or time
spent building the image. The default policy is 'None' which
means the final build image will be equivalent to an image
created by the Docker build API. The experimental policy 'SkipLayers'
will avoid commiting new layers in between each image step,
and will fail if the Dockerfile cannot provide compatibility
with the 'None' policy. An additional experimental policy
'SkipLayersAndWarn' is the same as 'SkipLayers' but simply
warns if compatibility cannot be preserved.
type: str
no_cache:
description:
- noCache if set to true indicates that the docker build must
@@ -1066,6 +1172,99 @@ build_config_list:
build strategy. This strategy is in tech preview.
type: complex
contains:
env:
description:
- env contains additional environment variables you want to
pass into a build pipeline. ValueFrom is not supported.
type: list
contains:
name:
description:
- Name of the environment variable. Must be a C_IDENTIFIER.
type: str
value:
description:
- 'Variable references $(VAR_NAME) are expanded using the
previous defined environment variables in the container
and any service environment variables. If a variable cannot
be resolved, the reference in the input string will be
unchanged. The $(VAR_NAME) syntax can be escaped with
a double $$, ie: $$(VAR_NAME). Escaped references will
never be expanded, regardless of whether the variable
exists or not. Defaults to "".'
type: str
value_from:
description:
- Source for the environment variable's value. Cannot be
used if value is not empty.
type: complex
contains:
config_map_key_ref:
description:
- Selects a key of a ConfigMap.
type: complex
contains:
key:
description:
- The key to select.
type: str
name:
description:
- Name of the referent.
type: str
field_ref:
description:
- 'Selects a field of the pod: supports metadata.name,
metadata.namespace, metadata.labels, metadata.annotations,
spec.nodeName, spec.serviceAccountName, status.podIP.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API
version.
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
secret_key_ref:
description:
- Selects a key of a secret in the pod's namespace
type: complex
contains:
key:
description:
- The key of the secret to select from. Must be
a valid secret key.
type: str
name:
description:
- Name of the referent.
type: str
jenkinsfile:
description:
- Jenkinsfile defines the optional raw contents of a Jenkinsfile
@@ -1131,7 +1330,7 @@ build_config_list:
env:
description:
- env contains additional environment variables you want to
pass into a builder container
pass into a builder container. ValueFrom is not supported.
type: list
contains:
name:
@@ -1244,12 +1443,14 @@ build_config_list:
type: str
runtime_artifacts:
description:
- runtimeArtifacts specifies a list of source/destination pairs
- 'runtimeArtifacts specifies a list of source/destination pairs
that will be copied from the builder to the runtime image.
sourcePath can be a file or directory. destinationDir must
be a directory. destinationDir can also be empty or equal
to ".", in this case it just refers to the root of WORKDIR.
This field and the feature it enables are in tech preview.
Deprecated: This feature will be removed in a future release.
Use ImageSource to copy binary artifacts created from one
build into a separate runtime image.'
type: list
contains:
destination_dir:
@@ -1264,11 +1465,13 @@ build_config_list:
type: str
runtime_image:
description:
- runtimeImage is an optional image that is used to run an application
without unneeded dependencies installed. The building of the
application is still done in the builder image but, post build,
you can copy the needed artifacts in the runtime image for
use. This field and the feature it enables are in tech preview.
- 'runtimeImage is an optional image that is used to run an
application without unneeded dependencies installed. The building
of the application is still done in the builder image but,
post build, you can copy the needed artifacts in the runtime
image for use. Deprecated: This feature will be removed in
a future release. Use ImageSource to copy binary artifacts
created from one build into a separate runtime image.'
type: complex
contains:
api_version:
@@ -1463,4 +1666,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_build_list
short_description: Kubernetes BuildList
module: openshift_v1_build_list
short_description: OpenShift BuildList
description:
- Retrieve a list of builds. List operations provide a snapshot read of the underlying
objects, returning a resource_version representing a consistent version of the listed
@@ -751,7 +751,7 @@ build_list:
env:
description:
- env contains additional environment variables you want to
pass into a builder container
pass into a builder container. ValueFrom is not supported.
type: list
contains:
name:
@@ -933,6 +933,99 @@ build_list:
description:
- UID of the referent.
type: str
build_args:
description:
- buildArgs contains build arguments that will be resolved in
the Dockerfile. See
type: list
contains:
name:
description:
- Name of the environment variable. Must be a C_IDENTIFIER.
type: str
value:
description:
- 'Variable references $(VAR_NAME) are expanded using the
previous defined environment variables in the container
and any service environment variables. If a variable cannot
be resolved, the reference in the input string will be
unchanged. The $(VAR_NAME) syntax can be escaped with
a double $$, ie: $$(VAR_NAME). Escaped references will
never be expanded, regardless of whether the variable
exists or not. Defaults to "".'
type: str
value_from:
description:
- Source for the environment variable's value. Cannot be
used if value is not empty.
type: complex
contains:
config_map_key_ref:
description:
- Selects a key of a ConfigMap.
type: complex
contains:
key:
description:
- The key to select.
type: str
name:
description:
- Name of the referent.
type: str
field_ref:
description:
- 'Selects a field of the pod: supports metadata.name,
metadata.namespace, metadata.labels, metadata.annotations,
spec.nodeName, spec.serviceAccountName, status.podIP.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API
version.
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
secret_key_ref:
description:
- Selects a key of a secret in the pod's namespace
type: complex
contains:
key:
description:
- The key of the secret to select from. Must be
a valid secret key.
type: str
name:
description:
- Name of the referent.
type: str
dockerfile_path:
description:
- dockerfilePath is the path of the Dockerfile that will be
@@ -942,7 +1035,7 @@ build_list:
env:
description:
- env contains additional environment variables you want to
pass into a builder container
pass into a builder container. ValueFrom is not supported.
type: list
contains:
name:
@@ -1037,6 +1130,19 @@ build_list:
- forcePull describes if the builder should pull the images
from registry prior to building.
type: bool
image_optimization_policy:
description:
- imageOptimizationPolicy describes what optimizations the system
can use when building images to reduce the final size or time
spent building the image. The default policy is 'None' which
means the final build image will be equivalent to an image
created by the Docker build API. The experimental policy 'SkipLayers'
will avoid commiting new layers in between each image step,
and will fail if the Dockerfile cannot provide compatibility
with the 'None' policy. An additional experimental policy
'SkipLayersAndWarn' is the same as 'SkipLayers' but simply
warns if compatibility cannot be preserved.
type: str
no_cache:
description:
- noCache if set to true indicates that the docker build must
@@ -1059,6 +1165,99 @@ build_list:
build strategy. This strategy is in tech preview.
type: complex
contains:
env:
description:
- env contains additional environment variables you want to
pass into a build pipeline. ValueFrom is not supported.
type: list
contains:
name:
description:
- Name of the environment variable. Must be a C_IDENTIFIER.
type: str
value:
description:
- 'Variable references $(VAR_NAME) are expanded using the
previous defined environment variables in the container
and any service environment variables. If a variable cannot
be resolved, the reference in the input string will be
unchanged. The $(VAR_NAME) syntax can be escaped with
a double $$, ie: $$(VAR_NAME). Escaped references will
never be expanded, regardless of whether the variable
exists or not. Defaults to "".'
type: str
value_from:
description:
- Source for the environment variable's value. Cannot be
used if value is not empty.
type: complex
contains:
config_map_key_ref:
description:
- Selects a key of a ConfigMap.
type: complex
contains:
key:
description:
- The key to select.
type: str
name:
description:
- Name of the referent.
type: str
field_ref:
description:
- 'Selects a field of the pod: supports metadata.name,
metadata.namespace, metadata.labels, metadata.annotations,
spec.nodeName, spec.serviceAccountName, status.podIP.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API
version.
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
secret_key_ref:
description:
- Selects a key of a secret in the pod's namespace
type: complex
contains:
key:
description:
- The key of the secret to select from. Must be
a valid secret key.
type: str
name:
description:
- Name of the referent.
type: str
jenkinsfile:
description:
- Jenkinsfile defines the optional raw contents of a Jenkinsfile
@@ -1124,7 +1323,7 @@ build_list:
env:
description:
- env contains additional environment variables you want to
pass into a builder container
pass into a builder container. ValueFrom is not supported.
type: list
contains:
name:
@@ -1237,12 +1436,14 @@ build_list:
type: str
runtime_artifacts:
description:
- runtimeArtifacts specifies a list of source/destination pairs
- 'runtimeArtifacts specifies a list of source/destination pairs
that will be copied from the builder to the runtime image.
sourcePath can be a file or directory. destinationDir must
be a directory. destinationDir can also be empty or equal
to ".", in this case it just refers to the root of WORKDIR.
This field and the feature it enables are in tech preview.
Deprecated: This feature will be removed in a future release.
Use ImageSource to copy binary artifacts created from one
build into a separate runtime image.'
type: list
contains:
destination_dir:
@@ -1257,11 +1458,13 @@ build_list:
type: str
runtime_image:
description:
- runtimeImage is an optional image that is used to run an application
without unneeded dependencies installed. The building of the
application is still done in the builder image but, post build,
you can copy the needed artifacts in the runtime image for
use. This field and the feature it enables are in tech preview.
- 'runtimeImage is an optional image that is used to run an
application without unneeded dependencies installed. The building
of the application is still done in the builder image but,
post build, you can copy the needed artifacts in the runtime
image for use. Deprecated: This feature will be removed in
a future release. Use ImageSource to copy binary artifacts
created from one build into a separate runtime image.'
type: complex
contains:
api_version:
@@ -1644,4 +1847,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_build_request
short_description: Kubernetes BuildRequest
module: openshift_v1_build_request
short_description: OpenShift BuildRequest
description:
- Manage the lifecycle of a build_request object. Supports check mode, and attempts
to to be idempotent.
@@ -83,10 +83,16 @@ options:
- Enable debug output from the OpenShift helper. Logging info is written to KubeObjHelper.log
default: false
type: bool
docker_strategy_options_build_args:
description:
- Args contains any build arguments that are to be passed to Docker. See
aliases:
- build_args
type: list
env:
description:
- env contains additional environment variables you want to pass into a builder
container
container. ValueFrom is not supported.
type: list
force:
description:
@@ -302,10 +308,105 @@ build_request:
receives this binary as standard input. This filename may not contain
slashes or be '..' or '.'.
type: str
docker_strategy_options:
description:
- DockerStrategyOptions contains additional docker-strategy specific options
for the build
type: complex
contains:
build_args:
description:
- Args contains any build arguments that are to be passed to Docker. See
type: list
contains:
name:
description:
- Name of the environment variable. Must be a C_IDENTIFIER.
type: str
value:
description:
- 'Variable references $(VAR_NAME) are expanded using the previous defined
environment variables in the container and any service environment
variables. If a variable cannot be resolved, the reference in the
input string will be unchanged. The $(VAR_NAME) syntax can be escaped
with a double $$, ie: $$(VAR_NAME). Escaped references will never
be expanded, regardless of whether the variable exists or not. Defaults
to "".'
type: str
value_from:
description:
- Source for the environment variable's value. Cannot be used if value
is not empty.
type: complex
contains:
config_map_key_ref:
description:
- Selects a key of a ConfigMap.
type: complex
contains:
key:
description:
- The key to select.
type: str
name:
description:
- Name of the referent.
type: str
field_ref:
description:
- 'Selects a field of the pod: supports metadata.name, metadata.namespace,
metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName,
status.podIP.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written in terms of,
defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API version.
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources limits and
requests (limits.cpu, limits.memory, requests.cpu and requests.memory)
are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources, defaults
to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
secret_key_ref:
description:
- Selects a key of a secret in the pod's namespace
type: complex
contains:
key:
description:
- The key of the secret to select from. Must be a valid secret
key.
type: str
name:
description:
- Name of the referent.
type: str
env:
description:
- env contains additional environment variables you want to pass into a builder
container
container. ValueFrom is not supported.
type: list
contains:
name:
@@ -842,4 +943,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_cluster_network
short_description: Kubernetes ClusterNetwork
module: openshift_v1_cluster_network
short_description: OpenShift ClusterNetwork
description:
- Manage the lifecycle of a cluster_network object. Supports check mode, and attempts
to to be idempotent.
@@ -336,4 +336,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_cluster_network_list
short_description: Kubernetes ClusterNetworkList
module: openshift_v1_cluster_network_list
short_description: OpenShift ClusterNetworkList
description:
- Retrieve a list of cluster_networks. List operations provide a snapshot read of
the underlying objects, returning a resource_version representing a consistent version
@@ -344,4 +344,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_cluster_policy
short_description: Kubernetes ClusterPolicy
module: openshift_v1_cluster_policy
short_description: OpenShift ClusterPolicy
description:
- Manage the lifecycle of a cluster_policy object. Supports check mode, and attempts
to to be idempotent.
@@ -554,4 +554,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_cluster_policy_binding
short_description: Kubernetes ClusterPolicyBinding
module: openshift_v1_cluster_policy_binding
short_description: OpenShift ClusterPolicyBinding
description:
- Manage the lifecycle of a cluster_policy_binding object. Supports check mode, and
attempts to to be idempotent.
@@ -690,4 +690,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_cluster_policy_binding_list
short_description: Kubernetes ClusterPolicyBindingList
module: openshift_v1_cluster_policy_binding_list
short_description: OpenShift ClusterPolicyBindingList
description:
- Retrieve a list of cluster_policy_bindings. List operations provide a snapshot read
of the underlying objects, returning a resource_version representing a consistent
@@ -678,4 +678,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_cluster_policy_list
short_description: Kubernetes ClusterPolicyList
module: openshift_v1_cluster_policy_list
short_description: OpenShift ClusterPolicyList
description:
- Retrieve a list of cluster_policys. List operations provide a snapshot read of the
underlying objects, returning a resource_version representing a consistent version
@@ -581,4 +581,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_cluster_resource_quota
short_description: Kubernetes ClusterResourceQuota
module: openshift_v1_cluster_resource_quota
short_description: OpenShift ClusterResourceQuota
description:
- Manage the lifecycle of a cluster_resource_quota object. Supports check mode, and
attempts to to be idempotent.
@@ -457,4 +457,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_cluster_resource_quota_list
short_description: Kubernetes ClusterResourceQuotaList
module: openshift_v1_cluster_resource_quota_list
short_description: OpenShift ClusterResourceQuotaList
description:
- Retrieve a list of cluster_resource_quotas. List operations provide a snapshot read
of the underlying objects, returning a resource_version representing a consistent
@@ -447,4 +447,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_cluster_role
short_description: Kubernetes ClusterRole
module: openshift_v1_cluster_role
short_description: OpenShift ClusterRole
description:
- Manage the lifecycle of a cluster_role object. Supports check mode, and attempts
to to be idempotent.
@@ -358,4 +358,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_cluster_role_binding
short_description: Kubernetes ClusterRoleBinding
module: openshift_v1_cluster_role_binding
short_description: OpenShift ClusterRoleBinding
description:
- Manage the lifecycle of a cluster_role_binding object. Supports check mode, and
attempts to to be idempotent.
@@ -466,4 +466,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_cluster_role_binding_list
short_description: Kubernetes ClusterRoleBindingList
module: openshift_v1_cluster_role_binding_list
short_description: OpenShift ClusterRoleBindingList
description:
- Retrieve a list of cluster_role_bindings. List operations provide a snapshot read
of the underlying objects, returning a resource_version representing a consistent
@@ -429,4 +429,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_cluster_role_list
short_description: Kubernetes ClusterRoleList
module: openshift_v1_cluster_role_list
short_description: OpenShift ClusterRoleList
description:
- Retrieve a list of cluster_roles. List operations provide a snapshot read of the
underlying objects, returning a resource_version representing a consistent version
@@ -377,4 +377,3 @@ def main():
if __name__ == '__main__':
main()

View File

@@ -1,10 +1,10 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.openshift_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
DOCUMENTATION = '''
module: k8s_v1_deployment_config
short_description: Kubernetes DeploymentConfig
module: openshift_v1_deployment_config
short_description: OpenShift DeploymentConfig
description:
- Manage the lifecycle of a deployment_config object. Supports check mode, and attempts
to to be idempotent.
@@ -425,7 +425,7 @@ requirements:
EXAMPLES = '''
- name: Create deployment config
k8s_v1_deployment_config:
openshift_v1_deployment_config.yml:
name: frontend
namespace: k8s-project
state: present
@@ -454,7 +454,7 @@ EXAMPLES = '''
strategy_type: Rolling
- name: Patch deployment config
k8s_v1_deployment_config:
openshift_v1_deployment_config.yml:
name: frontend
namespace: k8s-project
state: present
@@ -470,7 +470,7 @@ EXAMPLES = '''
replicas: 3
- name: Replace deployment config
k8s_v1_deployment_config:
openshift_v1_deployment_config.yml:
name: frontend
namespace: k8s-project
state: replaced
@@ -499,7 +499,7 @@ EXAMPLES = '''
strategy_type: Rolling
- name: Remove deployment config
k8s_v1_deployment_config:
openshift_v1_deployment_config.yml:
name: frontend
namespace: k8s-project
state: absent
@@ -2303,80 +2303,6 @@ deployment_config:
if the port is other than default (typically TCP ports
860 and 3260).
type: str
metadata:
description:
- 'Metadata represents metadata about the pod that should populate
this volume Deprecated: Use downwardAPI instead.'
type: complex
contains:
default_mode:
description:
- 'Optional: mode bits to use on created files by default.
Must be a value between 0 and 0777. Defaults to 0644.
Directories within the path are not affected by this setting.
This might be in conflict with other options that affect
the file mode, like fsGroup, and the result can be other
mode bits set.'
type: int
items:
description:
- Items is a list of downward API volume file
type: list
contains:
field_ref:
description:
- 'Required: Selects a field of the pod: only annotations,
labels, name and namespace are supported.'
type: complex
contains:
api_version:
description:
- Version of the schema the FieldPath is written
in terms of, defaults to "v1".
type: str
field_path:
description:
- Path of the field to select in the specified API
version.
type: str
mode:
description:
- 'Optional: mode bits to use on this file, must be
a value between 0 and 0777. If not specified, the
volume defaultMode will be used. This might be in
conflict with other options that affect the file mode,
like fsGroup, and the result can be other mode bits
set.'
type: int
name:
description:
- "Required: Name is the relative path name of the file\
\ to be created. Must not be absolute or contain the\
\ '..' path. Must be utf-8 encoded. The first item\
\ of the relative path must not start with '..'"
type: str
resource_field_ref:
description:
- 'Selects a resource of the container: only resources
limits and requests (limits.cpu, limits.memory, requests.cpu
and requests.memory) are currently supported.'
type: complex
contains:
container_name:
description:
- 'Container name: required for volumes, optional
for env vars'
type: str
divisor:
description:
- Specifies the output format of the exposed resources,
defaults to "1"
type: complex
contains: {}
resource:
description:
- 'Required: resource to select'
type: str
name:
description:
- Volume's name. Must be a DNS_LABEL and unique within the pod.
@@ -2764,4 +2690,3 @@ def main():
if __name__ == '__main__':
main()

Some files were not shown because too many files have changed in this diff Show More