Rename from community.kubernetes to kubernetes.core (#6)

* Rename from community.kubernetes to kubernetes.core

This goes through and renames community.kubernetes to kubernetes.core.
Most of this was generated from the downstream build script that was
used on the community repository, plus whatever hand edits I could find
that were needed.

The downstream build and test process has also been removed as this
repository is now the downstream repository.

* Fix CONTRIBUTING.md
This commit is contained in:
Mike Graves
2021-04-08 08:48:27 -04:00
committed by GitHub
parent a55edac38f
commit ba586a8ed8
30 changed files with 200 additions and 529 deletions

View File

@@ -140,12 +140,12 @@ options:
default: False
version_added: "1.2.0"
extends_documentation_fragment:
- community.kubernetes.helm_common_options
- kubernetes.core.helm_common_options
'''
EXAMPLES = r'''
- name: Deploy latest version of Prometheus chart inside monitoring namespace (and create it)
community.kubernetes.helm:
kubernetes.core.helm:
name: test
chart_ref: stable/prometheus
release_namespace: monitoring
@@ -153,12 +153,12 @@ EXAMPLES = r'''
# From repository
- name: Add stable chart repo
community.kubernetes.helm_repository:
kubernetes.core.helm_repository:
name: stable
repo_url: "https://kubernetes.github.io/ingress-nginx"
- name: Deploy latest version of Grafana chart inside monitoring namespace with values
community.kubernetes.helm:
kubernetes.core.helm:
name: test
chart_ref: stable/grafana
release_namespace: monitoring
@@ -166,14 +166,14 @@ EXAMPLES = r'''
replicas: 2
- name: Deploy Grafana chart on 5.0.12 with values loaded from template
community.kubernetes.helm:
kubernetes.core.helm:
name: test
chart_ref: stable/grafana
chart_version: 5.0.12
values: "{{ lookup('template', 'somefile.yaml') | from_yaml }}"
- name: Deploy Grafana chart using values files on target
community.kubernetes.helm:
kubernetes.core.helm:
name: test
chart_ref: stable/grafana
release_namespace: monitoring
@@ -181,7 +181,7 @@ EXAMPLES = r'''
- /path/to/values.yaml
- name: Remove test release and waiting suppression ending
community.kubernetes.helm:
kubernetes.core.helm:
name: test
state: absent
wait: true
@@ -193,14 +193,14 @@ EXAMPLES = r'''
dest: /tmp/helm_repo
- name: Deploy Grafana chart from local path
community.kubernetes.helm:
kubernetes.core.helm:
name: test
chart_ref: /tmp/helm_repo/stable/grafana
release_namespace: monitoring
# From url
- name: Deploy Grafana chart on 5.6.0 from url
community.kubernetes.helm:
kubernetes.core.helm:
name: test
chart_ref: "https://github.com/grafana/helm-charts/releases/download/grafana-5.6.0/grafana-5.6.0.tgz"
release_namespace: monitoring
@@ -272,7 +272,7 @@ except ImportError:
IMP_YAML = False
from ansible.module_utils.basic import AnsibleModule, missing_required_lib, env_fallback
from ansible_collections.community.kubernetes.plugins.module_utils.helm import run_helm, get_values
from ansible_collections.kubernetes.core.plugins.module_utils.helm import run_helm, get_values
def get_release(state, release_name):

View File

@@ -39,12 +39,12 @@ options:
type: str
aliases: [ namespace ]
extends_documentation_fragment:
- community.kubernetes.helm_common_options
- kubernetes.core.helm_common_options
'''
EXAMPLES = r'''
- name: Deploy latest version of Grafana chart inside monitoring namespace
community.kubernetes.helm_info:
kubernetes.core.helm_info:
name: test
release_namespace: monitoring
'''
@@ -99,7 +99,7 @@ except ImportError:
IMP_YAML = False
from ansible.module_utils.basic import AnsibleModule, missing_required_lib, env_fallback
from ansible_collections.community.kubernetes.plugins.module_utils.helm import run_helm, get_values
from ansible_collections.kubernetes.core.plugins.module_utils.helm import run_helm, get_values
# Get Release from all deployed releases

View File

@@ -47,22 +47,22 @@ options:
- Required only if C(state=present).
type: str
extends_documentation_fragment:
- community.kubernetes.helm_common_options
- kubernetes.core.helm_common_options
'''
EXAMPLES = r'''
- name: Install Helm env plugin
community.kubernetes.helm_plugin:
kubernetes.core.helm_plugin:
plugin_path: https://github.com/adamreese/helm-env
state: present
- name: Install Helm plugin from local filesystem
community.kubernetes.helm_plugin:
kubernetes.core.helm_plugin:
plugin_path: https://domain/path/to/plugin.tar.gz
state: present
- name: Remove Helm env plugin
community.kubernetes.helm_plugin:
kubernetes.core.helm_plugin:
plugin_name: env
state: absent
'''
@@ -96,7 +96,7 @@ rc:
'''
from ansible.module_utils.basic import AnsibleModule, env_fallback
from ansible_collections.community.kubernetes.plugins.module_utils.helm import run_helm
from ansible_collections.kubernetes.core.plugins.module_utils.helm import run_helm
def main():

View File

@@ -32,15 +32,15 @@ options:
- Name of Helm plugin, to gather particular plugin info.
type: str
extends_documentation_fragment:
- community.kubernetes.helm_common_options
- kubernetes.core.helm_common_options
'''
EXAMPLES = r'''
- name: Gather Helm plugin info
community.kubernetes.helm_plugin_info:
kubernetes.core.helm_plugin_info:
- name: Gather Helm env plugin info
community.kubernetes.helm_plugin_info:
kubernetes.core.helm_plugin_info:
plugin_name: env
'''
@@ -77,7 +77,7 @@ rc:
'''
from ansible.module_utils.basic import AnsibleModule, env_fallback
from ansible_collections.community.kubernetes.plugins.module_utils.helm import run_helm
from ansible_collections.kubernetes.core.plugins.module_utils.helm import run_helm
def main():

View File

@@ -68,12 +68,12 @@ options:
EXAMPLES = r'''
- name: Add a repository
community.kubernetes.helm_repository:
kubernetes.core.helm_repository:
name: stable
repo_url: https://kubernetes.github.io/ingress-nginx
- name: Add Red Hat Helm charts repository
community.kubernetes.helm_repository:
kubernetes.core.helm_repository:
name: redhat-charts
repo_url: https://redhat-developer.github.com/redhat-helm-charts
'''
@@ -121,7 +121,7 @@ except ImportError:
IMP_YAML = False
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
from ansible_collections.community.kubernetes.plugins.module_utils.helm import run_helm
from ansible_collections.kubernetes.core.plugins.module_utils.helm import run_helm
# Get repository from all repositories added

View File

@@ -83,12 +83,12 @@ options:
EXAMPLES = r'''
- name: Render templates to specified directory
community.kubernetes.helm_template:
kubernetes.core.helm_template:
chart_ref: stable/prometheus
output_dir: mycharts
- name: Render templates
community.kubernetes.helm_template:
kubernetes.core.helm_template:
chart_ref: stable/prometheus
register: result
@@ -127,7 +127,7 @@ except ImportError:
IMP_YAML = False
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
from ansible_collections.community.kubernetes.plugins.module_utils.helm import run_helm
from ansible_collections.kubernetes.core.plugins.module_utils.helm import run_helm
def template(cmd, chart_ref, chart_repo_url=None, chart_version=None, output_dir=None,

View File

@@ -24,17 +24,17 @@ description:
- Pass the object definition from a source file or inline. See examples for reading
files and using Jinja templates or vault-encrypted files.
- Access to the full range of K8s APIs.
- Use the M(community.kubernetes.k8s_info) module to obtain a list of items about an object of type C(kind)
- Use the M(kubernetes.core.k8s_info) module to obtain a list of items about an object of type C(kind)
- Authenticate using either a config file, certificates, password or token.
- Supports check mode.
extends_documentation_fragment:
- community.kubernetes.k8s_state_options
- community.kubernetes.k8s_name_options
- community.kubernetes.k8s_resource_options
- community.kubernetes.k8s_auth_options
- community.kubernetes.k8s_wait_options
- community.kubernetes.k8s_delete_options
- kubernetes.core.k8s_state_options
- kubernetes.core.k8s_name_options
- kubernetes.core.k8s_resource_options
- kubernetes.core.k8s_auth_options
- kubernetes.core.k8s_wait_options
- kubernetes.core.k8s_delete_options
notes:
- If your OpenShift Python library is not 0.9.0 or newer and you are trying to
@@ -132,14 +132,14 @@ requirements:
EXAMPLES = r'''
- name: Create a k8s namespace
community.kubernetes.k8s:
kubernetes.core.k8s:
name: testing
api_version: v1
kind: Namespace
state: present
- name: Create a Service object from an inline definition
community.kubernetes.k8s:
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
@@ -161,7 +161,7 @@ EXAMPLES = r'''
port: 8000
- name: Remove an existing Service object
community.kubernetes.k8s:
kubernetes.core.k8s:
state: absent
api_version: v1
kind: Service
@@ -171,24 +171,24 @@ EXAMPLES = r'''
# Passing the object definition from a file
- name: Create a Deployment by reading the definition from a local file
community.kubernetes.k8s:
kubernetes.core.k8s:
state: present
src: /testing/deployment.yml
- name: >-
Read definition file from the Ansible controller file system.
If the definition file has been encrypted with Ansible Vault it will automatically be decrypted.
community.kubernetes.k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('file', '/testing/deployment.yml') | from_yaml }}"
- name: Read definition template file from the Ansible controller file system
community.kubernetes.k8s:
kubernetes.core.k8s:
state: present
template: '/testing/deployment.j2'
- name: Read definition template file from the Ansible controller file system that uses custom start/end strings
community.kubernetes.k8s:
kubernetes.core.k8s:
state: present
template:
path: '/testing/deployment.j2'
@@ -196,14 +196,14 @@ EXAMPLES = r'''
variable_end_string: ']]'
- name: fail on validation errors
community.kubernetes.k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}"
validate:
fail_on_error: yes
- name: warn on validation errors, check for unexpected properties
community.kubernetes.k8s:
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', '/testing/deployment.yml') | from_yaml }}"
validate:
@@ -218,13 +218,13 @@ EXAMPLES = r'''
mode: '0664'
- name: Apply metrics-server manifest to the cluster.
community.kubernetes.k8s:
kubernetes.core.k8s:
state: present
src: ~/metrics-server.yaml
# Wait for a Deployment to pause before continuing
- name: Pause a Deployment.
community.kubernetes.k8s:
kubernetes.core.k8s:
definition:
apiVersion: apps/v1
kind: Deployment
@@ -280,8 +280,8 @@ result:
import copy
from ansible_collections.community.kubernetes.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible_collections.community.kubernetes.plugins.module_utils.args_common import (
from ansible_collections.kubernetes.core.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible_collections.kubernetes.core.plugins.module_utils.args_common import (
AUTH_ARG_SPEC, WAIT_ARG_SPEC, NAME_ARG_SPEC, COMMON_ARG_SPEC, RESOURCE_ARG_SPEC, DELETE_OPTS_ARG_SPEC)
@@ -336,7 +336,7 @@ def main():
('template', 'src'),
]
module = AnsibleModule(argument_spec=argspec(), mutually_exclusive=mutually_exclusive, supports_check_mode=True)
from ansible_collections.community.kubernetes.plugins.module_utils.common import (
from ansible_collections.kubernetes.core.plugins.module_utils.common import (
K8sAnsibleMixin, get_api_client)
k8s_ansible_mixin = K8sAnsibleMixin(module)

View File

@@ -30,7 +30,7 @@ options:
default: True
extends_documentation_fragment:
- community.kubernetes.k8s_auth_options
- kubernetes.core.k8s_auth_options
requirements:
- "python >= 2.7"
@@ -40,11 +40,11 @@ requirements:
EXAMPLES = r'''
- name: Get Cluster information
community.kubernetes.k8s_cluster_info:
kubernetes.core.k8s_cluster_info:
register: api_status
- name: Do not invalidate cache before getting information
community.kubernetes.k8s_cluster_info:
kubernetes.core.k8s_cluster_info:
invalidate_cache: False
register: api_status
'''
@@ -160,9 +160,9 @@ apis:
import copy
from ansible_collections.community.kubernetes.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible_collections.kubernetes.core.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible.module_utils.parsing.convert_bool import boolean
from ansible_collections.community.kubernetes.plugins.module_utils.args_common import (AUTH_ARG_SPEC)
from ansible_collections.kubernetes.core.plugins.module_utils.args_common import (AUTH_ARG_SPEC)
def execute_module(module, client):
@@ -211,7 +211,7 @@ def argspec():
def main():
module = AnsibleModule(argument_spec=argspec(), supports_check_mode=True)
from ansible_collections.community.kubernetes.plugins.module_utils.common import get_api_client
from ansible_collections.kubernetes.core.plugins.module_utils.common import get_api_client
execute_module(module, client=get_api_client(module=module))

View File

@@ -23,7 +23,7 @@ description:
- Use the Kubernetes Python client to execute command on K8s pods.
extends_documentation_fragment:
- community.kubernetes.k8s_auth_options
- kubernetes.core.k8s_auth_options
requirements:
- "python >= 2.7"
@@ -66,13 +66,13 @@ options:
EXAMPLES = r'''
- name: Execute a command
community.kubernetes.k8s_exec:
kubernetes.core.k8s_exec:
namespace: myproject
pod: zuul-scheduler
command: zuul-scheduler full-reconfigure
- name: Check RC status of command executed
community.kubernetes.k8s_exec:
kubernetes.core.k8s_exec:
namespace: myproject
pod: busybox-test
command: cmd_with_non_zero_exit_code
@@ -118,9 +118,9 @@ except ImportError:
# ImportError are managed by the common module already.
pass
from ansible_collections.community.kubernetes.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible_collections.kubernetes.core.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible.module_utils._text import to_native
from ansible_collections.community.kubernetes.plugins.module_utils.common import (
from ansible_collections.kubernetes.core.plugins.module_utils.common import (
AUTH_ARG_SPEC
)
@@ -192,7 +192,7 @@ def main():
argument_spec=argspec(),
supports_check_mode=True,
)
from ansible_collections.community.kubernetes.plugins.module_utils.common import (
from ansible_collections.kubernetes.core.plugins.module_utils.common import (
K8sAnsibleMixin, get_api_client)
k8s_ansible_mixin = K8sAnsibleMixin(module)

View File

@@ -44,9 +44,9 @@ options:
elements: str
extends_documentation_fragment:
- community.kubernetes.k8s_auth_options
- community.kubernetes.k8s_name_options
- community.kubernetes.k8s_wait_options
- kubernetes.core.k8s_auth_options
- kubernetes.core.k8s_name_options
- kubernetes.core.k8s_wait_options
requirements:
- "python >= 2.7"
@@ -56,7 +56,7 @@ requirements:
EXAMPLES = r'''
- name: Get an existing Service object
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api_version: v1
kind: Service
name: web
@@ -64,26 +64,26 @@ EXAMPLES = r'''
register: web_service
- name: Get a list of all service objects
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
api_version: v1
kind: Service
namespace: testing
register: service_list
- name: Get a list of all pods from any namespace
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
kind: Pod
register: pod_list
- name: Search for all Pods labelled app=web
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
kind: Pod
label_selectors:
- app = web
- tier in (dev, test)
- name: Using vars while using label_selectors
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
kind: Pod
label_selectors:
- "app = {{ app_label_web }}"
@@ -91,18 +91,18 @@ EXAMPLES = r'''
app_label_web: web
- name: Search for all running pods
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
kind: Pod
field_selectors:
- status.phase=Running
- name: List custom objects created using CRD
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
kind: MyCustomObject
api_version: "stable.example.com/v1"
- name: Wait till the Object is created
community.kubernetes.k8s_info:
kubernetes.core.k8s_info:
kind: Pod
wait: yes
name: pod-not-yet-created
@@ -148,8 +148,8 @@ resources:
import copy
from ansible_collections.community.kubernetes.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible_collections.community.kubernetes.plugins.module_utils.args_common import (AUTH_ARG_SPEC, WAIT_ARG_SPEC)
from ansible_collections.kubernetes.core.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible_collections.kubernetes.core.plugins.module_utils.args_common import (AUTH_ARG_SPEC, WAIT_ARG_SPEC)
def execute_module(module, k8s_ansible_mixin):
@@ -186,7 +186,7 @@ def argspec():
def main():
module = AnsibleModule(argument_spec=argspec(), supports_check_mode=True)
from ansible_collections.community.kubernetes.plugins.module_utils.common import (
from ansible_collections.kubernetes.core.plugins.module_utils.common import (
K8sAnsibleMixin, get_api_client)
k8s_ansible_mixin = K8sAnsibleMixin(module)

View File

@@ -25,8 +25,8 @@ description:
- Supports check mode.
- Analogous to `kubectl logs` or `oc logs`
extends_documentation_fragment:
- community.kubernetes.k8s_auth_options
- community.kubernetes.k8s_name_options
- kubernetes.core.k8s_auth_options
- kubernetes.core.k8s_name_options
options:
kind:
description:
@@ -63,14 +63,14 @@ requirements:
EXAMPLES = r'''
- name: Get a log from a Pod
community.kubernetes.k8s_log:
kubernetes.core.k8s_log:
name: example-1
namespace: testing
register: log
# This will get the log from the first Pod found matching the selector
- name: Log a Pod matching a label selector
community.kubernetes.k8s_log:
kubernetes.core.k8s_log:
namespace: testing
label_selectors:
- app=example
@@ -78,7 +78,7 @@ EXAMPLES = r'''
# This will get the log from a single Pod managed by this Deployment
- name: Get a log from a Deployment
community.kubernetes.k8s_log:
kubernetes.core.k8s_log:
api_version: apps/v1
kind: Deployment
namespace: testing
@@ -87,7 +87,7 @@ EXAMPLES = r'''
# This will get the log from a single Pod managed by this DeploymentConfig
- name: Get a log from a DeploymentConfig
community.kubernetes.k8s_log:
kubernetes.core.k8s_log:
api_version: apps.openshift.io/v1
kind: DeploymentConfig
namespace: testing
@@ -111,10 +111,10 @@ log_lines:
import copy
from ansible_collections.community.kubernetes.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible_collections.kubernetes.core.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible.module_utils.six import PY2
from ansible_collections.community.kubernetes.plugins.module_utils.args_common import (AUTH_ARG_SPEC, NAME_ARG_SPEC)
from ansible_collections.kubernetes.core.plugins.module_utils.args_common import (AUTH_ARG_SPEC, NAME_ARG_SPEC)
def argspec():
@@ -215,7 +215,7 @@ def serialize_log(response):
def main():
module = AnsibleModule(argument_spec=argspec(), supports_check_mode=True)
from ansible_collections.community.kubernetes.plugins.module_utils.common import (
from ansible_collections.kubernetes.core.plugins.module_utils.common import (
K8sAnsibleMixin, get_api_client)
k8s_ansible_mixin = K8sAnsibleMixin(module)

View File

@@ -28,8 +28,8 @@ options:
type: list
elements: str
extends_documentation_fragment:
- community.kubernetes.k8s_auth_options
- community.kubernetes.k8s_name_options
- kubernetes.core.k8s_auth_options
- kubernetes.core.k8s_name_options
requirements:
- "python >= 2.7"
- "openshift >= 0.6"
@@ -38,7 +38,7 @@ requirements:
EXAMPLES = r'''
- name: Rollback a failed deployment
community.kubernetes.k8s_rollback:
kubernetes.core.k8s_rollback:
api_version: apps/v1
kind: Deployment
name: web
@@ -78,8 +78,8 @@ rollback_info:
import copy
from ansible_collections.community.kubernetes.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible_collections.community.kubernetes.plugins.module_utils.args_common import (
from ansible_collections.kubernetes.core.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible_collections.kubernetes.core.plugins.module_utils.args_common import (
AUTH_ARG_SPEC, NAME_ARG_SPEC)
@@ -208,7 +208,7 @@ def get_previous_revision(all_resources, current_revision):
def main():
module = AnsibleModule(argument_spec=argspec(), supports_check_mode=True)
from ansible_collections.community.kubernetes.plugins.module_utils.common import (K8sAnsibleMixin, get_api_client)
from ansible_collections.kubernetes.core.plugins.module_utils.common import (K8sAnsibleMixin, get_api_client)
k8s_ansible_mixin = K8sAnsibleMixin(module)
k8s_ansible_mixin.client = get_api_client(module=module)

View File

@@ -25,10 +25,10 @@ description:
or Replication Controller, or the parallelism attribute of a Job. Supports check mode.
extends_documentation_fragment:
- community.kubernetes.k8s_name_options
- community.kubernetes.k8s_auth_options
- community.kubernetes.k8s_resource_options
- community.kubernetes.k8s_scale_options
- kubernetes.core.k8s_name_options
- kubernetes.core.k8s_auth_options
- kubernetes.core.k8s_resource_options
- kubernetes.core.k8s_scale_options
requirements:
- "python >= 2.7"
@@ -38,7 +38,7 @@ requirements:
EXAMPLES = r'''
- name: Scale deployment up, and extend timeout
community.kubernetes.k8s_scale:
kubernetes.core.k8s_scale:
api_version: v1
kind: Deployment
name: elastic
@@ -47,7 +47,7 @@ EXAMPLES = r'''
wait_timeout: 60
- name: Scale deployment down when current replicas match
community.kubernetes.k8s_scale:
kubernetes.core.k8s_scale:
api_version: v1
kind: Deployment
name: elastic
@@ -56,7 +56,7 @@ EXAMPLES = r'''
replicas: 2
- name: Increase job parallelism
community.kubernetes.k8s_scale:
kubernetes.core.k8s_scale:
api_version: batch/v1
kind: job
name: pi-with-timeout
@@ -66,19 +66,19 @@ EXAMPLES = r'''
# Match object using local file or inline definition
- name: Scale deployment based on a file from the local filesystem
community.kubernetes.k8s_scale:
kubernetes.core.k8s_scale:
src: /myproject/elastic_deployment.yml
replicas: 3
wait: no
- name: Scale deployment based on a template output
community.kubernetes.k8s_scale:
kubernetes.core.k8s_scale:
resource_definition: "{{ lookup('template', '/myproject/elastic_deployment.yml') | from_yaml }}"
replicas: 3
wait: no
- name: Scale deployment based on a file from the Ansible controller filesystem
community.kubernetes.k8s_scale:
kubernetes.core.k8s_scale:
resource_definition: "{{ lookup('file', '/myproject/elastic_deployment.yml') | from_yaml }}"
replicas: 3
wait: no
@@ -120,8 +120,8 @@ result:
import copy
from ansible_collections.community.kubernetes.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible_collections.community.kubernetes.plugins.module_utils.args_common import (
from ansible_collections.kubernetes.core.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible_collections.kubernetes.core.plugins.module_utils.args_common import (
AUTH_ARG_SPEC, RESOURCE_ARG_SPEC, NAME_ARG_SPEC)
@@ -157,7 +157,7 @@ def execute_module(module, k8s_ansible_mixin,):
resource = k8s_ansible_mixin.find_resource(kind, api_version, fail=True)
from ansible_collections.community.kubernetes.plugins.module_utils.common import NotFoundError
from ansible_collections.kubernetes.core.plugins.module_utils.common import NotFoundError
try:
existing = resource.get(name=name, namespace=namespace)
@@ -235,7 +235,7 @@ def scale(module, k8s_ansible_mixin, resource, existing_object, replicas, wait,
def main():
module = AnsibleModule(argument_spec=argspec(), supports_check_mode=True)
from ansible_collections.community.kubernetes.plugins.module_utils.common import (
from ansible_collections.kubernetes.core.plugins.module_utils.common import (
K8sAnsibleMixin, get_api_client)
k8s_ansible_mixin = K8sAnsibleMixin(module)

View File

@@ -21,9 +21,9 @@ description:
- Use Openshift Python SDK to manage Services on Kubernetes
extends_documentation_fragment:
- community.kubernetes.k8s_auth_options
- community.kubernetes.k8s_resource_options
- community.kubernetes.k8s_state_options
- kubernetes.core.k8s_auth_options
- kubernetes.core.k8s_resource_options
- kubernetes.core.k8s_state_options
options:
merge_type:
@@ -91,7 +91,7 @@ requirements:
EXAMPLES = r'''
- name: Expose https port with ClusterIP
community.kubernetes.k8s_service:
kubernetes.core.k8s_service:
state: present
name: test-https
namespace: default
@@ -102,7 +102,7 @@ EXAMPLES = r'''
key: special
- name: Expose https port with ClusterIP using spec
community.kubernetes.k8s_service:
kubernetes.core.k8s_service:
state: present
name: test-https
namespace: default
@@ -148,8 +148,8 @@ import copy
from collections import defaultdict
from ansible_collections.community.kubernetes.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible_collections.community.kubernetes.plugins.module_utils.args_common import (
from ansible_collections.kubernetes.core.plugins.module_utils.ansiblemodule import AnsibleModule
from ansible_collections.kubernetes.core.plugins.module_utils.args_common import (
AUTH_ARG_SPEC, COMMON_ARG_SPEC, RESOURCE_ARG_SPEC)
SERVICE_ARG_SPEC = {
@@ -228,7 +228,7 @@ def execute_module(module, k8s_ansible_mixin):
def main():
module = AnsibleModule(argument_spec=argspec(), supports_check_mode=True)
from ansible_collections.community.kubernetes.plugins.module_utils.common import (
from ansible_collections.kubernetes.core.plugins.module_utils.common import (
K8sAnsibleMixin, get_api_client)
k8s_ansible_mixin = K8sAnsibleMixin(module)