| 1 |
#!/usr/bin/python |
| 2 |
# -*- coding: utf-8 -*- |
| 3 |
|
| 4 |
# Copyright (c) 2021, Cisco Systems |
| 5 |
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 6 |
|
| 7 |
DOCUMENTATION = r""" |
| 8 |
module: networks_wireless_ssids_splash_settings |
| 9 |
short_description: Resource module for networks _wireless _ssids _splash _settings |
| 10 |
description: |
| 11 |
- Manage operation update of the resource networks _wireless _ssids _splash _settings. |
| 12 |
- Modify the splash page settings for the given SSID. |
| 13 |
version_added: '1.0.0' |
| 14 |
extends_documentation_fragment: |
| 15 |
- cisco.meraki.module |
| 16 |
author: Francisco Munoz (@fmunoz) |
| 17 |
options: |
| 18 |
allowSimultaneousLogins: |
| 19 |
description: Whether or not to allow simultaneous logins from different devices. |
| 20 |
type: bool |
| 21 |
billing: |
| 22 |
description: Details associated with billing splash. |
| 23 |
suboptions: |
| 24 |
freeAccess: |
| 25 |
description: Details associated with a free access plan with limits. |
| 26 |
suboptions: |
| 27 |
durationInMinutes: |
| 28 |
description: How long a device can use a network for free. |
| 29 |
type: int |
| 30 |
enabled: |
| 31 |
description: Whether or not free access is enabled. |
| 32 |
type: bool |
| 33 |
type: dict |
| 34 |
prepaidAccessFastLoginEnabled: |
| 35 |
description: Whether or not billing uses the fast login prepaid access option. |
| 36 |
type: bool |
| 37 |
replyToEmailAddress: |
| 38 |
description: The email address that receives replies from clients. |
| 39 |
type: str |
| 40 |
type: dict |
| 41 |
blockAllTrafficBeforeSignOn: |
| 42 |
description: How restricted allowing traffic should be. If true, all traffic types |
| 43 |
are blocked until the splash page is acknowledged. If false, all non-HTTP traffic |
| 44 |
is allowed before the splash page is acknowledged. |
| 45 |
type: bool |
| 46 |
controllerDisconnectionBehavior: |
| 47 |
description: How login attempts should be handled when the controller is unreachable. |
| 48 |
Can be either 'open', 'restricted', or 'default'. |
| 49 |
type: str |
| 50 |
guestSponsorship: |
| 51 |
description: Details associated with guest sponsored splash. |
| 52 |
suboptions: |
| 53 |
durationInMinutes: |
| 54 |
description: Duration in minutes of sponsored guest authorization. Must be |
| 55 |
between 1 and 60480 (6 weeks). |
| 56 |
type: int |
| 57 |
guestCanRequestTimeframe: |
| 58 |
description: Whether or not guests can specify how much time they are requesting. |
| 59 |
type: bool |
| 60 |
type: dict |
| 61 |
networkId: |
| 62 |
description: NetworkId path parameter. Network ID. |
| 63 |
type: str |
| 64 |
number: |
| 65 |
description: Number path parameter. |
| 66 |
type: str |
| 67 |
redirectUrl: |
| 68 |
description: The custom redirect URL where the users will go after the splash |
| 69 |
page. |
| 70 |
type: str |
| 71 |
selfRegistration: |
| 72 |
description: Self-registration settings for splash with Meraki authentication. |
| 73 |
suboptions: |
| 74 |
authorizationType: |
| 75 |
description: How created user accounts should be authorized. Must be included |
| 76 |
in admin, auto, self_email. |
| 77 |
type: str |
| 78 |
enabled: |
| 79 |
description: Whether or not to allow users to create their own account on |
| 80 |
the network. |
| 81 |
type: bool |
| 82 |
type: dict |
| 83 |
sentryEnrollment: |
| 84 |
description: Systems Manager sentry enrollment splash settings. |
| 85 |
suboptions: |
| 86 |
enforcedSystems: |
| 87 |
description: The system types that the Sentry enforces. Must be included in |
| 88 |
'iOS, 'Android', 'macOS', and 'Windows'. |
| 89 |
elements: str |
| 90 |
type: list |
| 91 |
strength: |
| 92 |
description: The strength of the enforcement of selected system types. Must |
| 93 |
be one of 'focused', 'click-through', and 'strict'. |
| 94 |
type: str |
| 95 |
systemsManagerNetwork: |
| 96 |
description: Systems Manager network targeted for sentry enrollment. |
| 97 |
suboptions: |
| 98 |
id: |
| 99 |
description: The network ID of the Systems Manager network. |
| 100 |
type: str |
| 101 |
type: dict |
| 102 |
type: dict |
| 103 |
splashImage: |
| 104 |
description: The image used in the splash page. |
| 105 |
suboptions: |
| 106 |
extension: |
| 107 |
description: The extension of the image file. |
| 108 |
type: str |
| 109 |
image: |
| 110 |
description: Properties for setting a new image. |
| 111 |
suboptions: |
| 112 |
contents: |
| 113 |
description: The file contents (a base 64 encoded string) of your new |
| 114 |
image. |
| 115 |
type: str |
| 116 |
format: |
| 117 |
description: The format of the encoded contents. Supported formats are |
| 118 |
'png', 'gif', and jpg'. |
| 119 |
type: str |
| 120 |
type: dict |
| 121 |
md5: |
| 122 |
description: The MD5 value of the image file. Setting this to null will remove |
| 123 |
the image from the splash page. |
| 124 |
type: str |
| 125 |
type: dict |
| 126 |
splashLogo: |
| 127 |
description: The logo used in the splash page. |
| 128 |
suboptions: |
| 129 |
extension: |
| 130 |
description: The extension of the logo file. |
| 131 |
type: str |
| 132 |
image: |
| 133 |
description: Properties for setting a new image. |
| 134 |
suboptions: |
| 135 |
contents: |
| 136 |
description: The file contents (a base 64 encoded string) of your new |
| 137 |
logo. |
| 138 |
type: str |
| 139 |
format: |
| 140 |
description: The format of the encoded contents. Supported formats are |
| 141 |
'png', 'gif', and jpg'. |
| 142 |
type: str |
| 143 |
type: dict |
| 144 |
md5: |
| 145 |
description: The MD5 value of the logo file. Setting this to null will remove |
| 146 |
the logo from the splash page. |
| 147 |
type: str |
| 148 |
type: dict |
| 149 |
splashPrepaidFront: |
| 150 |
description: The prepaid front image used in the splash page. |
| 151 |
suboptions: |
| 152 |
extension: |
| 153 |
description: The extension of the prepaid front image file. |
| 154 |
type: str |
| 155 |
image: |
| 156 |
description: Properties for setting a new image. |
| 157 |
suboptions: |
| 158 |
contents: |
| 159 |
description: The file contents (a base 64 encoded string) of your new |
| 160 |
prepaid front. |
| 161 |
type: str |
| 162 |
format: |
| 163 |
description: The format of the encoded contents. Supported formats are |
| 164 |
'png', 'gif', and jpg'. |
| 165 |
type: str |
| 166 |
type: dict |
| 167 |
md5: |
| 168 |
description: The MD5 value of the prepaid front image file. Setting this to |
| 169 |
null will remove the prepaid front from the splash page. |
| 170 |
type: str |
| 171 |
type: dict |
| 172 |
splashTimeout: |
| 173 |
description: Splash timeout in minutes. This will determine how often users will |
| 174 |
see the splash page. |
| 175 |
type: int |
| 176 |
splashUrl: |
| 177 |
description: Optional The custom splash URL of the click-through splash page. |
| 178 |
Note that the URL can be configured without necessarily being used. In order |
| 179 |
to enable the custom URL, see 'useSplashUrl'. |
| 180 |
type: str |
| 181 |
themeId: |
| 182 |
description: The id of the selected splash theme. |
| 183 |
type: str |
| 184 |
useRedirectUrl: |
| 185 |
description: The Boolean indicating whether the the user will be redirected to |
| 186 |
the custom redirect URL after the splash page. A custom redirect URL must be |
| 187 |
set if this is true. |
| 188 |
type: bool |
| 189 |
useSplashUrl: |
| 190 |
description: Optional Boolean indicating whether the users will be redirected |
| 191 |
to the custom splash url. A custom splash URL must be set if this is true. Note |
| 192 |
that depending on your SSID's access control settings, it may not be possible |
| 193 |
to use the custom splash URL. |
| 194 |
type: bool |
| 195 |
welcomeMessage: |
| 196 |
description: The welcome message for the users on the splash page. |
| 197 |
type: str |
| 198 |
requirements: |
| 199 |
- meraki >= 2.4.9 |
| 200 |
- python >= 3.5 |
| 201 |
seealso: |
| 202 |
- name: Cisco Meraki documentation for wireless updateNetworkWirelessSsidSplashSettings |
| 203 |
description: Complete reference of the updateNetworkWirelessSsidSplashSettings |
| 204 |
API. |
| 205 |
link: https://developer.cisco.com/meraki/api-v1/#!update-network-wireless-ssid-splash-settings |
| 206 |
notes: |
| 207 |
- SDK Method used are |
| 208 |
wireless.Wireless.update_network_wireless_ssid_splash_settings, |
| 209 |
- Paths used are |
| 210 |
put /networks/{networkId}/wireless/ssids/{number}/splash/settings, |
| 211 |
""" |
| 212 |
|
| 213 |
EXAMPLES = r""" |
| 214 |
- name: Update all |
| 215 |
cisco.meraki.networks_wireless_ssids_splash_settings: |
| 216 |
meraki_api_key: "{{ meraki_api_key }}" |
| 217 |
meraki_base_url: "{{ meraki_base_url }}" |
| 218 |
meraki_single_request_timeout: "{{ meraki_single_request_timeout }}" |
| 219 |
meraki_certificate_path: "{{ meraki_certificate_path }}" |
| 220 |
meraki_requests_proxy: "{{ meraki_requests_proxy }}" |
| 221 |
meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}" |
| 222 |
meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}" |
| 223 |
meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}" |
| 224 |
meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}" |
| 225 |
meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}" |
| 226 |
meraki_maximum_retries: "{{ meraki_maximum_retries }}" |
| 227 |
meraki_output_log: "{{ meraki_output_log }}" |
| 228 |
meraki_log_file_prefix: "{{ meraki_log_file_prefix }}" |
| 229 |
meraki_log_path: "{{ meraki_log_path }}" |
| 230 |
meraki_print_console: "{{ meraki_print_console }}" |
| 231 |
meraki_suppress_logging: "{{ meraki_suppress_logging }}" |
| 232 |
meraki_simulate: "{{ meraki_simulate }}" |
| 233 |
meraki_be_geo_id: "{{ meraki_be_geo_id }}" |
| 234 |
meraki_caller: "{{ meraki_caller }}" |
| 235 |
meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}" |
| 236 |
meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}" |
| 237 |
state: present |
| 238 |
allowSimultaneousLogins: false |
| 239 |
billing: |
| 240 |
freeAccess: |
| 241 |
durationInMinutes: 120 |
| 242 |
enabled: true |
| 243 |
prepaidAccessFastLoginEnabled: true |
| 244 |
replyToEmailAddress: [email protected] |
| 245 |
blockAllTrafficBeforeSignOn: false |
| 246 |
controllerDisconnectionBehavior: default |
| 247 |
guestSponsorship: |
| 248 |
durationInMinutes: 30 |
| 249 |
guestCanRequestTimeframe: false |
| 250 |
networkId: string |
| 251 |
number: string |
| 252 |
redirectUrl: https://example.com |
| 253 |
selfRegistration: |
| 254 |
authorizationType: admin |
| 255 |
enabled: true |
| 256 |
sentryEnrollment: |
| 257 |
enforcedSystems: |
| 258 |
- iOS |
| 259 |
strength: focused |
| 260 |
systemsManagerNetwork: |
| 261 |
id: N_1234 |
| 262 |
splashImage: |
| 263 |
extension: jpg |
| 264 |
image: |
| 265 |
contents: Q2lzY28gTWVyYWtp |
| 266 |
format: jpg |
| 267 |
md5: 542cccac8d7dedee0f185311d154d194 |
| 268 |
splashLogo: |
| 269 |
extension: jpg |
| 270 |
image: |
| 271 |
contents: Q2lzY28gTWVyYWtp |
| 272 |
format: jpg |
| 273 |
md5: abcd1234 |
| 274 |
splashPrepaidFront: |
| 275 |
extension: jpg |
| 276 |
image: |
| 277 |
contents: Q2lzY28gTWVyYWtp |
| 278 |
format: jpg |
| 279 |
md5: 542cccac8d7dedee0f185311d154d194 |
| 280 |
splashTimeout: 1440 |
| 281 |
splashUrl: https://www.custom_splash_url.com |
| 282 |
themeId: c3ddcb4f16785ee747ab5ffc10867d6c8ea704be |
| 283 |
useRedirectUrl: true |
| 284 |
useSplashUrl: true |
| 285 |
welcomeMessage: Welcome! |
| 286 |
""" |
| 287 |
RETURN = r""" |
| 288 |
meraki_response: |
| 289 |
description: A dictionary or list with the response returned by the Cisco Meraki Python SDK |
| 290 |
returned: always |
| 291 |
type: dict |
| 292 |
sample: > |
| 293 |
{ |
| 294 |
"ssidNumber": 0, |
| 295 |
"splashPage": "string", |
| 296 |
"useSplashUrl": true, |
| 297 |
"splashUrl": "string", |
| 298 |
"splashTimeout": 0, |
| 299 |
"redirectUrl": "string", |
| 300 |
"useRedirectUrl": true, |
| 301 |
"welcomeMessage": "string", |
| 302 |
"themeId": "string", |
| 303 |
"splashLogo": { |
| 304 |
"md5": "string", |
| 305 |
"extension": "string" |
| 306 |
}, |
| 307 |
"splashImage": { |
| 308 |
"md5": "string", |
| 309 |
"extension": "string" |
| 310 |
}, |
| 311 |
"splashPrepaidFront": { |
| 312 |
"md5": "string", |
| 313 |
"extension": "string" |
| 314 |
}, |
| 315 |
"guestSponsorship": { |
| 316 |
"durationInMinutes": 0, |
| 317 |
"guestCanRequestTimeframe": true |
| 318 |
}, |
| 319 |
"blockAllTrafficBeforeSignOn": true, |
| 320 |
"controllerDisconnectionBehavior": "string", |
| 321 |
"allowSimultaneousLogins": true, |
| 322 |
"billing": { |
| 323 |
"freeAccess": { |
| 324 |
"enabled": true, |
| 325 |
"durationInMinutes": 0 |
| 326 |
}, |
| 327 |
"prepaidAccessFastLoginEnabled": true, |
| 328 |
"replyToEmailAddress": "string" |
| 329 |
}, |
| 330 |
"sentryEnrollment": { |
| 331 |
"systemsManagerNetwork": { |
| 332 |
"id": "string" |
| 333 |
}, |
| 334 |
"strength": "string", |
| 335 |
"enforcedSystems": [ |
| 336 |
"string" |
| 337 |
] |
| 338 |
}, |
| 339 |
"selfRegistration": { |
| 340 |
"enabled": true, |
| 341 |
"authorizationType": "string" |
| 342 |
} |
| 343 |
} |
| 344 |
""" |