blob: b596dff85aaee4a9299f69bfbdc229150b07f769 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
|
# flake8: noqa
# pylint: skip-file
DOCUMENTATION = '''
---
module: oc_service
short_description: Create, modify, and idempotently manage openshift services.
description:
- Manage openshift service objects programmatically.
options:
state:
description:
- State represents whether to create, modify, delete, or list
required: False
default: present
choices: ["present", "absent", "list"]
aliases: []
kubeconfig:
description:
- The path for the kubeconfig file to use for authentication
required: false
default: /etc/origin/master/admin.kubeconfig
aliases: []
debug:
description:
- Turn on debug output.
required: false
default: False
aliases: []
name:
description:
- Name of the object that is being queried.
required: false
default: None
aliases: []
namespace:
description:
- The namespace where the object lives.
required: false
default: default
aliases: []
annotations:
description:
- Annotations to apply to the object
required: false
default: None
aliases: []
selector:
description:
- The selector to apply when filtering for services.
required: false
default: None
aliases: []
labels:
description:
- The labels to apply on the service.
required: false
default: None
aliases: []
clusterip:
description:
- The cluster ip address to use with this service.
required: false
default: None
aliases: []
portalip:
description:
- The portal ip(virtual ip) address to use with this service.
- "https://docs.openshift.com/enterprise/3.0/architecture/core_concepts/pods_and_services.html#services"
required: false
default: None
aliases: []
ports:
description:
- A list of the ports that are used for this service. This includes name, port, protocol, and targetPort.
- See examples.
required: false
default: None
aliases: []
session_affinity:
description:
- The type of session affinity to use.
required: false
default: 'None'
aliases: []
service_type:
description:
- The type of service desired. Each option tells the service to behave accordingly.
- https://kubernetes.io/docs/user-guide/services/
required: false
default: ClusterIP
choices:
- ClusterIP
- NodePort
- LoadBalancer
- ExternalName
aliases: []
externalips:
description:
- A list of the external IPs that are exposed for this service.
- https://kubernetes.io/docs/concepts/services-networking/service/#external-ips
required: false
default: None
aliases: []
author:
- "Kenny Woodson <kwoodson@redhat.com>"
extends_documentation_fragment: []
'''
EXAMPLES = '''
- name: get docker-registry service
run_once: true
oc_service:
namespace: default
name: docker-registry
state: list
register: registry_service_out
- name: create the docker-registry service
oc_service:
namespace: default
name: docker-registry
ports:
- name: 5000-tcp
port: 5000
protocol: TCP
targetPort: 5000
selector:
docker-registry: default
session_affinity: ClientIP
service_type: ClusterIP
register: svc_out
notify:
- restart openshift master services
'''
|