Refreshed modules

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

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python
from ansible.module_utils.k8s_common import OpenShiftAnsibleModule, OpenShiftAnsibleException
from ansible.module_utils.k8s_common import KubernetesAnsibleModule, KubernetesAnsibleException
DOCUMENTATION = '''
module: k8s_v1_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()