Debian Codegraph @

ansible_collections/community/windows/plugins/modules/win_iis_webbinding.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # Copyright: (c) 2017, Noah Sparks <[email protected]>
5 # Copyright: (c) 2017, Henrik Wallström <[email protected]>
6 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
7
8 DOCUMENTATION = r'''
9 ---
10 module: win_iis_webbinding
11 short_description: Configures a IIS Web site binding
12 description:
13 - Creates, removes and configures a binding to an existing IIS Web site.
14 deprecated:
15 removed_in: 4.0.0
16 why: >-
17 This module has been deprecated and an alternative supported module is available in the C(microsoft.iis) collection.
18 alternative: Use C(microsoft.iis.website) instead.
19 options:
20 name:
21 description:
22 - Names of web site.
23 type: str
24 required: yes
25 aliases: [ website ]
26 state:
27 description:
28 - State of the binding.
29 type: str
30 choices: [ absent, present ]
31 default: present
32 port:
33 description:
34 - The port to bind to / use for the new site.
35 type: int
36 default: 80
37 ip:
38 description:
39 - The IP address to bind to / use for the new site.
40 type: str
41 default: '*'
42 host_header:
43 description:
44 - The host header to bind to / use for the new site.
45 - If you are creating/removing a catch-all binding, omit this parameter rather than defining it as '*'.
46 type: str
47 protocol:
48 description:
49 - The protocol to be used for the Web binding (usually HTTP, HTTPS, or FTP).
50 type: str
51 default: http
52 certificate_hash:
53 description:
54 - Certificate hash (thumbprint) for the SSL binding. The certificate hash is the unique identifier for the certificate.
55 type: str
56 certificate_store_name:
57 description:
58 - Name of the certificate store where the certificate for the binding is located.
59 type: str
60 default: my
61 ssl_flags:
62 description:
63 - This parameter is only valid on Server 2012 and newer.
64 - Primarily used for enabling and disabling server name indication (SNI).
65 - Set to C(0) to disable SNI.
66 - Set to C(1) to enable SNI.
67 type: str
68 seealso:
69 - module: community.windows.win_iis_virtualdirectory
70 - module: community.windows.win_iis_webapplication
71 - module: community.windows.win_iis_webapppool
72 - module: community.windows.win_iis_website
73 author:
74 - Noah Sparks (@nwsparks)
75 - Henrik Wallström (@henrikwallstrom)
76 '''
77
78 EXAMPLES = r'''
79 - name: Add a HTTP binding on port 9090
80 community.windows.win_iis_webbinding:
81 name: Default Web Site
82 port: 9090
83 state: present
84
85 - name: Remove the HTTP binding on port 9090
86 community.windows.win_iis_webbinding:
87 name: Default Web Site
88 port: 9090
89 state: absent
90
91 - name: Remove the default http binding
92 community.windows.win_iis_webbinding:
93 name: Default Web Site
94 port: 80
95 ip: '*'
96 state: absent
97
98 - name: Add a HTTPS binding
99 community.windows.win_iis_webbinding:
100 name: Default Web Site
101 protocol: https
102 port: 443
103 ip: 127.0.0.1
104 certificate_hash: B0D0FA8408FC67B230338FCA584D03792DA73F4C
105 state: present
106
107 - name: Add a HTTPS binding with host header and SNI enabled
108 community.windows.win_iis_webbinding:
109 name: Default Web Site
110 protocol: https
111 port: 443
112 host_header: test.com
113 ssl_flags: 1
114 certificate_hash: D1A3AF8988FD32D1A3AF8988FD323792DA73F4C
115 state: present
116 '''
117
118 RETURN = r'''
119 website_state:
120 description:
121 - The state of the website being targetted
122 - Can be helpful in case you accidentally cause a binding collision
123 which can result in the targetted site being stopped
124 returned: always
125 type: str
126 sample: "Started"
127 operation_type:
128 description:
129 - The type of operation performed
130 - Can be removed, updated, matched, or added
131 returned: on success
132 type: str
133 sample: "removed"
134 binding_info:
135 description:
136 - Information on the binding being manipulated
137 returned: on success
138 type: dict
139 sample: |-
140 "binding_info": {
141 "bindingInformation": "127.0.0.1:443:",
142 "certificateHash": "FF3910CE089397F1B5A77EB7BAFDD8F44CDE77DD",
143 "certificateStoreName": "MY",
144 "hostheader": "",
145 "ip": "127.0.0.1",
146 "port": 443,
147 "protocol": "https",
148 "sslFlags": "not supported"
149 }
150 '''