mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-05-07 21:42:38 +00:00
Refreshed modules
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user