diff --git a/plugins/connection/kubectl.py b/plugins/connection/kubectl.py index 6ddc59b3..b320c494 100644 --- a/plugins/connection/kubectl.py +++ b/plugins/connection/kubectl.py @@ -32,8 +32,6 @@ - Use the kubectl exec command to run tasks in, or put/fetch files to, pods running on the Kubernetes container platform. - version_added: "2.5" - requirements: - kubectl (go binary) diff --git a/plugins/doc_fragments/k8s_auth_options.py b/plugins/doc_fragments/k8s_auth_options.py index 22b52414..053caed2 100644 --- a/plugins/doc_fragments/k8s_auth_options.py +++ b/plugins/doc_fragments/k8s_auth_options.py @@ -74,7 +74,6 @@ class ModuleDocFragment(object): description: - The URL of an HTTP proxy to use for the connection. Can also be specified via K8S_AUTH_PROXY environment variable. - Please note that this module does not pick up typical proxy settings from the environment (e.g. HTTP_PROXY). - version_added: "2.9" type: str persist_config: description: @@ -88,7 +87,6 @@ class ModuleDocFragment(object): - Please note that the current version of the k8s python client library does not support setting this flag to True yet. - "The fix for this k8s python library is here: https://github.com/kubernetes-client/python-base/pull/169" type: bool - version_added: "2.10" notes: - "The OpenShift Python client wraps the K8s Python client, providing full access to all of the APIS and models available on both platforms. For API version details and diff --git a/plugins/inventory/k8s.py b/plugins/inventory/k8s.py index 4db69c52..6f845c4e 100644 --- a/plugins/inventory/k8s.py +++ b/plugins/inventory/k8s.py @@ -140,7 +140,7 @@ class K8sInventoryException(Exception): class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable, K8sAnsibleMixin): - NAME = 'k8s' + NAME = 'community.kubernetes.k8s' transport = 'kubectl' diff --git a/plugins/inventory/openshift.py b/plugins/inventory/openshift.py index db3392cd..ddee2836 100644 --- a/plugins/inventory/openshift.py +++ b/plugins/inventory/openshift.py @@ -112,7 +112,7 @@ context: 'awx/192-168-64-4:8443/developer' ''' -from ansible.plugins.inventory.k8s import K8sInventoryException, InventoryModule as K8sInventoryModule, format_dynamic_api_exc +from ansible_collections.community.kubernetes.plugins.inventory.k8s import K8sInventoryException, InventoryModule as K8sInventoryModule, format_dynamic_api_exc try: from openshift.dynamic.exceptions import DynamicApiError @@ -121,7 +121,7 @@ class InventoryModule(K8sInventoryModule): - NAME = 'openshift' + NAME = 'community.kubernetes.openshift' transport = 'oc' diff --git a/plugins/lookup/k8s.py b/plugins/lookup/k8s.py index be7bf91d..314c52c0 100644 --- a/plugins/lookup/k8s.py +++ b/plugins/lookup/k8s.py @@ -20,11 +20,9 @@ __metaclass__ = type -DOCUMENTATION = """ +DOCUMENTATION = ''' lookup: k8s - version_added: "2.5" - short_description: Query the K8s API description: @@ -130,7 +128,7 @@ - "The OpenShift Python client wraps the K8s Python client, providing full access to all of the APIS and models available on both platforms. For API version details and additional information visit https://github.com/openshift/openshift-restclient-python" -""" +''' EXAMPLES = """ - name: Fetch a list of namespaces diff --git a/plugins/modules/k8s.py b/plugins/modules/k8s.py index acc74e88..13cb985a 100644 --- a/plugins/modules/k8s.py +++ b/plugins/modules/k8s.py @@ -19,8 +19,6 @@ short_description: Manage Kubernetes (K8s) objects -version_added: "2.6" - author: - "Chris Houseknecht (@chouseknecht)" - "Fabian von Feilitzsch (@fabianvf)" @@ -67,7 +65,6 @@ - strategic-merge type: list elements: str - version_added: "2.7" wait: description: - Whether to wait for certain resource kinds to end up in the desired state. By default the module exits once Kubernetes has @@ -76,19 +73,16 @@ - For resource kinds without an implementation, C(wait) returns immediately unless C(wait_condition) is set. default: no type: bool - version_added: "2.8" wait_sleep: description: - Number of seconds to sleep between checks. default: 5 type: int - version_added: "2.9" wait_timeout: description: - How long in seconds to wait for the resource to end up in the desired state. Ignored if C(wait) is not set. default: 120 type: int - version_added: "2.8" wait_condition: description: - Specifies a custom condition on the status to wait for. Ignored if C(wait) is not set or is set to False. @@ -114,11 +108,10 @@ type: str description: - The value of the reason field in your desired condition - - For example, if a C(Deployment) is paused, The C(Progressing) c(type) will have the C(DeploymentPaused) reason. + - For example, if a C(Deployment) is paused, The C(Progressing) C(type) will have the C(DeploymentPaused) reason. - The possible reasons in a condition are specific to each resource type in Kubernetes. See the API documentation of the status field for a given resource to see possible choices. type: dict - version_added: "2.8" validate: description: - how (if at all) to validate the resource definition against the kubernetes schema. @@ -135,7 +128,6 @@ default: True type: bool type: dict - version_added: "2.8" append_hash: description: - Whether to append a hash to a resource name for immutability purposes @@ -145,7 +137,6 @@ will only work if the same object is passed with state=absent (alternatively, just use state=absent with the name including the generated hash and append_hash=no) type: bool - version_added: "2.8" apply: description: - C(apply) compares the desired resource definition with the previously supplied resource definition, @@ -153,7 +144,6 @@ - C(apply) works better with Services than 'force=yes' - mutually exclusive with C(merge_type) type: bool - version_added: "2.9" requirements: - "python >= 2.7" @@ -191,11 +181,6 @@ name: port-8000-tcp port: 8000 -- name: Create a Service object by reading the definition from a file - k8s: - state: present - src: /testing/service.yml - - name: Remove an existing Service object k8s: state: absent diff --git a/plugins/modules/k8s_auth.py b/plugins/modules/k8s_auth.py index f735157b..4184ff40 100644 --- a/plugins/modules/k8s_auth.py +++ b/plugins/modules/k8s_auth.py @@ -19,8 +19,6 @@ short_description: Authenticate to Kubernetes clusters which require an explicit login step -version_added: "2.8" - author: KubeVirt Team (@kubevirt) description: diff --git a/plugins/modules/k8s_exec.py b/plugins/modules/k8s_exec.py index f91a7466..649b58ef 100644 --- a/plugins/modules/k8s_exec.py +++ b/plugins/modules/k8s_exec.py @@ -14,18 +14,24 @@ 'supported_by': 'community'} DOCUMENTATION = ''' + module: k8s_exec + short_description: Execute command in Pod -version_added: "1.0.0" + author: "Tristan de Cacqueray (@tristanC)" + description: - Use the Kubernetes Python client to execute command on K8s pods. + extends_documentation_fragment: - community.kubernetes.k8s_auth_options + requirements: - "python >= 2.7" - "openshift == 0.4.3" - "PyYAML >= 3.11" + options: proxy: description: diff --git a/plugins/modules/k8s_info.py b/plugins/modules/k8s_info.py index 49757616..4498cab8 100644 --- a/plugins/modules/k8s_info.py +++ b/plugins/modules/k8s_info.py @@ -18,8 +18,6 @@ short_description: Describe Kubernetes (K8s) objects -version_added: "2.7" - author: - "Will Thames (@willthames)" diff --git a/plugins/modules/k8s_log.py b/plugins/modules/k8s_log.py index d836cf23..6a0b55ff 100644 --- a/plugins/modules/k8s_log.py +++ b/plugins/modules/k8s_log.py @@ -18,8 +18,6 @@ short_description: Fetch logs from Kubernetes resources -version_added: "1.0.0" - author: - "Fabian von Feilitzsch (@fabianvf)" diff --git a/plugins/modules/k8s_scale.py b/plugins/modules/k8s_scale.py index 81dca908..ad4cbd18 100644 --- a/plugins/modules/k8s_scale.py +++ b/plugins/modules/k8s_scale.py @@ -19,8 +19,6 @@ short_description: Set a new size for a Deployment, ReplicaSet, Replication Controller, or Job. -version_added: "2.5" - author: - "Chris Houseknecht (@chouseknecht)" - "Fabian von Feilitzsch (@fabianvf)" diff --git a/plugins/modules/k8s_service.py b/plugins/modules/k8s_service.py index bda50225..97d3ce0c 100644 --- a/plugins/modules/k8s_service.py +++ b/plugins/modules/k8s_service.py @@ -19,8 +19,6 @@ short_description: Manage Services on Kubernetes -version_added: "2.8" - author: KubeVirt Team (@kubevirt) description: @@ -121,7 +119,6 @@ - C(apply) works better with Services than 'force=yes' - mutually exclusive with C(merge_type) type: bool - version_added: "2.9" requirements: - python >= 2.7 diff --git a/tests/integration/targets/kubernetes/library/test_tempfile.py b/tests/integration/targets/kubernetes/library/test_tempfile.py index 868f37b4..820f5f59 100644 --- a/tests/integration/targets/kubernetes/library/test_tempfile.py +++ b/tests/integration/targets/kubernetes/library/test_tempfile.py @@ -15,13 +15,15 @@ DOCUMENTATION = ''' --- module: test_tempfile -version_added: "2.3" + short_description: Creates temporary files and directories + description: - The C(test_tempfile) module creates temporary files and directories. C(mktemp) command takes different parameters on various systems, this module helps to avoid troubles related to that. Files/directories created by module are accessible only by creator. In case you need to make them world-accessible you need to use M(file) module. - For Windows targets, use the M(win_tempfile) module instead. + options: state: description: @@ -44,9 +46,11 @@ - Suffix of file/directory name created by module. type: str default: "" + seealso: - module: file - module: win_tempfile + author: - Krzysztof Magosa (@krzysztof-magosa) '''