From c5f86cc9b844bc5fc7113ab3bc36cc895780e497 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Wed, 5 Apr 2017 07:29:33 -0400 Subject: [PATCH] Refreshed modules --- library/k8s_v1_binding.py | 11 +- library/k8s_v1_component_status.py | 11 +- library/k8s_v1_component_status_list.py | 11 +- library/k8s_v1_config_map.py | 11 +- library/k8s_v1_config_map_list.py | 11 +- library/k8s_v1_endpoints.py | 11 +- library/k8s_v1_endpoints_list.py | 11 +- library/k8s_v1_event.py | 11 +- library/k8s_v1_event_list.py | 11 +- library/k8s_v1_horizontal_pod_autoscaler.py | 11 +- .../k8s_v1_horizontal_pod_autoscaler_list.py | 11 +- library/k8s_v1_job.py | 85 +--- library/k8s_v1_job_list.py | 87 +--- library/k8s_v1_limit_range.py | 11 +- library/k8s_v1_limit_range_list.py | 11 +- library/k8s_v1_namespace.py | 35 +- library/k8s_v1_namespace_list.py | 11 +- library/k8s_v1_node.py | 11 +- library/k8s_v1_node_list.py | 11 +- library/k8s_v1_persistent_volume.py | 21 +- library/k8s_v1_persistent_volume_claim.py | 20 +- .../k8s_v1_persistent_volume_claim_list.py | 11 +- library/k8s_v1_persistent_volume_list.py | 11 +- library/k8s_v1_pod.py | 82 +--- library/k8s_v1_pod_list.py | 82 +--- library/k8s_v1_pod_template.py | 82 +--- library/k8s_v1_pod_template_list.py | 85 +--- library/k8s_v1_replication_controller.py | 85 +--- library/k8s_v1_replication_controller_list.py | 87 +--- library/k8s_v1_resource_quota.py | 11 +- library/k8s_v1_resource_quota_list.py | 11 +- library/k8s_v1_scale.py | 11 +- library/k8s_v1_secret.py | 11 +- library/k8s_v1_secret_list.py | 11 +- library/k8s_v1_service.py | 21 +- library/k8s_v1_service_account.py | 11 +- library/k8s_v1_service_account_list.py | 11 +- library/k8s_v1_service_list.py | 11 +- ...8s_v1alpha1_certificate_signing_request.py | 11 +- ...alpha1_certificate_signing_request_list.py | 11 +- library/k8s_v1alpha1_cluster_role.py | 362 ++++++++++++++ library/k8s_v1alpha1_cluster_role_binding.py | 367 ++++++++++++++ .../k8s_v1alpha1_cluster_role_binding_list.py | 370 +++++++++++++++ library/k8s_v1alpha1_cluster_role_list.py | 380 +++++++++++++++ library/k8s_v1alpha1_role.py | 362 ++++++++++++++ library/k8s_v1alpha1_role_binding.py | 368 ++++++++++++++ library/k8s_v1alpha1_role_binding_list.py | 371 +++++++++++++++ library/k8s_v1alpha1_role_list.py | 380 +++++++++++++++ library/k8s_v1beta1_daemon_set.py | 85 +--- library/k8s_v1beta1_daemon_set_list.py | 87 +--- library/k8s_v1beta1_deployment.py | 85 +--- library/k8s_v1beta1_deployment_list.py | 87 +--- library/k8s_v1beta1_eviction.py | 11 +- .../k8s_v1beta1_horizontal_pod_autoscaler.py | 11 +- ..._v1beta1_horizontal_pod_autoscaler_list.py | 11 +- library/k8s_v1beta1_ingress.py | 11 +- library/k8s_v1beta1_ingress_list.py | 11 +- library/k8s_v1beta1_job.py | 85 +--- library/k8s_v1beta1_job_list.py | 87 +--- ...k8s_v1beta1_local_subject_access_review.py | 448 ++++++++++++++++++ library/k8s_v1beta1_network_policy.py | 11 +- library/k8s_v1beta1_network_policy_list.py | 11 +- library/k8s_v1beta1_pod_disruption_budget.py | 11 +- .../k8s_v1beta1_pod_disruption_budget_list.py | 11 +- library/k8s_v1beta1_replica_set.py | 85 +--- library/k8s_v1beta1_replica_set_list.py | 87 +--- library/k8s_v1beta1_scale.py | 11 +- .../k8s_v1beta1_self_subject_access_review.py | 413 ++++++++++++++++ library/k8s_v1beta1_stateful_set.py | 85 +--- library/k8s_v1beta1_stateful_set_list.py | 87 +--- library/k8s_v1beta1_storage_class.py | 11 +- library/k8s_v1beta1_storage_class_list.py | 11 +- library/k8s_v1beta1_subject_access_review.py | 447 +++++++++++++++++ library/k8s_v1beta1_third_party_resource.py | 11 +- .../k8s_v1beta1_third_party_resource_list.py | 11 +- library/k8s_v1beta1_token_review.py | 11 +- library/k8s_v2alpha1_cron_job.py | 89 +--- library/k8s_v2alpha1_cron_job_list.py | 93 +--- library/k8s_v2alpha1_job.py | 85 +--- library/k8s_v2alpha1_job_list.py | 87 +--- ...hift_v1_applied_cluster_resource_quota.py} | 7 +- ...v1_applied_cluster_resource_quota_list.py} | 7 +- ...{k8s_v1_build.py => openshift_v1_build.py} | 264 ++++++++++- ...config.py => openshift_v1_build_config.py} | 264 ++++++++++- ...t.py => openshift_v1_build_config_list.py} | 230 ++++++++- ...ild_list.py => openshift_v1_build_list.py} | 230 ++++++++- ...quest.py => openshift_v1_build_request.py} | 112 ++++- ...ork.py => openshift_v1_cluster_network.py} | 7 +- ...y => openshift_v1_cluster_network_list.py} | 7 +- ...licy.py => openshift_v1_cluster_policy.py} | 7 +- ...=> openshift_v1_cluster_policy_binding.py} | 7 +- ...enshift_v1_cluster_policy_binding_list.py} | 7 +- ...py => openshift_v1_cluster_policy_list.py} | 7 +- ...=> openshift_v1_cluster_resource_quota.py} | 7 +- ...enshift_v1_cluster_resource_quota_list.py} | 7 +- ...r_role.py => openshift_v1_cluster_role.py} | 7 +- ...y => openshift_v1_cluster_role_binding.py} | 7 +- ...openshift_v1_cluster_role_binding_list.py} | 7 +- ...t.py => openshift_v1_cluster_role_list.py} | 7 +- ...g.py => openshift_v1_deployment_config.py} | 89 +--- ...=> openshift_v1_deployment_config_list.py} | 83 +--- ...penshift_v1_deployment_config_rollback.py} | 7 +- ... => openshift_v1_egress_network_policy.py} | 7 +- ...penshift_v1_egress_network_policy_list.py} | 7 +- ...{k8s_v1_group.py => openshift_v1_group.py} | 7 +- ...oup_list.py => openshift_v1_group_list.py} | 7 +- ..._subnet.py => openshift_v1_host_subnet.py} | 15 +- ...st.py => openshift_v1_host_subnet_list.py} | 11 +- ...1_identity.py => openshift_v1_identity.py} | 7 +- ..._list.py => openshift_v1_identity_list.py} | 7 +- ...{k8s_v1_image.py => openshift_v1_image.py} | 7 +- ...age_list.py => openshift_v1_image_list.py} | 7 +- ...ure.py => openshift_v1_image_signature.py} | 7 +- ...stream.py => openshift_v1_image_stream.py} | 7 +- ....py => openshift_v1_image_stream_image.py} | 7 +- ...py => openshift_v1_image_stream_import.py} | 63 ++- ...t.py => openshift_v1_image_stream_list.py} | 7 +- ...y => openshift_v1_image_stream_mapping.py} | 7 +- ...ag.py => openshift_v1_image_stream_tag.py} | 7 +- ... => openshift_v1_image_stream_tag_list.py} | 7 +- ...space.py => openshift_v1_net_namespace.py} | 7 +- ....py => openshift_v1_net_namespace_list.py} | 7 +- ...py => openshift_v1_o_auth_access_token.py} | 7 +- ... openshift_v1_o_auth_access_token_list.py} | 7 +- ...=> openshift_v1_o_auth_authorize_token.py} | 7 +- ...enshift_v1_o_auth_authorize_token_list.py} | 7 +- ...lient.py => openshift_v1_o_auth_client.py} | 7 +- ...enshift_v1_o_auth_client_authorization.py} | 7 +- ...ft_v1_o_auth_client_authorization_list.py} | 7 +- ....py => openshift_v1_o_auth_client_list.py} | 7 +- ...penshift_v1_pod_security_policy_review.py} | 157 +----- ...od_security_policy_self_subject_review.py} | 155 +----- ..._v1_pod_security_policy_subject_review.py} | 155 +----- ...8s_v1_policy.py => openshift_v1_policy.py} | 7 +- ...ding.py => openshift_v1_policy_binding.py} | 7 +- ...py => openshift_v1_policy_binding_list.py} | 7 +- ...cy_list.py => openshift_v1_policy_list.py} | 7 +- ..._v1_project.py => openshift_v1_project.py} | 11 +- ...t_list.py => openshift_v1_project_list.py} | 7 +- .../{k8s_v1_role.py => openshift_v1_role.py} | 7 +- ...inding.py => openshift_v1_role_binding.py} | 7 +- ...t.py => openshift_v1_role_binding_list.py} | 7 +- ... openshift_v1_role_binding_restriction.py} | 7 +- ...shift_v1_role_binding_restriction_list.py} | 7 +- ...role_list.py => openshift_v1_role_list.py} | 7 +- ...{k8s_v1_route.py => openshift_v1_route.py} | 15 +- ...ute_list.py => openshift_v1_route_list.py} | 7 +- ...nshift_v1_security_context_constraints.py} | 36 +- ...t_v1_security_context_constraints_list.py} | 35 +- ...openshift_v1_self_subject_rules_review.py} | 7 +- ...y => openshift_v1_subject_rules_review.py} | 7 +- ...1_template.py => openshift_v1_template.py} | 7 +- ..._list.py => openshift_v1_template_list.py} | 7 +- .../{k8s_v1_user.py => openshift_v1_user.py} | 7 +- ... => openshift_v1_user_identity_mapping.py} | 7 +- ...user_list.py => openshift_v1_user_list.py} | 7 +- ... openshift_v1beta1_pod_security_policy.py} | 33 +- ...shift_v1beta1_pod_security_policy_list.py} | 33 +- 158 files changed, 5973 insertions(+), 3158 deletions(-) create mode 100644 library/k8s_v1alpha1_cluster_role.py create mode 100644 library/k8s_v1alpha1_cluster_role_binding.py create mode 100644 library/k8s_v1alpha1_cluster_role_binding_list.py create mode 100644 library/k8s_v1alpha1_cluster_role_list.py create mode 100644 library/k8s_v1alpha1_role.py create mode 100644 library/k8s_v1alpha1_role_binding.py create mode 100644 library/k8s_v1alpha1_role_binding_list.py create mode 100644 library/k8s_v1alpha1_role_list.py create mode 100644 library/k8s_v1beta1_local_subject_access_review.py create mode 100644 library/k8s_v1beta1_self_subject_access_review.py create mode 100644 library/k8s_v1beta1_subject_access_review.py rename library/{k8s_v1_applied_cluster_resource_quota.py => openshift_v1_applied_cluster_resource_quota.py} (98%) rename library/{k8s_v1_applied_cluster_resource_quota_list.py => openshift_v1_applied_cluster_resource_quota_list.py} (98%) rename library/{k8s_v1_build.py => openshift_v1_build.py} (87%) rename library/{k8s_v1_build_config.py => openshift_v1_build_config.py} (86%) rename library/{k8s_v1_build_config_list.py => openshift_v1_build_config_list.py} (85%) rename library/{k8s_v1_build_list.py => openshift_v1_build_list.py} (86%) rename library/{k8s_v1_build_request.py => openshift_v1_build_request.py} (88%) rename library/{k8s_v1_cluster_network.py => openshift_v1_cluster_network.py} (98%) rename library/{k8s_v1_cluster_network_list.py => openshift_v1_cluster_network_list.py} (98%) rename library/{k8s_v1_cluster_policy.py => openshift_v1_cluster_policy.py} (99%) rename library/{k8s_v1_cluster_policy_binding.py => openshift_v1_cluster_policy_binding.py} (99%) rename library/{k8s_v1_cluster_policy_binding_list.py => openshift_v1_cluster_policy_binding_list.py} (99%) rename library/{k8s_v1_cluster_policy_list.py => openshift_v1_cluster_policy_list.py} (99%) rename library/{k8s_v1_cluster_resource_quota.py => openshift_v1_cluster_resource_quota.py} (99%) rename library/{k8s_v1_cluster_resource_quota_list.py => openshift_v1_cluster_resource_quota_list.py} (98%) rename library/{k8s_v1_cluster_role.py => openshift_v1_cluster_role.py} (98%) rename library/{k8s_v1_cluster_role_binding.py => openshift_v1_cluster_role_binding.py} (99%) rename library/{k8s_v1_cluster_role_binding_list.py => openshift_v1_cluster_role_binding_list.py} (98%) rename library/{k8s_v1_cluster_role_list.py => openshift_v1_cluster_role_list.py} (98%) rename library/{k8s_v1_deployment_config.py => openshift_v1_deployment_config.py} (96%) rename library/{k8s_v1_deployment_config_list.py => openshift_v1_deployment_config_list.py} (96%) rename library/{k8s_v1_deployment_config_rollback.py => openshift_v1_deployment_config_rollback.py} (97%) rename library/{k8s_v1_egress_network_policy.py => openshift_v1_egress_network_policy.py} (98%) rename library/{k8s_v1_egress_network_policy_list.py => openshift_v1_egress_network_policy_list.py} (98%) rename library/{k8s_v1_group.py => openshift_v1_group.py} (98%) rename library/{k8s_v1_group_list.py => openshift_v1_group_list.py} (98%) rename library/{k8s_v1_host_subnet.py => openshift_v1_host_subnet.py} (96%) rename library/{k8s_v1_host_subnet_list.py => openshift_v1_host_subnet_list.py} (97%) rename library/{k8s_v1_identity.py => openshift_v1_identity.py} (99%) rename library/{k8s_v1_identity_list.py => openshift_v1_identity_list.py} (98%) rename library/{k8s_v1_image.py => openshift_v1_image.py} (99%) rename library/{k8s_v1_image_list.py => openshift_v1_image_list.py} (99%) rename library/{k8s_v1_image_signature.py => openshift_v1_image_signature.py} (98%) rename library/{k8s_v1_image_stream.py => openshift_v1_image_stream.py} (99%) rename library/{k8s_v1_image_stream_image.py => openshift_v1_image_stream_image.py} (99%) rename library/{k8s_v1_image_stream_import.py => openshift_v1_image_stream_import.py} (96%) rename library/{k8s_v1_image_stream_list.py => openshift_v1_image_stream_list.py} (99%) rename library/{k8s_v1_image_stream_mapping.py => openshift_v1_image_stream_mapping.py} (99%) rename library/{k8s_v1_image_stream_tag.py => openshift_v1_image_stream_tag.py} (99%) rename library/{k8s_v1_image_stream_tag_list.py => openshift_v1_image_stream_tag_list.py} (99%) rename library/{k8s_v1_net_namespace.py => openshift_v1_net_namespace.py} (98%) rename library/{k8s_v1_net_namespace_list.py => openshift_v1_net_namespace_list.py} (98%) rename library/{k8s_v1_o_auth_access_token.py => openshift_v1_o_auth_access_token.py} (98%) rename library/{k8s_v1_o_auth_access_token_list.py => openshift_v1_o_auth_access_token_list.py} (98%) rename library/{k8s_v1_o_auth_authorize_token.py => openshift_v1_o_auth_authorize_token.py} (98%) rename library/{k8s_v1_o_auth_authorize_token_list.py => openshift_v1_o_auth_authorize_token_list.py} (98%) rename library/{k8s_v1_o_auth_client.py => openshift_v1_o_auth_client.py} (98%) rename library/{k8s_v1_o_auth_client_authorization.py => openshift_v1_o_auth_client_authorization.py} (98%) rename library/{k8s_v1_o_auth_client_authorization_list.py => openshift_v1_o_auth_client_authorization_list.py} (98%) rename library/{k8s_v1_o_auth_client_list.py => openshift_v1_o_auth_client_list.py} (98%) rename library/{k8s_v1_pod_security_policy_review.py => openshift_v1_pod_security_policy_review.py} (95%) rename library/{k8s_v1_pod_security_policy_self_subject_review.py => openshift_v1_pod_security_policy_self_subject_review.py} (95%) rename library/{k8s_v1_pod_security_policy_subject_review.py => openshift_v1_pod_security_policy_subject_review.py} (95%) rename library/{k8s_v1_policy.py => openshift_v1_policy.py} (99%) rename library/{k8s_v1_policy_binding.py => openshift_v1_policy_binding.py} (99%) rename library/{k8s_v1_policy_binding_list.py => openshift_v1_policy_binding_list.py} (99%) rename library/{k8s_v1_policy_list.py => openshift_v1_policy_list.py} (99%) rename library/{k8s_v1_project.py => openshift_v1_project.py} (98%) rename library/{k8s_v1_project_list.py => openshift_v1_project_list.py} (98%) rename library/{k8s_v1_role.py => openshift_v1_role.py} (98%) rename library/{k8s_v1_role_binding.py => openshift_v1_role_binding.py} (99%) rename library/{k8s_v1_role_binding_list.py => openshift_v1_role_binding_list.py} (99%) rename library/{k8s_v1_role_binding_restriction.py => openshift_v1_role_binding_restriction.py} (99%) rename library/{k8s_v1_role_binding_restriction_list.py => openshift_v1_role_binding_restriction_list.py} (99%) rename library/{k8s_v1_role_list.py => openshift_v1_role_list.py} (98%) rename library/{k8s_v1_route.py => openshift_v1_route.py} (98%) rename library/{k8s_v1_route_list.py => openshift_v1_route_list.py} (99%) rename library/{k8s_v1_security_context_constraints.py => openshift_v1_security_context_constraints.py} (94%) rename library/{k8s_v1_security_context_constraints_list.py => openshift_v1_security_context_constraints_list.py} (93%) rename library/{k8s_v1_self_subject_rules_review.py => openshift_v1_self_subject_rules_review.py} (97%) rename library/{k8s_v1_subject_rules_review.py => openshift_v1_subject_rules_review.py} (97%) rename library/{k8s_v1_template.py => openshift_v1_template.py} (99%) rename library/{k8s_v1_template_list.py => openshift_v1_template_list.py} (99%) rename library/{k8s_v1_user.py => openshift_v1_user.py} (98%) rename library/{k8s_v1_user_identity_mapping.py => openshift_v1_user_identity_mapping.py} (98%) rename library/{k8s_v1_user_list.py => openshift_v1_user_list.py} (98%) rename library/{k8s_v1beta1_pod_security_policy.py => openshift_v1beta1_pod_security_policy.py} (94%) rename library/{k8s_v1beta1_pod_security_policy_list.py => openshift_v1beta1_pod_security_policy_list.py} (93%) diff --git a/library/k8s_v1_binding.py b/library/k8s_v1_binding.py index 9229e93a..1ada7a08 100644 --- a/library/k8s_v1_binding.py +++ b/library/k8s_v1_binding.py @@ -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() - diff --git a/library/k8s_v1_component_status.py b/library/k8s_v1_component_status.py index a5a92026..4ac69d34 100644 --- a/library/k8s_v1_component_status.py +++ b/library/k8s_v1_component_status.py @@ -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() - diff --git a/library/k8s_v1_component_status_list.py b/library/k8s_v1_component_status_list.py index 2eae282a..8398fba1 100644 --- a/library/k8s_v1_component_status_list.py +++ b/library/k8s_v1_component_status_list.py @@ -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() - diff --git a/library/k8s_v1_config_map.py b/library/k8s_v1_config_map.py index 3207e270..2a836e98 100644 --- a/library/k8s_v1_config_map.py +++ b/library/k8s_v1_config_map.py @@ -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() - diff --git a/library/k8s_v1_config_map_list.py b/library/k8s_v1_config_map_list.py index 103d9fbd..5fa58eea 100644 --- a/library/k8s_v1_config_map_list.py +++ b/library/k8s_v1_config_map_list.py @@ -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() - diff --git a/library/k8s_v1_endpoints.py b/library/k8s_v1_endpoints.py index 98d1cfd5..5984fe14 100644 --- a/library/k8s_v1_endpoints.py +++ b/library/k8s_v1_endpoints.py @@ -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() - diff --git a/library/k8s_v1_endpoints_list.py b/library/k8s_v1_endpoints_list.py index 0df6fc49..e817ecf7 100644 --- a/library/k8s_v1_endpoints_list.py +++ b/library/k8s_v1_endpoints_list.py @@ -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() - diff --git a/library/k8s_v1_event.py b/library/k8s_v1_event.py index e64860c0..5d9d0ab4 100644 --- a/library/k8s_v1_event.py +++ b/library/k8s_v1_event.py @@ -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() - diff --git a/library/k8s_v1_event_list.py b/library/k8s_v1_event_list.py index fdf0da12..eb25e735 100644 --- a/library/k8s_v1_event_list.py +++ b/library/k8s_v1_event_list.py @@ -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() - diff --git a/library/k8s_v1_horizontal_pod_autoscaler.py b/library/k8s_v1_horizontal_pod_autoscaler.py index 290b4b31..cce6a211 100644 --- a/library/k8s_v1_horizontal_pod_autoscaler.py +++ b/library/k8s_v1_horizontal_pod_autoscaler.py @@ -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() - diff --git a/library/k8s_v1_horizontal_pod_autoscaler_list.py b/library/k8s_v1_horizontal_pod_autoscaler_list.py index e8980872..6a44f2f1 100644 --- a/library/k8s_v1_horizontal_pod_autoscaler_list.py +++ b/library/k8s_v1_horizontal_pod_autoscaler_list.py @@ -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() - diff --git a/library/k8s_v1_job.py b/library/k8s_v1_job.py index a5dd309e..3a6dca9b 100644 --- a/library/k8s_v1_job.py +++ b/library/k8s_v1_job.py @@ -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() - diff --git a/library/k8s_v1_job_list.py b/library/k8s_v1_job_list.py index 8543ac34..a96cce82 100644 --- a/library/k8s_v1_job_list.py +++ b/library/k8s_v1_job_list.py @@ -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() - diff --git a/library/k8s_v1_limit_range.py b/library/k8s_v1_limit_range.py index e656e2a7..dcf9bb6c 100644 --- a/library/k8s_v1_limit_range.py +++ b/library/k8s_v1_limit_range.py @@ -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() - diff --git a/library/k8s_v1_limit_range_list.py b/library/k8s_v1_limit_range_list.py index 1348c240..fad5d09e 100644 --- a/library/k8s_v1_limit_range_list.py +++ b/library/k8s_v1_limit_range_list.py @@ -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() - diff --git a/library/k8s_v1_namespace.py b/library/k8s_v1_namespace.py index 8b86fbeb..9d886b18 100644 --- a/library/k8s_v1_namespace.py +++ b/library/k8s_v1_namespace.py @@ -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() - diff --git a/library/k8s_v1_namespace_list.py b/library/k8s_v1_namespace_list.py index 1ea86480..19ed6ffa 100644 --- a/library/k8s_v1_namespace_list.py +++ b/library/k8s_v1_namespace_list.py @@ -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() - diff --git a/library/k8s_v1_node.py b/library/k8s_v1_node.py index ee1b658a..cb9bedf4 100644 --- a/library/k8s_v1_node.py +++ b/library/k8s_v1_node.py @@ -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() - diff --git a/library/k8s_v1_node_list.py b/library/k8s_v1_node_list.py index 60b3c791..f38b8cca 100644 --- a/library/k8s_v1_node_list.py +++ b/library/k8s_v1_node_list.py @@ -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() - diff --git a/library/k8s_v1_persistent_volume.py b/library/k8s_v1_persistent_volume.py index 95417429..a9605849 100644 --- a/library/k8s_v1_persistent_volume.py +++ b/library/k8s_v1_persistent_volume.py @@ -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() - diff --git a/library/k8s_v1_persistent_volume_claim.py b/library/k8s_v1_persistent_volume_claim.py index 9eaa4b93..7a3315d9 100644 --- a/library/k8s_v1_persistent_volume_claim.py +++ b/library/k8s_v1_persistent_volume_claim.py @@ -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() - diff --git a/library/k8s_v1_persistent_volume_claim_list.py b/library/k8s_v1_persistent_volume_claim_list.py index 4f25c0ec..74e09c61 100644 --- a/library/k8s_v1_persistent_volume_claim_list.py +++ b/library/k8s_v1_persistent_volume_claim_list.py @@ -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() - diff --git a/library/k8s_v1_persistent_volume_list.py b/library/k8s_v1_persistent_volume_list.py index 02c6fe39..af11f1f8 100644 --- a/library/k8s_v1_persistent_volume_list.py +++ b/library/k8s_v1_persistent_volume_list.py @@ -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() - diff --git a/library/k8s_v1_pod.py b/library/k8s_v1_pod.py index 7d1812a7..fe91de1b 100644 --- a/library/k8s_v1_pod.py +++ b/library/k8s_v1_pod.py @@ -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() - diff --git a/library/k8s_v1_pod_list.py b/library/k8s_v1_pod_list.py index b4a08c6b..e3f9877d 100644 --- a/library/k8s_v1_pod_list.py +++ b/library/k8s_v1_pod_list.py @@ -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() - diff --git a/library/k8s_v1_pod_template.py b/library/k8s_v1_pod_template.py index 61795eb5..823de208 100644 --- a/library/k8s_v1_pod_template.py +++ b/library/k8s_v1_pod_template.py @@ -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() - diff --git a/library/k8s_v1_pod_template_list.py b/library/k8s_v1_pod_template_list.py index 376bb5f4..c1cc2ad7 100644 --- a/library/k8s_v1_pod_template_list.py +++ b/library/k8s_v1_pod_template_list.py @@ -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() - diff --git a/library/k8s_v1_replication_controller.py b/library/k8s_v1_replication_controller.py index 148f511d..11771bf7 100644 --- a/library/k8s_v1_replication_controller.py +++ b/library/k8s_v1_replication_controller.py @@ -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() - diff --git a/library/k8s_v1_replication_controller_list.py b/library/k8s_v1_replication_controller_list.py index 0c929ede..0828c636 100644 --- a/library/k8s_v1_replication_controller_list.py +++ b/library/k8s_v1_replication_controller_list.py @@ -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() - diff --git a/library/k8s_v1_resource_quota.py b/library/k8s_v1_resource_quota.py index dd822673..aec8ef3e 100644 --- a/library/k8s_v1_resource_quota.py +++ b/library/k8s_v1_resource_quota.py @@ -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() - diff --git a/library/k8s_v1_resource_quota_list.py b/library/k8s_v1_resource_quota_list.py index 1bb105f2..bafa6be9 100644 --- a/library/k8s_v1_resource_quota_list.py +++ b/library/k8s_v1_resource_quota_list.py @@ -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() - diff --git a/library/k8s_v1_scale.py b/library/k8s_v1_scale.py index d4fbd7b2..25524969 100644 --- a/library/k8s_v1_scale.py +++ b/library/k8s_v1_scale.py @@ -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() - diff --git a/library/k8s_v1_secret.py b/library/k8s_v1_secret.py index a43a1fa4..e4d7d19c 100644 --- a/library/k8s_v1_secret.py +++ b/library/k8s_v1_secret.py @@ -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() - diff --git a/library/k8s_v1_secret_list.py b/library/k8s_v1_secret_list.py index 6226010e..efd17f45 100644 --- a/library/k8s_v1_secret_list.py +++ b/library/k8s_v1_secret_list.py @@ -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() - diff --git a/library/k8s_v1_service.py b/library/k8s_v1_service.py index 62de11e8..1969aee4 100644 --- a/library/k8s_v1_service.py +++ b/library/k8s_v1_service.py @@ -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() - diff --git a/library/k8s_v1_service_account.py b/library/k8s_v1_service_account.py index 94157675..4b02db27 100644 --- a/library/k8s_v1_service_account.py +++ b/library/k8s_v1_service_account.py @@ -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() - diff --git a/library/k8s_v1_service_account_list.py b/library/k8s_v1_service_account_list.py index ef6030c9..929cfb1c 100644 --- a/library/k8s_v1_service_account_list.py +++ b/library/k8s_v1_service_account_list.py @@ -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() - diff --git a/library/k8s_v1_service_list.py b/library/k8s_v1_service_list.py index 6f22a713..0652f067 100644 --- a/library/k8s_v1_service_list.py +++ b/library/k8s_v1_service_list.py @@ -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() - diff --git a/library/k8s_v1alpha1_certificate_signing_request.py b/library/k8s_v1alpha1_certificate_signing_request.py index c8126858..843a14ef 100644 --- a/library/k8s_v1alpha1_certificate_signing_request.py +++ b/library/k8s_v1alpha1_certificate_signing_request.py @@ -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() - diff --git a/library/k8s_v1alpha1_certificate_signing_request_list.py b/library/k8s_v1alpha1_certificate_signing_request_list.py index 33cd64a0..8fd87eb3 100644 --- a/library/k8s_v1alpha1_certificate_signing_request_list.py +++ b/library/k8s_v1alpha1_certificate_signing_request_list.py @@ -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() - diff --git a/library/k8s_v1alpha1_cluster_role.py b/library/k8s_v1alpha1_cluster_role.py new file mode 100644 index 00000000..bdbaf31a --- /dev/null +++ b/library/k8s_v1alpha1_cluster_role.py @@ -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() diff --git a/library/k8s_v1alpha1_cluster_role_binding.py b/library/k8s_v1alpha1_cluster_role_binding.py new file mode 100644 index 00000000..361cc5ec --- /dev/null +++ b/library/k8s_v1alpha1_cluster_role_binding.py @@ -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() diff --git a/library/k8s_v1alpha1_cluster_role_binding_list.py b/library/k8s_v1alpha1_cluster_role_binding_list.py new file mode 100644 index 00000000..a60dd65c --- /dev/null +++ b/library/k8s_v1alpha1_cluster_role_binding_list.py @@ -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() diff --git a/library/k8s_v1alpha1_cluster_role_list.py b/library/k8s_v1alpha1_cluster_role_list.py new file mode 100644 index 00000000..9d764041 --- /dev/null +++ b/library/k8s_v1alpha1_cluster_role_list.py @@ -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() diff --git a/library/k8s_v1alpha1_role.py b/library/k8s_v1alpha1_role.py new file mode 100644 index 00000000..8e2d62a1 --- /dev/null +++ b/library/k8s_v1alpha1_role.py @@ -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() diff --git a/library/k8s_v1alpha1_role_binding.py b/library/k8s_v1alpha1_role_binding.py new file mode 100644 index 00000000..02bb5756 --- /dev/null +++ b/library/k8s_v1alpha1_role_binding.py @@ -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() diff --git a/library/k8s_v1alpha1_role_binding_list.py b/library/k8s_v1alpha1_role_binding_list.py new file mode 100644 index 00000000..ad0d89c2 --- /dev/null +++ b/library/k8s_v1alpha1_role_binding_list.py @@ -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() diff --git a/library/k8s_v1alpha1_role_list.py b/library/k8s_v1alpha1_role_list.py new file mode 100644 index 00000000..369fc3e3 --- /dev/null +++ b/library/k8s_v1alpha1_role_list.py @@ -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() diff --git a/library/k8s_v1beta1_daemon_set.py b/library/k8s_v1beta1_daemon_set.py index 67c4d0cc..f395bee3 100644 --- a/library/k8s_v1beta1_daemon_set.py +++ b/library/k8s_v1beta1_daemon_set.py @@ -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() - diff --git a/library/k8s_v1beta1_daemon_set_list.py b/library/k8s_v1beta1_daemon_set_list.py index e554bece..b7765d22 100644 --- a/library/k8s_v1beta1_daemon_set_list.py +++ b/library/k8s_v1beta1_daemon_set_list.py @@ -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() - diff --git a/library/k8s_v1beta1_deployment.py b/library/k8s_v1beta1_deployment.py index 319eb1f3..e385f121 100644 --- a/library/k8s_v1beta1_deployment.py +++ b/library/k8s_v1beta1_deployment.py @@ -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() - diff --git a/library/k8s_v1beta1_deployment_list.py b/library/k8s_v1beta1_deployment_list.py index 0dae894e..7fdc9a97 100644 --- a/library/k8s_v1beta1_deployment_list.py +++ b/library/k8s_v1beta1_deployment_list.py @@ -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() - diff --git a/library/k8s_v1beta1_eviction.py b/library/k8s_v1beta1_eviction.py index 365f336a..32b041c3 100644 --- a/library/k8s_v1beta1_eviction.py +++ b/library/k8s_v1beta1_eviction.py @@ -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() - diff --git a/library/k8s_v1beta1_horizontal_pod_autoscaler.py b/library/k8s_v1beta1_horizontal_pod_autoscaler.py index 1819f8af..bbd4f26e 100644 --- a/library/k8s_v1beta1_horizontal_pod_autoscaler.py +++ b/library/k8s_v1beta1_horizontal_pod_autoscaler.py @@ -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() - diff --git a/library/k8s_v1beta1_horizontal_pod_autoscaler_list.py b/library/k8s_v1beta1_horizontal_pod_autoscaler_list.py index 06e98847..af2e135e 100644 --- a/library/k8s_v1beta1_horizontal_pod_autoscaler_list.py +++ b/library/k8s_v1beta1_horizontal_pod_autoscaler_list.py @@ -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() - diff --git a/library/k8s_v1beta1_ingress.py b/library/k8s_v1beta1_ingress.py index 7f03a39f..b955d128 100644 --- a/library/k8s_v1beta1_ingress.py +++ b/library/k8s_v1beta1_ingress.py @@ -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() - diff --git a/library/k8s_v1beta1_ingress_list.py b/library/k8s_v1beta1_ingress_list.py index ae2b4491..ff4bc656 100644 --- a/library/k8s_v1beta1_ingress_list.py +++ b/library/k8s_v1beta1_ingress_list.py @@ -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() - diff --git a/library/k8s_v1beta1_job.py b/library/k8s_v1beta1_job.py index a38f9dff..1a0e6355 100644 --- a/library/k8s_v1beta1_job.py +++ b/library/k8s_v1beta1_job.py @@ -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() - diff --git a/library/k8s_v1beta1_job_list.py b/library/k8s_v1beta1_job_list.py index 846547dd..7d6935f3 100644 --- a/library/k8s_v1beta1_job_list.py +++ b/library/k8s_v1beta1_job_list.py @@ -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() - diff --git a/library/k8s_v1beta1_local_subject_access_review.py b/library/k8s_v1beta1_local_subject_access_review.py new file mode 100644 index 00000000..47f79404 --- /dev/null +++ b/library/k8s_v1beta1_local_subject_access_review.py @@ -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() diff --git a/library/k8s_v1beta1_network_policy.py b/library/k8s_v1beta1_network_policy.py index 1f607ea3..2f951298 100644 --- a/library/k8s_v1beta1_network_policy.py +++ b/library/k8s_v1beta1_network_policy.py @@ -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() - diff --git a/library/k8s_v1beta1_network_policy_list.py b/library/k8s_v1beta1_network_policy_list.py index e70672b6..bdaf8ee2 100644 --- a/library/k8s_v1beta1_network_policy_list.py +++ b/library/k8s_v1beta1_network_policy_list.py @@ -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() - diff --git a/library/k8s_v1beta1_pod_disruption_budget.py b/library/k8s_v1beta1_pod_disruption_budget.py index 7fb663c8..c0d6eff8 100644 --- a/library/k8s_v1beta1_pod_disruption_budget.py +++ b/library/k8s_v1beta1_pod_disruption_budget.py @@ -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() - diff --git a/library/k8s_v1beta1_pod_disruption_budget_list.py b/library/k8s_v1beta1_pod_disruption_budget_list.py index 38c4fb99..2b96b2c4 100644 --- a/library/k8s_v1beta1_pod_disruption_budget_list.py +++ b/library/k8s_v1beta1_pod_disruption_budget_list.py @@ -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() - diff --git a/library/k8s_v1beta1_replica_set.py b/library/k8s_v1beta1_replica_set.py index 5c9b3588..2424295d 100644 --- a/library/k8s_v1beta1_replica_set.py +++ b/library/k8s_v1beta1_replica_set.py @@ -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() - diff --git a/library/k8s_v1beta1_replica_set_list.py b/library/k8s_v1beta1_replica_set_list.py index a0faefe4..cf89c073 100644 --- a/library/k8s_v1beta1_replica_set_list.py +++ b/library/k8s_v1beta1_replica_set_list.py @@ -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() - diff --git a/library/k8s_v1beta1_scale.py b/library/k8s_v1beta1_scale.py index 34140445..14f2a25e 100644 --- a/library/k8s_v1beta1_scale.py +++ b/library/k8s_v1beta1_scale.py @@ -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() - diff --git a/library/k8s_v1beta1_self_subject_access_review.py b/library/k8s_v1beta1_self_subject_access_review.py new file mode 100644 index 00000000..e2d8bba0 --- /dev/null +++ b/library/k8s_v1beta1_self_subject_access_review.py @@ -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() diff --git a/library/k8s_v1beta1_stateful_set.py b/library/k8s_v1beta1_stateful_set.py index 3fed6b7b..8a83258a 100644 --- a/library/k8s_v1beta1_stateful_set.py +++ b/library/k8s_v1beta1_stateful_set.py @@ -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() - diff --git a/library/k8s_v1beta1_stateful_set_list.py b/library/k8s_v1beta1_stateful_set_list.py index e2962319..03925d0e 100644 --- a/library/k8s_v1beta1_stateful_set_list.py +++ b/library/k8s_v1beta1_stateful_set_list.py @@ -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() - diff --git a/library/k8s_v1beta1_storage_class.py b/library/k8s_v1beta1_storage_class.py index a9403a91..a6460de2 100644 --- a/library/k8s_v1beta1_storage_class.py +++ b/library/k8s_v1beta1_storage_class.py @@ -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() - diff --git a/library/k8s_v1beta1_storage_class_list.py b/library/k8s_v1beta1_storage_class_list.py index 98ba7b82..c6a56ed7 100644 --- a/library/k8s_v1beta1_storage_class_list.py +++ b/library/k8s_v1beta1_storage_class_list.py @@ -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() - diff --git a/library/k8s_v1beta1_subject_access_review.py b/library/k8s_v1beta1_subject_access_review.py new file mode 100644 index 00000000..bcdbd93f --- /dev/null +++ b/library/k8s_v1beta1_subject_access_review.py @@ -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() diff --git a/library/k8s_v1beta1_third_party_resource.py b/library/k8s_v1beta1_third_party_resource.py index 3cc9d350..1a797ffb 100644 --- a/library/k8s_v1beta1_third_party_resource.py +++ b/library/k8s_v1beta1_third_party_resource.py @@ -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() - diff --git a/library/k8s_v1beta1_third_party_resource_list.py b/library/k8s_v1beta1_third_party_resource_list.py index 3f37b019..e6f54358 100644 --- a/library/k8s_v1beta1_third_party_resource_list.py +++ b/library/k8s_v1beta1_third_party_resource_list.py @@ -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() - diff --git a/library/k8s_v1beta1_token_review.py b/library/k8s_v1beta1_token_review.py index f896b839..6e2dacb8 100644 --- a/library/k8s_v1beta1_token_review.py +++ b/library/k8s_v1beta1_token_review.py @@ -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() - diff --git a/library/k8s_v2alpha1_cron_job.py b/library/k8s_v2alpha1_cron_job.py index ba894a1b..26baa3fb 100644 --- a/library/k8s_v2alpha1_cron_job.py +++ b/library/k8s_v2alpha1_cron_job.py @@ -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() - diff --git a/library/k8s_v2alpha1_cron_job_list.py b/library/k8s_v2alpha1_cron_job_list.py index 49c8b6ff..3fe1fa65 100644 --- a/library/k8s_v2alpha1_cron_job_list.py +++ b/library/k8s_v2alpha1_cron_job_list.py @@ -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() - diff --git a/library/k8s_v2alpha1_job.py b/library/k8s_v2alpha1_job.py index 92c14d49..446e8d0a 100644 --- a/library/k8s_v2alpha1_job.py +++ b/library/k8s_v2alpha1_job.py @@ -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() - diff --git a/library/k8s_v2alpha1_job_list.py b/library/k8s_v2alpha1_job_list.py index 468ed90d..b7441db6 100644 --- a/library/k8s_v2alpha1_job_list.py +++ b/library/k8s_v2alpha1_job_list.py @@ -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() - diff --git a/library/k8s_v1_applied_cluster_resource_quota.py b/library/openshift_v1_applied_cluster_resource_quota.py similarity index 98% rename from library/k8s_v1_applied_cluster_resource_quota.py rename to library/openshift_v1_applied_cluster_resource_quota.py index e0afd25e..5770978b 100644 --- a/library/k8s_v1_applied_cluster_resource_quota.py +++ b/library/openshift_v1_applied_cluster_resource_quota.py @@ -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() - diff --git a/library/k8s_v1_applied_cluster_resource_quota_list.py b/library/openshift_v1_applied_cluster_resource_quota_list.py similarity index 98% rename from library/k8s_v1_applied_cluster_resource_quota_list.py rename to library/openshift_v1_applied_cluster_resource_quota_list.py index 79211e05..9b81bb22 100644 --- a/library/k8s_v1_applied_cluster_resource_quota_list.py +++ b/library/openshift_v1_applied_cluster_resource_quota_list.py @@ -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() - diff --git a/library/k8s_v1_build.py b/library/openshift_v1_build.py similarity index 87% rename from library/k8s_v1_build.py rename to library/openshift_v1_build.py index 36aa3ad1..0f3698dc 100644 --- a/library/k8s_v1_build.py +++ b/library/openshift_v1_build.py @@ -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() - diff --git a/library/k8s_v1_build_config.py b/library/openshift_v1_build_config.py similarity index 86% rename from library/k8s_v1_build_config.py rename to library/openshift_v1_build_config.py index 6d59c7ec..8e2ec132 100644 --- a/library/k8s_v1_build_config.py +++ b/library/openshift_v1_build_config.py @@ -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() - diff --git a/library/k8s_v1_build_config_list.py b/library/openshift_v1_build_config_list.py similarity index 85% rename from library/k8s_v1_build_config_list.py rename to library/openshift_v1_build_config_list.py index 0913e8da..f533448c 100644 --- a/library/k8s_v1_build_config_list.py +++ b/library/openshift_v1_build_config_list.py @@ -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() - diff --git a/library/k8s_v1_build_list.py b/library/openshift_v1_build_list.py similarity index 86% rename from library/k8s_v1_build_list.py rename to library/openshift_v1_build_list.py index df9f55b4..cd20bd0f 100644 --- a/library/k8s_v1_build_list.py +++ b/library/openshift_v1_build_list.py @@ -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() - diff --git a/library/k8s_v1_build_request.py b/library/openshift_v1_build_request.py similarity index 88% rename from library/k8s_v1_build_request.py rename to library/openshift_v1_build_request.py index 4b00ae66..a75e4da9 100644 --- a/library/k8s_v1_build_request.py +++ b/library/openshift_v1_build_request.py @@ -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() - diff --git a/library/k8s_v1_cluster_network.py b/library/openshift_v1_cluster_network.py similarity index 98% rename from library/k8s_v1_cluster_network.py rename to library/openshift_v1_cluster_network.py index 1ddac4bf..1a7cb475 100644 --- a/library/k8s_v1_cluster_network.py +++ b/library/openshift_v1_cluster_network.py @@ -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() - diff --git a/library/k8s_v1_cluster_network_list.py b/library/openshift_v1_cluster_network_list.py similarity index 98% rename from library/k8s_v1_cluster_network_list.py rename to library/openshift_v1_cluster_network_list.py index 24d671ff..483b6cf2 100644 --- a/library/k8s_v1_cluster_network_list.py +++ b/library/openshift_v1_cluster_network_list.py @@ -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() - diff --git a/library/k8s_v1_cluster_policy.py b/library/openshift_v1_cluster_policy.py similarity index 99% rename from library/k8s_v1_cluster_policy.py rename to library/openshift_v1_cluster_policy.py index d3588712..720425e4 100644 --- a/library/k8s_v1_cluster_policy.py +++ b/library/openshift_v1_cluster_policy.py @@ -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() - diff --git a/library/k8s_v1_cluster_policy_binding.py b/library/openshift_v1_cluster_policy_binding.py similarity index 99% rename from library/k8s_v1_cluster_policy_binding.py rename to library/openshift_v1_cluster_policy_binding.py index 8b4e49a9..f69d2d5c 100644 --- a/library/k8s_v1_cluster_policy_binding.py +++ b/library/openshift_v1_cluster_policy_binding.py @@ -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() - diff --git a/library/k8s_v1_cluster_policy_binding_list.py b/library/openshift_v1_cluster_policy_binding_list.py similarity index 99% rename from library/k8s_v1_cluster_policy_binding_list.py rename to library/openshift_v1_cluster_policy_binding_list.py index 66b7b24f..c158ec12 100644 --- a/library/k8s_v1_cluster_policy_binding_list.py +++ b/library/openshift_v1_cluster_policy_binding_list.py @@ -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() - diff --git a/library/k8s_v1_cluster_policy_list.py b/library/openshift_v1_cluster_policy_list.py similarity index 99% rename from library/k8s_v1_cluster_policy_list.py rename to library/openshift_v1_cluster_policy_list.py index c14e4286..7f0625df 100644 --- a/library/k8s_v1_cluster_policy_list.py +++ b/library/openshift_v1_cluster_policy_list.py @@ -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() - diff --git a/library/k8s_v1_cluster_resource_quota.py b/library/openshift_v1_cluster_resource_quota.py similarity index 99% rename from library/k8s_v1_cluster_resource_quota.py rename to library/openshift_v1_cluster_resource_quota.py index 7a1e0d08..e0653e49 100644 --- a/library/k8s_v1_cluster_resource_quota.py +++ b/library/openshift_v1_cluster_resource_quota.py @@ -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() - diff --git a/library/k8s_v1_cluster_resource_quota_list.py b/library/openshift_v1_cluster_resource_quota_list.py similarity index 98% rename from library/k8s_v1_cluster_resource_quota_list.py rename to library/openshift_v1_cluster_resource_quota_list.py index acb5d6cc..9fd790c2 100644 --- a/library/k8s_v1_cluster_resource_quota_list.py +++ b/library/openshift_v1_cluster_resource_quota_list.py @@ -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() - diff --git a/library/k8s_v1_cluster_role.py b/library/openshift_v1_cluster_role.py similarity index 98% rename from library/k8s_v1_cluster_role.py rename to library/openshift_v1_cluster_role.py index fd5e7199..588fe7ef 100644 --- a/library/k8s_v1_cluster_role.py +++ b/library/openshift_v1_cluster_role.py @@ -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() - diff --git a/library/k8s_v1_cluster_role_binding.py b/library/openshift_v1_cluster_role_binding.py similarity index 99% rename from library/k8s_v1_cluster_role_binding.py rename to library/openshift_v1_cluster_role_binding.py index 3e7080a0..3a4a114c 100644 --- a/library/k8s_v1_cluster_role_binding.py +++ b/library/openshift_v1_cluster_role_binding.py @@ -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() - diff --git a/library/k8s_v1_cluster_role_binding_list.py b/library/openshift_v1_cluster_role_binding_list.py similarity index 98% rename from library/k8s_v1_cluster_role_binding_list.py rename to library/openshift_v1_cluster_role_binding_list.py index 23197521..79c75b4b 100644 --- a/library/k8s_v1_cluster_role_binding_list.py +++ b/library/openshift_v1_cluster_role_binding_list.py @@ -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() - diff --git a/library/k8s_v1_cluster_role_list.py b/library/openshift_v1_cluster_role_list.py similarity index 98% rename from library/k8s_v1_cluster_role_list.py rename to library/openshift_v1_cluster_role_list.py index 70e727f6..927b94c6 100644 --- a/library/k8s_v1_cluster_role_list.py +++ b/library/openshift_v1_cluster_role_list.py @@ -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() - diff --git a/library/k8s_v1_deployment_config.py b/library/openshift_v1_deployment_config.py similarity index 96% rename from library/k8s_v1_deployment_config.py rename to library/openshift_v1_deployment_config.py index 99e1d94f..087878db 100644 --- a/library/k8s_v1_deployment_config.py +++ b/library/openshift_v1_deployment_config.py @@ -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() - diff --git a/library/k8s_v1_deployment_config_list.py b/library/openshift_v1_deployment_config_list.py similarity index 96% rename from library/k8s_v1_deployment_config_list.py rename to library/openshift_v1_deployment_config_list.py index c2d72d67..1cfa2076 100644 --- a/library/k8s_v1_deployment_config_list.py +++ b/library/openshift_v1_deployment_config_list.py @@ -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_list -short_description: Kubernetes DeploymentConfigList +module: openshift_v1_deployment_config_list +short_description: OpenShift DeploymentConfigList description: - Retrieve a list of deployment_configs. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent version @@ -1950,82 +1950,6 @@ deployment_config_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 @@ -2446,4 +2370,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_deployment_config_rollback.py b/library/openshift_v1_deployment_config_rollback.py similarity index 97% rename from library/k8s_v1_deployment_config_rollback.py rename to library/openshift_v1_deployment_config_rollback.py index 8ef201ee..e2d3d410 100644 --- a/library/k8s_v1_deployment_config_rollback.py +++ b/library/openshift_v1_deployment_config_rollback.py @@ -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_rollback -short_description: Kubernetes DeploymentConfigRollback +module: openshift_v1_deployment_config_rollback +short_description: OpenShift DeploymentConfigRollback description: - Manage the lifecycle of a deployment_config_rollback object. Supports check mode, and attempts to to be idempotent. @@ -260,4 +260,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_egress_network_policy.py b/library/openshift_v1_egress_network_policy.py similarity index 98% rename from library/k8s_v1_egress_network_policy.py rename to library/openshift_v1_egress_network_policy.py index 8fc27e1e..fa31ee21 100644 --- a/library/k8s_v1_egress_network_policy.py +++ b/library/openshift_v1_egress_network_policy.py @@ -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_egress_network_policy -short_description: Kubernetes EgressNetworkPolicy +module: openshift_v1_egress_network_policy +short_description: OpenShift EgressNetworkPolicy description: - Manage the lifecycle of a egress_network_policy object. Supports check mode, and attempts to to be idempotent. @@ -332,4 +332,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_egress_network_policy_list.py b/library/openshift_v1_egress_network_policy_list.py similarity index 98% rename from library/k8s_v1_egress_network_policy_list.py rename to library/openshift_v1_egress_network_policy_list.py index 66d00d8f..0d6ed8a8 100644 --- a/library/k8s_v1_egress_network_policy_list.py +++ b/library/openshift_v1_egress_network_policy_list.py @@ -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_egress_network_policy_list -short_description: Kubernetes EgressNetworkPolicyList +module: openshift_v1_egress_network_policy_list +short_description: OpenShift EgressNetworkPolicyList description: - Retrieve a list of egress_network_policys. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent @@ -348,4 +348,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_group.py b/library/openshift_v1_group.py similarity index 98% rename from library/k8s_v1_group.py rename to library/openshift_v1_group.py index aaa20520..bf53fc2f 100644 --- a/library/k8s_v1_group.py +++ b/library/openshift_v1_group.py @@ -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_group -short_description: Kubernetes Group +module: openshift_v1_group +short_description: OpenShift Group description: - Manage the lifecycle of a group object. Supports check mode, and attempts to to be idempotent. @@ -312,4 +312,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_group_list.py b/library/openshift_v1_group_list.py similarity index 98% rename from library/k8s_v1_group_list.py rename to library/openshift_v1_group_list.py index 5e304dde..5ff7c0e3 100644 --- a/library/k8s_v1_group_list.py +++ b/library/openshift_v1_group_list.py @@ -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_group_list -short_description: Kubernetes GroupList +module: openshift_v1_group_list +short_description: OpenShift GroupList description: - Retrieve a list of groups. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent version of the listed @@ -330,4 +330,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_host_subnet.py b/library/openshift_v1_host_subnet.py similarity index 96% rename from library/k8s_v1_host_subnet.py rename to library/openshift_v1_host_subnet.py index 8194c3cf..5c564a46 100644 --- a/library/k8s_v1_host_subnet.py +++ b/library/openshift_v1_host_subnet.py @@ -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_host_subnet -short_description: Kubernetes HostSubnet +module: openshift_v1_host_subnet +short_description: OpenShift HostSubnet description: - Manage the lifecycle of a host_subnet object. Supports check mode, and attempts to to be idempotent. @@ -40,8 +40,8 @@ options: type: bool host: description: - - Host is the name of the node. (This is redundant with the object's name, and - this field is not actually used any more.) + - Host is the name of the node. (This is the same as the object's name, but both + fields must be set.) host_ip: description: - HostIP is the IP address to be used as a VTEP by other nodes in the overlay @@ -138,8 +138,8 @@ host_subnet: type: str host: description: - - Host is the name of the node. (This is redundant with the object's name, and - this field is not actually used any more.) + - Host is the name of the node. (This is the same as the object's name, but + both fields must be set.) type: str host_ip: description: @@ -327,4 +327,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_host_subnet_list.py b/library/openshift_v1_host_subnet_list.py similarity index 97% rename from library/k8s_v1_host_subnet_list.py rename to library/openshift_v1_host_subnet_list.py index 2057659b..10785275 100644 --- a/library/k8s_v1_host_subnet_list.py +++ b/library/openshift_v1_host_subnet_list.py @@ -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_host_subnet_list -short_description: Kubernetes HostSubnetList +module: openshift_v1_host_subnet_list +short_description: OpenShift HostSubnetList description: - Retrieve a list of host_subnets. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent version @@ -122,8 +122,8 @@ host_subnet_list: type: str host: description: - - Host is the name of the node. (This is redundant with the object's name, - and this field is not actually used any more.) + - Host is the name of the node. (This is the same as the object's name, + but both fields must be set.) type: str host_ip: description: @@ -340,4 +340,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_identity.py b/library/openshift_v1_identity.py similarity index 99% rename from library/k8s_v1_identity.py rename to library/openshift_v1_identity.py index 83db6099..4bf97376 100644 --- a/library/k8s_v1_identity.py +++ b/library/openshift_v1_identity.py @@ -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_identity -short_description: Kubernetes Identity +module: openshift_v1_identity +short_description: OpenShift Identity description: - Manage the lifecycle of a identity object. Supports check mode, and attempts to to be idempotent. @@ -408,4 +408,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_identity_list.py b/library/openshift_v1_identity_list.py similarity index 98% rename from library/k8s_v1_identity_list.py rename to library/openshift_v1_identity_list.py index ba4b691e..1f5a7e71 100644 --- a/library/k8s_v1_identity_list.py +++ b/library/openshift_v1_identity_list.py @@ -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_identity_list -short_description: Kubernetes IdentityList +module: openshift_v1_identity_list +short_description: OpenShift IdentityList description: - Retrieve a list of identitys. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent version of the listed @@ -381,4 +381,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_image.py b/library/openshift_v1_image.py similarity index 99% rename from library/k8s_v1_image.py rename to library/openshift_v1_image.py index bf46f00a..00d49ca1 100644 --- a/library/k8s_v1_image.py +++ b/library/openshift_v1_image.py @@ -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_image -short_description: Kubernetes Image +module: openshift_v1_image +short_description: OpenShift Image description: - Manage the lifecycle of a image object. Supports check mode, and attempts to to be idempotent. @@ -661,4 +661,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_image_list.py b/library/openshift_v1_image_list.py similarity index 99% rename from library/k8s_v1_image_list.py rename to library/openshift_v1_image_list.py index cacf3c17..996a435a 100644 --- a/library/k8s_v1_image_list.py +++ b/library/openshift_v1_image_list.py @@ -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_image_list -short_description: Kubernetes ImageList +module: openshift_v1_image_list +short_description: OpenShift ImageList description: - Retrieve a list of images. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent version of the listed @@ -649,4 +649,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_image_signature.py b/library/openshift_v1_image_signature.py similarity index 98% rename from library/k8s_v1_image_signature.py rename to library/openshift_v1_image_signature.py index ab40c94c..59462cb9 100644 --- a/library/k8s_v1_image_signature.py +++ b/library/openshift_v1_image_signature.py @@ -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_image_signature -short_description: Kubernetes ImageSignature +module: openshift_v1_image_signature +short_description: OpenShift ImageSignature description: - Manage the lifecycle of a image_signature object. Supports check mode, and attempts to to be idempotent. @@ -438,4 +438,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_image_stream.py b/library/openshift_v1_image_stream.py similarity index 99% rename from library/k8s_v1_image_stream.py rename to library/openshift_v1_image_stream.py index af066fb8..8fa8096d 100644 --- a/library/k8s_v1_image_stream.py +++ b/library/openshift_v1_image_stream.py @@ -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_image_stream -short_description: Kubernetes ImageStream +module: openshift_v1_image_stream +short_description: OpenShift ImageStream description: - Manage the lifecycle of a image_stream object. Supports check mode, and attempts to to be idempotent. @@ -509,4 +509,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_image_stream_image.py b/library/openshift_v1_image_stream_image.py similarity index 99% rename from library/k8s_v1_image_stream_image.py rename to library/openshift_v1_image_stream_image.py index 1d93b0f5..1964baa8 100644 --- a/library/k8s_v1_image_stream_image.py +++ b/library/openshift_v1_image_stream_image.py @@ -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_image_stream_image -short_description: Kubernetes ImageStreamImage +module: openshift_v1_image_stream_image +short_description: OpenShift ImageStreamImage description: - Manage the lifecycle of a image_stream_image object. Supports check mode, and attempts to to be idempotent. @@ -869,4 +869,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_image_stream_import.py b/library/openshift_v1_image_stream_import.py similarity index 96% rename from library/k8s_v1_image_stream_import.py rename to library/openshift_v1_image_stream_import.py index 5b25bb80..1c7d0606 100644 --- a/library/k8s_v1_image_stream_import.py +++ b/library/openshift_v1_image_stream_import.py @@ -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_image_stream_import -short_description: Kubernetes ImageStreamImport +module: openshift_v1_image_stream_import +short_description: OpenShift ImageStreamImport description: - Manage the lifecycle of a image_stream_import object. Supports check mode, and attempts to to be idempotent. @@ -146,6 +146,20 @@ options: aliases: - repository_include_manifest type: bool + spec_repository_reference_policy_type: + description: + - Type determines how the image pull spec should be transformed when the image + stream tag is used in deployment config triggers or new builds. The default + value is `Source`, indicating the original location of the image should be used + (if imported). The user may also specify `Local`, indicating that the pull spec + should point to the integrated Docker registry and leverage the registry's ability + to proxy the pull to an upstream registry. `Local` allows the credentials used + to pull this image to be managed from the image stream's namespace, so others + on the platform can access a remote image but have no access to the remote secret. + It also allows the image layers to be mirrored into the local registry which + the images can still be pulled even if the upstream registry is unavailable. + aliases: + - repository_reference_policy_type ssl_ca_cert: description: - Path to a CA certificate used to authenticate with the API. @@ -414,6 +428,27 @@ image_stream_import: - IncludeManifest determines if the manifest for each image is returned in the response type: bool + reference_policy: + description: + - ReferencePolicy defines how other components should consume the image + type: complex + contains: + type: + description: + - Type determines how the image pull spec should be transformed + when the image stream tag is used in deployment config triggers + or new builds. The default value is `Source`, indicating the original + location of the image should be used (if imported). The user may + also specify `Local`, indicating that the pull spec should point + to the integrated Docker registry and leverage the registry's + ability to proxy the pull to an upstream registry. `Local` allows + the credentials used to pull this image to be managed from the + image stream's namespace, so others on the platform can access + a remote image but have no access to the remote secret. It also + allows the image layers to be mirrored into the local registry + which the images can still be pulled even if the upstream registry + is unavailable. + type: str to: description: - To is a tag in the current image stream to assign the imported image @@ -494,6 +529,27 @@ image_stream_import: - IncludeManifest determines if the manifest for each image is returned in the response type: bool + reference_policy: + description: + - ReferencePolicy defines how other components should consume the image + type: complex + contains: + type: + description: + - Type determines how the image pull spec should be transformed + when the image stream tag is used in deployment config triggers + or new builds. The default value is `Source`, indicating the original + location of the image should be used (if imported). The user may + also specify `Local`, indicating that the pull spec should point + to the integrated Docker registry and leverage the registry's + ability to proxy the pull to an upstream registry. `Local` allows + the credentials used to pull this image to be managed from the + image stream's namespace, so others on the platform can access + a remote image but have no access to the remote secret. It also + allows the image layers to be mirrored into the local registry + which the images can still be pulled even if the upstream registry + is unavailable. + type: str status: description: - Status is the the result of importing the image @@ -2332,4 +2388,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_image_stream_list.py b/library/openshift_v1_image_stream_list.py similarity index 99% rename from library/k8s_v1_image_stream_list.py rename to library/openshift_v1_image_stream_list.py index 0268c930..a60b148e 100644 --- a/library/k8s_v1_image_stream_list.py +++ b/library/openshift_v1_image_stream_list.py @@ -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_image_stream_list -short_description: Kubernetes ImageStreamList +module: openshift_v1_image_stream_list +short_description: OpenShift ImageStreamList description: - Retrieve a list of image_streams. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent version @@ -523,4 +523,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_image_stream_mapping.py b/library/openshift_v1_image_stream_mapping.py similarity index 99% rename from library/k8s_v1_image_stream_mapping.py rename to library/openshift_v1_image_stream_mapping.py index e34d8c4e..2ff60c36 100644 --- a/library/k8s_v1_image_stream_mapping.py +++ b/library/openshift_v1_image_stream_mapping.py @@ -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_image_stream_mapping -short_description: Kubernetes ImageStreamMapping +module: openshift_v1_image_stream_mapping +short_description: OpenShift ImageStreamMapping description: - Manage the lifecycle of a image_stream_mapping object. Supports check mode, and attempts to to be idempotent. @@ -876,4 +876,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_image_stream_tag.py b/library/openshift_v1_image_stream_tag.py similarity index 99% rename from library/k8s_v1_image_stream_tag.py rename to library/openshift_v1_image_stream_tag.py index f1dac0f6..34df319e 100644 --- a/library/k8s_v1_image_stream_tag.py +++ b/library/openshift_v1_image_stream_tag.py @@ -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_image_stream_tag -short_description: Kubernetes ImageStreamTag +module: openshift_v1_image_stream_tag +short_description: OpenShift ImageStreamTag description: - Manage the lifecycle of a image_stream_tag object. Supports check mode, and attempts to to be idempotent. @@ -1142,4 +1142,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_image_stream_tag_list.py b/library/openshift_v1_image_stream_tag_list.py similarity index 99% rename from library/k8s_v1_image_stream_tag_list.py rename to library/openshift_v1_image_stream_tag_list.py index 63edef57..b00db9c8 100644 --- a/library/k8s_v1_image_stream_tag_list.py +++ b/library/openshift_v1_image_stream_tag_list.py @@ -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_image_stream_tag_list -short_description: Kubernetes ImageStreamTagList +module: openshift_v1_image_stream_tag_list +short_description: OpenShift ImageStreamTagList description: - Retrieve a list of image_stream_tags. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent version @@ -984,4 +984,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_net_namespace.py b/library/openshift_v1_net_namespace.py similarity index 98% rename from library/k8s_v1_net_namespace.py rename to library/openshift_v1_net_namespace.py index 396f1a2f..cb531612 100644 --- a/library/k8s_v1_net_namespace.py +++ b/library/openshift_v1_net_namespace.py @@ -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_net_namespace -short_description: Kubernetes NetNamespace +module: openshift_v1_net_namespace +short_description: OpenShift NetNamespace description: - Manage the lifecycle of a net_namespace object. Supports check mode, and attempts to to be idempotent. @@ -323,4 +323,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_net_namespace_list.py b/library/openshift_v1_net_namespace_list.py similarity index 98% rename from library/k8s_v1_net_namespace_list.py rename to library/openshift_v1_net_namespace_list.py index a55aedcd..a6b6febd 100644 --- a/library/k8s_v1_net_namespace_list.py +++ b/library/openshift_v1_net_namespace_list.py @@ -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_net_namespace_list -short_description: Kubernetes NetNamespaceList +module: openshift_v1_net_namespace_list +short_description: OpenShift NetNamespaceList description: - Retrieve a list of net_namespaces. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent version @@ -336,4 +336,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_o_auth_access_token.py b/library/openshift_v1_o_auth_access_token.py similarity index 98% rename from library/k8s_v1_o_auth_access_token.py rename to library/openshift_v1_o_auth_access_token.py index 0f2f94c4..05deb2a8 100644 --- a/library/k8s_v1_o_auth_access_token.py +++ b/library/openshift_v1_o_auth_access_token.py @@ -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_o_auth_access_token -short_description: Kubernetes OAuthAccessToken +module: openshift_v1_o_auth_access_token +short_description: OpenShift OAuthAccessToken description: - Manage the lifecycle of a o_auth_access_token object. Supports check mode, and attempts to to be idempotent. @@ -362,4 +362,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_o_auth_access_token_list.py b/library/openshift_v1_o_auth_access_token_list.py similarity index 98% rename from library/k8s_v1_o_auth_access_token_list.py rename to library/openshift_v1_o_auth_access_token_list.py index 09080a50..82dd9c2e 100644 --- a/library/k8s_v1_o_auth_access_token_list.py +++ b/library/openshift_v1_o_auth_access_token_list.py @@ -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_o_auth_access_token_list -short_description: Kubernetes OAuthAccessTokenList +module: openshift_v1_o_auth_access_token_list +short_description: OpenShift OAuthAccessTokenList description: - Retrieve a list of o_auth_access_tokens. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent @@ -358,4 +358,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_o_auth_authorize_token.py b/library/openshift_v1_o_auth_authorize_token.py similarity index 98% rename from library/k8s_v1_o_auth_authorize_token.py rename to library/openshift_v1_o_auth_authorize_token.py index 2b04b96c..50560dd5 100644 --- a/library/k8s_v1_o_auth_authorize_token.py +++ b/library/openshift_v1_o_auth_authorize_token.py @@ -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_o_auth_authorize_token -short_description: Kubernetes OAuthAuthorizeToken +module: openshift_v1_o_auth_authorize_token +short_description: OpenShift OAuthAuthorizeToken description: - Manage the lifecycle of a o_auth_authorize_token object. Supports check mode, and attempts to to be idempotent. @@ -361,4 +361,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_o_auth_authorize_token_list.py b/library/openshift_v1_o_auth_authorize_token_list.py similarity index 98% rename from library/k8s_v1_o_auth_authorize_token_list.py rename to library/openshift_v1_o_auth_authorize_token_list.py index 9b539c5d..da7db244 100644 --- a/library/k8s_v1_o_auth_authorize_token_list.py +++ b/library/openshift_v1_o_auth_authorize_token_list.py @@ -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_o_auth_authorize_token_list -short_description: Kubernetes OAuthAuthorizeTokenList +module: openshift_v1_o_auth_authorize_token_list +short_description: OpenShift OAuthAuthorizeTokenList description: - Retrieve a list of o_auth_authorize_tokens. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent @@ -365,4 +365,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_o_auth_client.py b/library/openshift_v1_o_auth_client.py similarity index 98% rename from library/k8s_v1_o_auth_client.py rename to library/openshift_v1_o_auth_client.py index f92180d6..5a0a2a77 100644 --- a/library/k8s_v1_o_auth_client.py +++ b/library/openshift_v1_o_auth_client.py @@ -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_o_auth_client -short_description: Kubernetes OAuthClient +module: openshift_v1_o_auth_client +short_description: OpenShift OAuthClient description: - Manage the lifecycle of a o_auth_client object. Supports check mode, and attempts to to be idempotent. @@ -397,4 +397,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_o_auth_client_authorization.py b/library/openshift_v1_o_auth_client_authorization.py similarity index 98% rename from library/k8s_v1_o_auth_client_authorization.py rename to library/openshift_v1_o_auth_client_authorization.py index 770fcd6a..668b6895 100644 --- a/library/k8s_v1_o_auth_client_authorization.py +++ b/library/openshift_v1_o_auth_client_authorization.py @@ -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_o_auth_client_authorization -short_description: Kubernetes OAuthClientAuthorization +module: openshift_v1_o_auth_client_authorization +short_description: OpenShift OAuthClientAuthorization description: - Manage the lifecycle of a o_auth_client_authorization object. Supports check mode, and attempts to to be idempotent. @@ -335,4 +335,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_o_auth_client_authorization_list.py b/library/openshift_v1_o_auth_client_authorization_list.py similarity index 98% rename from library/k8s_v1_o_auth_client_authorization_list.py rename to library/openshift_v1_o_auth_client_authorization_list.py index d7e2dda6..edd0a183 100644 --- a/library/k8s_v1_o_auth_client_authorization_list.py +++ b/library/openshift_v1_o_auth_client_authorization_list.py @@ -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_o_auth_client_authorization_list -short_description: Kubernetes OAuthClientAuthorizationList +module: openshift_v1_o_auth_client_authorization_list +short_description: OpenShift OAuthClientAuthorizationList description: - Retrieve a list of o_auth_client_authorizations. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent @@ -343,4 +343,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_o_auth_client_list.py b/library/openshift_v1_o_auth_client_list.py similarity index 98% rename from library/k8s_v1_o_auth_client_list.py rename to library/openshift_v1_o_auth_client_list.py index b2d063ec..6e7dd9d0 100644 --- a/library/k8s_v1_o_auth_client_list.py +++ b/library/openshift_v1_o_auth_client_list.py @@ -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_o_auth_client_list -short_description: Kubernetes OAuthClientList +module: openshift_v1_o_auth_client_list +short_description: OpenShift OAuthClientList description: - Retrieve a list of o_auth_clients. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent version @@ -390,4 +390,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_pod_security_policy_review.py b/library/openshift_v1_pod_security_policy_review.py similarity index 95% rename from library/k8s_v1_pod_security_policy_review.py rename to library/openshift_v1_pod_security_policy_review.py index 14b2c07e..cf113365 100644 --- a/library/k8s_v1_pod_security_policy_review.py +++ b/library/openshift_v1_pod_security_policy_review.py @@ -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_pod_security_policy_review -short_description: Kubernetes PodSecurityPolicyReview +module: openshift_v1_pod_security_policy_review +short_description: OpenShift PodSecurityPolicyReview description: - Manage the lifecycle of a pod_security_policy_review object. Supports check mode, and attempts to to be idempotent. @@ -1840,80 +1840,6 @@ pod_security_policy_review: 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. @@ -3751,82 +3677,6 @@ pod_security_policy_review: 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 @@ -4053,4 +3903,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_pod_security_policy_self_subject_review.py b/library/openshift_v1_pod_security_policy_self_subject_review.py similarity index 95% rename from library/k8s_v1_pod_security_policy_self_subject_review.py rename to library/openshift_v1_pod_security_policy_self_subject_review.py index b094df75..a350fd7d 100644 --- a/library/k8s_v1_pod_security_policy_self_subject_review.py +++ b/library/openshift_v1_pod_security_policy_self_subject_review.py @@ -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_pod_security_policy_self_subject_review -short_description: Kubernetes PodSecurityPolicySelfSubjectReview +module: openshift_v1_pod_security_policy_self_subject_review +short_description: OpenShift PodSecurityPolicySelfSubjectReview description: - Manage the lifecycle of a pod_security_policy_self_subject_review object. Supports check mode, and attempts to to be idempotent. @@ -1819,80 +1819,6 @@ pod_security_policy_self_subject_review: 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. @@ -3682,80 +3608,6 @@ pod_security_policy_self_subject_review: 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. @@ -3976,4 +3828,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_pod_security_policy_subject_review.py b/library/openshift_v1_pod_security_policy_subject_review.py similarity index 95% rename from library/k8s_v1_pod_security_policy_subject_review.py rename to library/openshift_v1_pod_security_policy_subject_review.py index 7f3b585d..188aa7d0 100644 --- a/library/k8s_v1_pod_security_policy_subject_review.py +++ b/library/openshift_v1_pod_security_policy_subject_review.py @@ -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_pod_security_policy_subject_review -short_description: Kubernetes PodSecurityPolicySubjectReview +module: openshift_v1_pod_security_policy_subject_review +short_description: OpenShift PodSecurityPolicySubjectReview description: - Manage the lifecycle of a pod_security_policy_subject_review object. Supports check mode, and attempts to to be idempotent. @@ -1839,80 +1839,6 @@ pod_security_policy_subject_review: 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. @@ -3709,80 +3635,6 @@ pod_security_policy_subject_review: 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. @@ -4003,4 +3855,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_policy.py b/library/openshift_v1_policy.py similarity index 99% rename from library/k8s_v1_policy.py rename to library/openshift_v1_policy.py index 92491912..db541791 100644 --- a/library/k8s_v1_policy.py +++ b/library/openshift_v1_policy.py @@ -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_policy -short_description: Kubernetes Policy +module: openshift_v1_policy +short_description: OpenShift Policy description: - Manage the lifecycle of a policy object. Supports check mode, and attempts to to be idempotent. @@ -554,4 +554,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_policy_binding.py b/library/openshift_v1_policy_binding.py similarity index 99% rename from library/k8s_v1_policy_binding.py rename to library/openshift_v1_policy_binding.py index 64fafd1e..2830e299 100644 --- a/library/k8s_v1_policy_binding.py +++ b/library/openshift_v1_policy_binding.py @@ -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_policy_binding -short_description: Kubernetes PolicyBinding +module: openshift_v1_policy_binding +short_description: OpenShift PolicyBinding description: - Manage the lifecycle of a policy_binding object. Supports check mode, and attempts to to be idempotent. @@ -690,4 +690,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_policy_binding_list.py b/library/openshift_v1_policy_binding_list.py similarity index 99% rename from library/k8s_v1_policy_binding_list.py rename to library/openshift_v1_policy_binding_list.py index bd019db5..bd57d659 100644 --- a/library/k8s_v1_policy_binding_list.py +++ b/library/openshift_v1_policy_binding_list.py @@ -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_policy_binding_list -short_description: Kubernetes PolicyBindingList +module: openshift_v1_policy_binding_list +short_description: OpenShift PolicyBindingList description: - Retrieve a list of policy_bindings. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent version @@ -678,4 +678,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_policy_list.py b/library/openshift_v1_policy_list.py similarity index 99% rename from library/k8s_v1_policy_list.py rename to library/openshift_v1_policy_list.py index e73935c2..ea621f3b 100644 --- a/library/k8s_v1_policy_list.py +++ b/library/openshift_v1_policy_list.py @@ -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_policy_list -short_description: Kubernetes PolicyList +module: openshift_v1_policy_list +short_description: OpenShift PolicyList description: - Retrieve a list of policys. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent version of the listed @@ -580,4 +580,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_project.py b/library/openshift_v1_project.py similarity index 98% rename from library/k8s_v1_project.py rename to library/openshift_v1_project.py index c1de7c6f..0886dce9 100644 --- a/library/k8s_v1_project.py +++ b/library/openshift_v1_project.py @@ -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_project -short_description: Kubernetes Project +module: openshift_v1_project +short_description: OpenShift Project description: - Manage the lifecycle of a project object. Supports check mode, and attempts to to be idempotent. @@ -125,12 +125,12 @@ requirements: EXAMPLES = ''' - name: Create project - k8s_v1_project: + openshift_v1_project.yml: name: example state: present - name: Remove project - k8s_v1_project: + openshift_v1_project.yml: name: example state: absent ''' @@ -345,4 +345,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_project_list.py b/library/openshift_v1_project_list.py similarity index 98% rename from library/k8s_v1_project_list.py rename to library/openshift_v1_project_list.py index 09eb0231..0c3a3407 100644 --- a/library/k8s_v1_project_list.py +++ b/library/openshift_v1_project_list.py @@ -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_project_list -short_description: Kubernetes ProjectList +module: openshift_v1_project_list +short_description: OpenShift ProjectList description: - Retrieve a list of projects. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent version of the listed @@ -345,4 +345,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_role.py b/library/openshift_v1_role.py similarity index 98% rename from library/k8s_v1_role.py rename to library/openshift_v1_role.py index 466b35c5..557565f4 100644 --- a/library/k8s_v1_role.py +++ b/library/openshift_v1_role.py @@ -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_role -short_description: Kubernetes Role +module: openshift_v1_role +short_description: OpenShift Role description: - Manage the lifecycle of a role object. Supports check mode, and attempts to to be idempotent. @@ -358,4 +358,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_role_binding.py b/library/openshift_v1_role_binding.py similarity index 99% rename from library/k8s_v1_role_binding.py rename to library/openshift_v1_role_binding.py index cc77fdf3..051462af 100644 --- a/library/k8s_v1_role_binding.py +++ b/library/openshift_v1_role_binding.py @@ -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_role_binding -short_description: Kubernetes RoleBinding +module: openshift_v1_role_binding +short_description: OpenShift RoleBinding description: - Manage the lifecycle of a role_binding object. Supports check mode, and attempts to to be idempotent. @@ -466,4 +466,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_role_binding_list.py b/library/openshift_v1_role_binding_list.py similarity index 99% rename from library/k8s_v1_role_binding_list.py rename to library/openshift_v1_role_binding_list.py index f34ed6c5..a137bec3 100644 --- a/library/k8s_v1_role_binding_list.py +++ b/library/openshift_v1_role_binding_list.py @@ -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_role_binding_list -short_description: Kubernetes RoleBindingList +module: openshift_v1_role_binding_list +short_description: OpenShift 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 @@ -429,4 +429,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_role_binding_restriction.py b/library/openshift_v1_role_binding_restriction.py similarity index 99% rename from library/k8s_v1_role_binding_restriction.py rename to library/openshift_v1_role_binding_restriction.py index d3f5939b..8e267160 100644 --- a/library/k8s_v1_role_binding_restriction.py +++ b/library/openshift_v1_role_binding_restriction.py @@ -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_role_binding_restriction -short_description: Kubernetes RoleBindingRestriction +module: openshift_v1_role_binding_restriction +short_description: OpenShift RoleBindingRestriction description: - Manage the lifecycle of a role_binding_restriction object. Supports check mode, and attempts to to be idempotent. @@ -477,4 +477,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_role_binding_restriction_list.py b/library/openshift_v1_role_binding_restriction_list.py similarity index 99% rename from library/k8s_v1_role_binding_restriction_list.py rename to library/openshift_v1_role_binding_restriction_list.py index 33e579da..e3587408 100644 --- a/library/k8s_v1_role_binding_restriction_list.py +++ b/library/openshift_v1_role_binding_restriction_list.py @@ -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_role_binding_restriction_list -short_description: Kubernetes RoleBindingRestrictionList +module: openshift_v1_role_binding_restriction_list +short_description: OpenShift RoleBindingRestrictionList description: - Retrieve a list of role_binding_restrictions. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent @@ -458,4 +458,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_role_list.py b/library/openshift_v1_role_list.py similarity index 98% rename from library/k8s_v1_role_list.py rename to library/openshift_v1_role_list.py index d99233f9..758f2c73 100644 --- a/library/k8s_v1_role_list.py +++ b/library/openshift_v1_role_list.py @@ -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_role_list -short_description: Kubernetes RoleList +module: openshift_v1_role_list +short_description: OpenShift 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 @@ -377,4 +377,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_route.py b/library/openshift_v1_route.py similarity index 98% rename from library/k8s_v1_route.py rename to library/openshift_v1_route.py index 7cadef40..26887b41 100644 --- a/library/k8s_v1_route.py +++ b/library/openshift_v1_route.py @@ -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_route -short_description: Kubernetes Route +module: openshift_v1_route +short_description: OpenShift Route description: - Manage the lifecycle of a route object. Supports check mode, and attempts to to be idempotent. @@ -200,7 +200,7 @@ requirements: EXAMPLES = ''' - name: Create route - k8s_v1_route: + openshift_v1_route.yml: name: myroute namespace: k8s-project state: present @@ -222,7 +222,7 @@ EXAMPLES = ''' -----END CERTIFICATE----- - name: Patch route - k8s_v1_route: + openshift_v1_route.yml: name: myroute namespace: k8s-project state: present @@ -236,7 +236,7 @@ EXAMPLES = ''' -----END CERTIFICATE----- - name: Replace route - k8s_v1_route: + openshift_v1_route.yml: name: myroute namespace: k8s-project state: replaced @@ -259,7 +259,7 @@ EXAMPLES = ''' -----END CERTIFICATE----- - name: Remove route - k8s_v1_route: + openshift_v1_route.yml: name: myroute namespace: k8s-project state: absent @@ -633,4 +633,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_route_list.py b/library/openshift_v1_route_list.py similarity index 99% rename from library/k8s_v1_route_list.py rename to library/openshift_v1_route_list.py index 2f2de016..4f7ba813 100644 --- a/library/k8s_v1_route_list.py +++ b/library/openshift_v1_route_list.py @@ -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_route_list -short_description: Kubernetes RouteList +module: openshift_v1_route_list +short_description: OpenShift RouteList description: - Retrieve a list of routes. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent version of the listed @@ -505,4 +505,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_security_context_constraints.py b/library/openshift_v1_security_context_constraints.py similarity index 94% rename from library/k8s_v1_security_context_constraints.py rename to library/openshift_v1_security_context_constraints.py index 0c7e4f9f..0bfbcec2 100644 --- a/library/k8s_v1_security_context_constraints.py +++ b/library/openshift_v1_security_context_constraints.py @@ -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_security_context_constraints -short_description: Kubernetes SecurityContextConstraints +module: openshift_v1_security_context_constraints +short_description: OpenShift SecurityContextConstraints description: - Manage the lifecycle of a security_context_constraints object. Supports check mode, and attempts to to be idempotent. @@ -43,6 +43,7 @@ options: - AllowedCapabilities is a list of capabilities that can be requested to add to the container. Capabilities in this field maybe added at the pod author's discretion. You must not list a capability in both AllowedCapabilities and RequiredDropCapabilities. + To allow all capabilities you may use '*'. type: list annotations: description: @@ -146,11 +147,6 @@ options: - RequiredDropCapabilities are the capabilities that will be dropped from the container. These are required to be dropped and cannot be added. type: list - resource_definition: - description: - - Provide the YAML definition for the object, bypassing any modules parameters - intended to define object attributes. - type: dict run_as_user_type: description: - Type is the strategy that will dictate what RunAsUser is used in the SecurityContext. @@ -208,29 +204,10 @@ options: profiles. When used to generate a value for a pod the first non-wildcard profile will be used as the default. 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 supplemental_groups_ranges: description: - Ranges are the allowed ranges of supplemental groups. If you would like to force @@ -275,7 +252,7 @@ api_version: description: Requested API version security_context_constraints: type: complex - returned: when I(state) = C(present) + returned: on success contains: allow_host_dir_volume_plugin: description: @@ -309,7 +286,7 @@ security_context_constraints: - AllowedCapabilities is a list of capabilities that can be requested to add to the container. Capabilities in this field maybe added at the pod author's discretion. You must not list a capability in both AllowedCapabilities and - RequiredDropCapabilities. + RequiredDropCapabilities. To allow all capabilities you may use '*'. type: list contains: str api_version: @@ -652,4 +629,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_security_context_constraints_list.py b/library/openshift_v1_security_context_constraints_list.py similarity index 93% rename from library/k8s_v1_security_context_constraints_list.py rename to library/openshift_v1_security_context_constraints_list.py index 2a493589..c44ccdef 100644 --- a/library/k8s_v1_security_context_constraints_list.py +++ b/library/openshift_v1_security_context_constraints_list.py @@ -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_security_context_constraints_list -short_description: Kubernetes SecurityContextConstraintsList +module: openshift_v1_security_context_constraints_list +short_description: OpenShift SecurityContextConstraintsList description: - Retrieve a list of security_context_constraints. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent @@ -53,34 +53,10 @@ options: 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. @@ -101,7 +77,7 @@ api_version: description: Requested API version security_context_constraints_list: type: complex - returned: when I(state) = C(present) + returned: on success contains: api_version: description: @@ -146,7 +122,7 @@ security_context_constraints_list: - AllowedCapabilities is a list of capabilities that can be requested to add to the container. Capabilities in this field maybe added at the pod author's discretion. You must not list a capability in both AllowedCapabilities - and RequiredDropCapabilities. + and RequiredDropCapabilities. To allow all capabilities you may use '*'. type: list contains: str api_version: @@ -524,4 +500,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_self_subject_rules_review.py b/library/openshift_v1_self_subject_rules_review.py similarity index 97% rename from library/k8s_v1_self_subject_rules_review.py rename to library/openshift_v1_self_subject_rules_review.py index 02b34bde..15937e11 100644 --- a/library/k8s_v1_self_subject_rules_review.py +++ b/library/openshift_v1_self_subject_rules_review.py @@ -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_self_subject_rules_review -short_description: Kubernetes SelfSubjectRulesReview +module: openshift_v1_self_subject_rules_review +short_description: OpenShift SelfSubjectRulesReview description: - Manage the lifecycle of a self_subject_rules_review object. Supports check mode, and attempts to to be idempotent. @@ -186,4 +186,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_subject_rules_review.py b/library/openshift_v1_subject_rules_review.py similarity index 97% rename from library/k8s_v1_subject_rules_review.py rename to library/openshift_v1_subject_rules_review.py index 6d116c31..83933afe 100644 --- a/library/k8s_v1_subject_rules_review.py +++ b/library/openshift_v1_subject_rules_review.py @@ -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_subject_rules_review -short_description: Kubernetes SubjectRulesReview +module: openshift_v1_subject_rules_review +short_description: OpenShift SubjectRulesReview description: - Manage the lifecycle of a subject_rules_review object. Supports check mode, and attempts to to be idempotent. @@ -208,4 +208,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_template.py b/library/openshift_v1_template.py similarity index 99% rename from library/k8s_v1_template.py rename to library/openshift_v1_template.py index da2b0013..920447b4 100644 --- a/library/k8s_v1_template.py +++ b/library/openshift_v1_template.py @@ -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_template -short_description: Kubernetes Template +module: openshift_v1_template +short_description: OpenShift Template description: - Manage the lifecycle of a template object. Supports check mode, and attempts to to be idempotent. @@ -395,4 +395,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_template_list.py b/library/openshift_v1_template_list.py similarity index 99% rename from library/k8s_v1_template_list.py rename to library/openshift_v1_template_list.py index 8644737c..8685f2d9 100644 --- a/library/k8s_v1_template_list.py +++ b/library/openshift_v1_template_list.py @@ -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_template_list -short_description: Kubernetes TemplateList +module: openshift_v1_template_list +short_description: OpenShift TemplateList description: - Retrieve a list of templates. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent version of the listed @@ -398,4 +398,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_user.py b/library/openshift_v1_user.py similarity index 98% rename from library/k8s_v1_user.py rename to library/openshift_v1_user.py index 8748bf3b..95dfdbd4 100644 --- a/library/k8s_v1_user.py +++ b/library/openshift_v1_user.py @@ -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_user -short_description: Kubernetes User +module: openshift_v1_user +short_description: OpenShift User description: - Manage the lifecycle of a user object. Supports check mode, and attempts to to be idempotent. @@ -332,4 +332,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_user_identity_mapping.py b/library/openshift_v1_user_identity_mapping.py similarity index 98% rename from library/k8s_v1_user_identity_mapping.py rename to library/openshift_v1_user_identity_mapping.py index a0580007..8b5c66bb 100644 --- a/library/k8s_v1_user_identity_mapping.py +++ b/library/openshift_v1_user_identity_mapping.py @@ -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_user_identity_mapping -short_description: Kubernetes UserIdentityMapping +module: openshift_v1_user_identity_mapping +short_description: OpenShift UserIdentityMapping description: - Manage the lifecycle of a user_identity_mapping object. Supports check mode, and attempts to to be idempotent. @@ -465,4 +465,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1_user_list.py b/library/openshift_v1_user_list.py similarity index 98% rename from library/k8s_v1_user_list.py rename to library/openshift_v1_user_list.py index 045ba991..3c090774 100644 --- a/library/k8s_v1_user_list.py +++ b/library/openshift_v1_user_list.py @@ -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_user_list -short_description: Kubernetes UserList +module: openshift_v1_user_list +short_description: OpenShift UserList description: - Retrieve a list of users. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent version of the listed @@ -341,4 +341,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1beta1_pod_security_policy.py b/library/openshift_v1beta1_pod_security_policy.py similarity index 94% rename from library/k8s_v1beta1_pod_security_policy.py rename to library/openshift_v1beta1_pod_security_policy.py index 569ed5ae..a4c29842 100644 --- a/library/k8s_v1beta1_pod_security_policy.py +++ b/library/openshift_v1beta1_pod_security_policy.py @@ -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_v1beta1_pod_security_policy -short_description: Kubernetes PodSecurityPolicy +module: openshift_v1beta1_pod_security_policy +short_description: OpenShift PodSecurityPolicy description: - Manage the lifecycle of a pod_security_policy object. Supports check mode, and attempts to to be idempotent. @@ -71,11 +71,6 @@ options: 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 spec_allowed_capabilities: description: - AllowedCapabilities is a list of capabilities that can be requested to add to @@ -210,29 +205,10 @@ options: aliases: - volumes 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. @@ -253,7 +229,7 @@ api_version: description: Requested API version pod_security_policy: type: complex - returned: when I(state) = C(present) + returned: on success contains: api_version: description: @@ -617,4 +593,3 @@ def main(): if __name__ == '__main__': main() - diff --git a/library/k8s_v1beta1_pod_security_policy_list.py b/library/openshift_v1beta1_pod_security_policy_list.py similarity index 93% rename from library/k8s_v1beta1_pod_security_policy_list.py rename to library/openshift_v1beta1_pod_security_policy_list.py index e3d608c1..c1617bcc 100644 --- a/library/k8s_v1beta1_pod_security_policy_list.py +++ b/library/openshift_v1beta1_pod_security_policy_list.py @@ -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_v1beta1_pod_security_policy_list -short_description: Kubernetes PodSecurityPolicyList +module: openshift_v1beta1_pod_security_policy_list +short_description: OpenShift PodSecurityPolicyList description: - Retrieve a list of pod_security_policys. List operations provide a snapshot read of the underlying objects, returning a resource_version representing a consistent @@ -53,34 +53,10 @@ options: 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. @@ -101,7 +77,7 @@ api_version: description: Requested API version pod_security_policy_list: type: complex - returned: when I(state) = C(present) + returned: on success contains: api_version: description: @@ -507,4 +483,3 @@ def main(): if __name__ == '__main__': main() -