Debian Codegraph @

ansible_collections/fortinet/fortimanager/plugins/modules/fmgr_system_log_settings.py

raw symbols SCIP
1 #!/usr/bin/python
2 from __future__ import absolute_import, division, print_function
3 # Copyright 2019-2024 Fortinet, Inc.
4 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
5
6 __metaclass__ = type
7
8 ANSIBLE_METADATA = {'status': ['preview'],
9 'supported_by': 'community',
10 'metadata_version': '1.1'}
11
12 DOCUMENTATION = '''
13 ---
14 module: fmgr_system_log_settings
15 short_description: Log settings.
16 version_added: "2.0.0"
17 extends_documentation_fragment:
18 - fortinet.fortimanager.general
19 - fortinet.fortimanager.general.partial_crud
20 options:
21 system_log_settings:
22 description: The top level parameters set.
23 required: false
24 type: dict
25 suboptions:
26 FAC_custom_field1:
27 aliases: ['FAC-custom-field1']
28 type: str
29 description: Name of custom log field to index.
30 FAZ_custom_field1:
31 aliases: ['FAZ-custom-field1']
32 type: str
33 description: Name of custom log field to index.
34 FCH_custom_field1:
35 aliases: ['FCH-custom-field1']
36 type: str
37 description: Name of custom log field to index.
38 FCT_custom_field1:
39 aliases: ['FCT-custom-field1']
40 type: str
41 description: Name of custom log field to index.
42 FDD_custom_field1:
43 aliases: ['FDD-custom-field1']
44 type: str
45 description: Name of custom log field to index.
46 FGT_custom_field1:
47 aliases: ['FGT-custom-field1']
48 type: str
49 description: Name of custom log field to index.
50 FMG_custom_field1:
51 aliases: ['FMG-custom-field1']
52 type: str
53 description: Name of custom log field to index.
54 FML_custom_field1:
55 aliases: ['FML-custom-field1']
56 type: str
57 description: Name of custom log field to index.
58 FPX_custom_field1:
59 aliases: ['FPX-custom-field1']
60 type: str
61 description: Name of custom log field to index.
62 FSA_custom_field1:
63 aliases: ['FSA-custom-field1']
64 type: str
65 description: Name of custom log field to index.
66 FWB_custom_field1:
67 aliases: ['FWB-custom-field1']
68 type: str
69 description: Name of custom log field to index.
70 browse_max_logfiles:
71 aliases: ['browse-max-logfiles']
72 type: int
73 description: Maximum number of log files for each log browse attempt for each Adom.
74 dns_resolve_dstip:
75 aliases: ['dns-resolve-dstip']
76 type: str
77 description:
78 - Enable/Disable resolving destination IP by DNS.
79 - disable - Disable resolving destination IP by DNS.
80 - enable - Enable resolving destination IP by DNS.
81 choices: ['disable', 'enable']
82 download_max_logs:
83 aliases: ['download-max-logs']
84 type: int
85 description: Maximum number of logs for each log download attempt.
86 ha_auto_migrate:
87 aliases: ['ha-auto-migrate']
88 type: str
89 description:
90 - Enabled/Disable automatically merging HA members logs to HA cluster.
91 - disable - Disable automatically merging HA members logs to HA cluster.
92 - enable - Enable automatically merging HA members logs to HA cluster.
93 choices: ['disable', 'enable']
94 import_max_logfiles:
95 aliases: ['import-max-logfiles']
96 type: int
97 description: Maximum number of log files for each log import attempt.
98 log_file_archive_name:
99 aliases: ['log-file-archive-name']
100 type: str
101 description:
102 - Log file name format for archiving, such as backup, upload or download.
103 - basic - Basic format for log archive file name, e.
104 - extended - Extended format for log archive file name, e.
105 choices: ['basic', 'extended']
106 rolling_analyzer:
107 aliases: ['rolling-analyzer']
108 type: dict
109 description: Rolling analyzer.
110 suboptions:
111 days:
112 type: list
113 elements: str
114 description:
115 - Log files rolling schedule
116 - sun - Sunday.
117 - mon - Monday.
118 - tue - Tuesday.
119 - wed - Wednesday.
120 - thu - Thursday.
121 - fri - Friday.
122 - sat - Saturday.
123 choices: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']
124 del_files:
125 aliases: ['del-files']
126 type: str
127 description:
128 - Enable/disable log file deletion after uploading.
129 - disable - Disable log file deletion.
130 - enable - Enable log file deletion.
131 choices: ['disable', 'enable']
132 directory:
133 type: str
134 description: Upload server directory, for Unix server, use absolute
135 file_size:
136 aliases: ['file-size']
137 type: int
138 description: Roll log files when they reach this size
139 gzip_format:
140 aliases: ['gzip-format']
141 type: str
142 description:
143 - Enable/disable compression of uploaded log files.
144 - disable - Disable compression.
145 - enable - Enable compression.
146 choices: ['disable', 'enable']
147 hour:
148 type: int
149 description: Log files rolling schedule
150 ip:
151 type: str
152 description: Upload server IP address.
153 ip2:
154 type: str
155 description: Upload server IP2 address.
156 ip3:
157 type: str
158 description: Upload server IP3 address.
159 log_format:
160 aliases: ['log-format']
161 type: str
162 description:
163 - Format of uploaded log files.
164 - native - Native format
165 - text - Text format
166 - csv - CSV
167 choices: ['native', 'text', 'csv']
168 min:
169 type: int
170 description: Log files rolling schedule
171 password:
172 type: raw
173 description: (list) Upload server login password.
174 password2:
175 type: raw
176 description: (list) Upload server login password2.
177 password3:
178 type: raw
179 description: (list) Upload server login password3.
180 server_type:
181 aliases: ['server-type']
182 type: str
183 description:
184 - Upload server type.
185 - ftp - Upload via FTP.
186 - sftp - Upload via SFTP.
187 - scp - Upload via SCP.
188 choices: ['ftp', 'sftp', 'scp']
189 upload:
190 type: str
191 description:
192 - Enable/disable log file uploads.
193 - disable - Disable log files uploading.
194 - enable - Enable log files uploading.
195 choices: ['disable', 'enable']
196 upload_hour:
197 aliases: ['upload-hour']
198 type: int
199 description: Log files upload schedule
200 upload_mode:
201 aliases: ['upload-mode']
202 type: str
203 description:
204 - Upload mode with multiple servers.
205 - backup - Servers are attempted and used one after the other upon failure to connect.
206 - mirror - All configured servers are attempted and used.
207 choices: ['backup', 'mirror']
208 upload_trigger:
209 aliases: ['upload-trigger']
210 type: str
211 description:
212 - Event triggering log files upload.
213 - on-roll - Upload log files after they are rolled.
214 - on-schedule - Upload log files daily.
215 choices: ['on-roll', 'on-schedule']
216 username:
217 type: str
218 description: Upload server login username.
219 username2:
220 type: str
221 description: Upload server login username2.
222 username3:
223 type: str
224 description: Upload server login username3.
225 when:
226 type: str
227 description:
228 - Roll log files periodically.
229 - none - Do not roll log files periodically.
230 - daily - Roll log files daily.
231 - weekly - Roll log files on certain days of week.
232 choices: ['none', 'daily', 'weekly']
233 port:
234 type: int
235 description: Upload server IP1 port number.
236 port2:
237 type: int
238 description: Upload server IP2 port number.
239 port3:
240 type: int
241 description: Upload server IP3 port number.
242 rolling_upgrade_status:
243 aliases: ['rolling-upgrade-status']
244 type: int
245 description: Rolling upgrade status
246 server:
247 type: str
248 description: Upload server FQDN/IP.
249 server2:
250 type: str
251 description: Upload server2 FQDN/IP.
252 server3:
253 type: str
254 description: Upload server3 FQDN/IP.
255 rolling_local:
256 aliases: ['rolling-local']
257 type: dict
258 description: Rolling local.
259 suboptions:
260 days:
261 type: list
262 elements: str
263 description:
264 - Log files rolling schedule
265 - sun - Sunday.
266 - mon - Monday.
267 - tue - Tuesday.
268 - wed - Wednesday.
269 - thu - Thursday.
270 - fri - Friday.
271 - sat - Saturday.
272 choices: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']
273 del_files:
274 aliases: ['del-files']
275 type: str
276 description:
277 - Enable/disable log file deletion after uploading.
278 - disable - Disable log file deletion.
279 - enable - Enable log file deletion.
280 choices: ['disable', 'enable']
281 directory:
282 type: str
283 description: Upload server directory, for Unix server, use absolute
284 file_size:
285 aliases: ['file-size']
286 type: int
287 description: Roll log files when they reach this size
288 gzip_format:
289 aliases: ['gzip-format']
290 type: str
291 description:
292 - Enable/disable compression of uploaded log files.
293 - disable - Disable compression.
294 - enable - Enable compression.
295 choices: ['disable', 'enable']
296 hour:
297 type: int
298 description: Log files rolling schedule
299 ip:
300 type: str
301 description: Upload server IP address.
302 ip2:
303 type: str
304 description: Upload server IP2 address.
305 ip3:
306 type: str
307 description: Upload server IP3 address.
308 log_format:
309 aliases: ['log-format']
310 type: str
311 description:
312 - Format of uploaded log files.
313 - native - Native format
314 - text - Text format
315 - csv - CSV
316 choices: ['native', 'text', 'csv']
317 min:
318 type: int
319 description: Log files rolling schedule
320 password:
321 type: raw
322 description: (list) Upload server login password.
323 password2:
324 type: raw
325 description: (list) Upload server login password2.
326 password3:
327 type: raw
328 description: (list) Upload server login password3.
329 server_type:
330 aliases: ['server-type']
331 type: str
332 description:
333 - Upload server type.
334 - ftp - Upload via FTP.
335 - sftp - Upload via SFTP.
336 - scp - Upload via SCP.
337 choices: ['ftp', 'sftp', 'scp']
338 upload:
339 type: str
340 description:
341 - Enable/disable log file uploads.
342 - disable - Disable log files uploading.
343 - enable - Enable log files uploading.
344 choices: ['disable', 'enable']
345 upload_hour:
346 aliases: ['upload-hour']
347 type: int
348 description: Log files upload schedule
349 upload_mode:
350 aliases: ['upload-mode']
351 type: str
352 description:
353 - Upload mode with multiple servers.
354 - backup - Servers are attempted and used one after the other upon failure to connect.
355 - mirror - All configured servers are attempted and used.
356 choices: ['backup', 'mirror']
357 upload_trigger:
358 aliases: ['upload-trigger']
359 type: str
360 description:
361 - Event triggering log files upload.
362 - on-roll - Upload log files after they are rolled.
363 - on-schedule - Upload log files daily.
364 choices: ['on-roll', 'on-schedule']
365 username:
366 type: str
367 description: Upload server login username.
368 username2:
369 type: str
370 description: Upload server login username2.
371 username3:
372 type: str
373 description: Upload server login username3.
374 when:
375 type: str
376 description:
377 - Roll log files periodically.
378 - none - Do not roll log files periodically.
379 - daily - Roll log files daily.
380 - weekly - Roll log files on certain days of week.
381 choices: ['none', 'daily', 'weekly']
382 port:
383 type: int
384 description: Upload server IP1 port number.
385 port2:
386 type: int
387 description: Upload server IP2 port number.
388 port3:
389 type: int
390 description: Upload server IP3 port number.
391 rolling_upgrade_status:
392 aliases: ['rolling-upgrade-status']
393 type: int
394 description: Rolling upgrade status
395 server:
396 type: str
397 description: Upload server FQDN/IP.
398 server2:
399 type: str
400 description: Upload server2 FQDN/IP.
401 server3:
402 type: str
403 description: Upload server3 FQDN/IP.
404 rolling_regular:
405 aliases: ['rolling-regular']
406 type: dict
407 description: Rolling regular.
408 suboptions:
409 days:
410 type: list
411 elements: str
412 description:
413 - Log files rolling schedule
414 - sun - Sunday.
415 - mon - Monday.
416 - tue - Tuesday.
417 - wed - Wednesday.
418 - thu - Thursday.
419 - fri - Friday.
420 - sat - Saturday.
421 choices: ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']
422 del_files:
423 aliases: ['del-files']
424 type: str
425 description:
426 - Enable/disable log file deletion after uploading.
427 - disable - Disable log file deletion.
428 - enable - Enable log file deletion.
429 choices: ['disable', 'enable']
430 directory:
431 type: str
432 description: Upload server directory, for Unix server, use absolute
433 file_size:
434 aliases: ['file-size']
435 type: int
436 description: Roll log files when they reach this size
437 gzip_format:
438 aliases: ['gzip-format']
439 type: str
440 description:
441 - Enable/disable compression of uploaded log files.
442 - disable - Disable compression.
443 - enable - Enable compression.
444 choices: ['disable', 'enable']
445 hour:
446 type: int
447 description: Log files rolling schedule
448 ip:
449 type: str
450 description: Upload server IP address.
451 ip2:
452 type: str
453 description: Upload server IP2 address.
454 ip3:
455 type: str
456 description: Upload server IP3 address.
457 log_format:
458 aliases: ['log-format']
459 type: str
460 description:
461 - Format of uploaded log files.
462 - native - Native format
463 - text - Text format
464 - csv - CSV
465 choices: ['native', 'text', 'csv']
466 min:
467 type: int
468 description: Log files rolling schedule
469 password:
470 type: raw
471 description: (list) Upload server login password.
472 password2:
473 type: raw
474 description: (list) Upload server login password2.
475 password3:
476 type: raw
477 description: (list) Upload server login password3.
478 server_type:
479 aliases: ['server-type']
480 type: str
481 description:
482 - Upload server type.
483 - ftp - Upload via FTP.
484 - sftp - Upload via SFTP.
485 - scp - Upload via SCP.
486 choices: ['ftp', 'sftp', 'scp']
487 upload:
488 type: str
489 description:
490 - Enable/disable log file uploads.
491 - disable - Disable log files uploading.
492 - enable - Enable log files uploading.
493 choices: ['disable', 'enable']
494 upload_hour:
495 aliases: ['upload-hour']
496 type: int
497 description: Log files upload schedule
498 upload_mode:
499 aliases: ['upload-mode']
500 type: str
501 description:
502 - Upload mode with multiple servers.
503 - backup - Servers are attempted and used one after the other upon failure to connect.
504 - mirror - All configured servers are attempted and used.
505 choices: ['backup', 'mirror']
506 upload_trigger:
507 aliases: ['upload-trigger']
508 type: str
509 description:
510 - Event triggering log files upload.
511 - on-roll - Upload log files after they are rolled.
512 - on-schedule - Upload log files daily.
513 choices: ['on-roll', 'on-schedule']
514 username:
515 type: str
516 description: Upload server login username.
517 username2:
518 type: str
519 description: Upload server login username2.
520 username3:
521 type: str
522 description: Upload server login username3.
523 when:
524 type: str
525 description:
526 - Roll log files periodically.
527 - none - Do not roll log files periodically.
528 - daily - Roll log files daily.
529 - weekly - Roll log files on certain days of week.
530 choices: ['none', 'daily', 'weekly']
531 port:
532 type: int
533 description: Upload server IP1 port number.
534 port2:
535 type: int
536 description: Upload server IP2 port number.
537 port3:
538 type: int
539 description: Upload server IP3 port number.
540 rolling_upgrade_status:
541 aliases: ['rolling-upgrade-status']
542 type: int
543 description: Rolling upgrade status
544 server:
545 type: str
546 description: Upload server FQDN/IP.
547 server2:
548 type: str
549 description: Upload server2 FQDN/IP.
550 server3:
551 type: str
552 description: Upload server3 FQDN/IP.
553 sync_search_timeout:
554 aliases: ['sync-search-timeout']
555 type: int
556 description: Maximum number of seconds for running a log search session in synchronous mode.
557 keep_dev_logs:
558 aliases: ['keep-dev-logs']
559 type: str
560 description:
561 - Enable/Disable keeping the dev logs after the device has been deleted.
562 - disable - Disable keeping the dev logs after the device has been deleted.
563 - enable - Enable keeping the dev logs after the device has been deleted.
564 choices: ['disable', 'enable']
565 device_auto_detect:
566 aliases: ['device-auto-detect']
567 type: str
568 description:
569 - Enable/Disable looking up device ID in syslog received with no encryption.
570 - disable - Disable looking up device ID in syslog received with no encryption.
571 - enable - Enable looking up device ID in syslog received with no encryption.
572 choices: ['disable', 'enable']
573 unencrypted_logging:
574 aliases: ['unencrypted-logging']
575 type: str
576 description:
577 - Enable/Disable receiving syslog through UDP
578 - disable - Disable receiving syslog through UDP
579 - enable - Enable receiving syslog through UDP
580 choices: ['disable', 'enable']
581 log_interval_dev_no_logging:
582 aliases: ['log-interval-dev-no-logging']
583 type: int
584 description: Interval in minute of no log received from a device when considering the device down.
585 log_upload_interval_dev_no_logging:
586 aliases: ['log-upload-interval-dev-no-logging']
587 type: int
588 description: Interval in minute of no log uploaded from a device when considering the device down.
589 legacy_auth_mode:
590 aliases: ['legacy-auth-mode']
591 type: str
592 description:
593 - Enable/Disable legacy mode of device authentication by username/password.
594 - disable - Disable legacy authentication mode support.
595 - enable - Enable legacy authentication mode support.
596 choices: ['disable', 'enable']
597 log_process_fast_mode:
598 aliases: ['log-process-fast-mode']
599 type: str
600 description:
601 - Enable/Disable log process fast mode.
602 - disable - Disable log process fast mode.
603 - enable - Enable log process fast mode.
604 choices: ['disable', 'enable']
605 FFW_custom_field1:
606 aliases: ['FFW-custom-field1']
607 type: str
608 description: FFW custom field1.
609 unencrypted_logging_tcp:
610 aliases: ['unencrypted-logging-tcp']
611 type: str
612 description: Unencrypted logging tcp.
613 choices: ['disable', 'enable']
614 unencrypted_logging_udp:
615 aliases: ['unencrypted-logging-udp']
616 type: str
617 description: Unencrypted logging udp.
618 choices: ['disable', 'enable']
619 syslog_over_tls_port:
620 aliases: ['syslog-over-tls-port']
621 type: str
622 description: Syslog over tls port.
623 choices: ['514', '6514']
624 client_cert_auth:
625 aliases: ['client-cert-auth']
626 type: dict
627 description: Client cert auth.
628 suboptions:
629 mode:
630 type: str
631 description: Mode.
632 choices: ['basic', 'strict']
633 tls_port:
634 aliases: ['tls-port']
635 type: str
636 description: Tls port.
637 choices: ['both', '514', '6514']
638 trusted_client:
639 aliases: ['trusted-client']
640 type: list
641 elements: dict
642 description: Trusted client.
643 suboptions:
644 certificate:
645 type: raw
646 description: (list) Certificate.
647 description:
648 type: str
649 description: Description.
650 domain:
651 type: str
652 description: Domain.
653 id:
654 type: int
655 description: Id.
656 type:
657 type: str
658 description: Type.
659 choices: ['certificate', 'domain']
660 '''
661
662 EXAMPLES = '''
663 - name: Example playbook (generated based on argument schema)
664 hosts: fortimanagers
665 connection: httpapi
666 gather_facts: false
667 tasks:
668 - name: Log settings.
669 fortinet.fortimanager.fmgr_system_log_settings:
670 # workspace_locking_adom: <global or your adom name>
671 system_log_settings:
672 # FAC_custom_field1: <string>
673 # FAZ_custom_field1: <string>
674 # FCH_custom_field1: <string>
675 # FCT_custom_field1: <string>
676 # FDD_custom_field1: <string>
677 # FGT_custom_field1: <string>
678 # FMG_custom_field1: <string>
679 # FML_custom_field1: <string>
680 # FPX_custom_field1: <string>
681 # FSA_custom_field1: <string>
682 # FWB_custom_field1: <string>
683 # browse_max_logfiles: <integer>
684 # dns_resolve_dstip: <value in [disable, enable]>
685 # download_max_logs: <integer>
686 # ha_auto_migrate: <value in [disable, enable]>
687 # import_max_logfiles: <integer>
688 # log_file_archive_name: <value in [basic, extended]>
689 # rolling_analyzer:
690 # days: ["sun", "mon", "tue", "wed", "thu", "fri", "sat"]
691 # del_files: <value in [disable, enable]>
692 # directory: <string>
693 # file_size: <integer>
694 # gzip_format: <value in [disable, enable]>
695 # hour: <integer>
696 # ip: <string>
697 # ip2: <string>
698 # ip3: <string>
699 # log_format: <value in [native, text, csv]>
700 # min: <integer>
701 # password: <list or string>
702 # password2: <list or string>
703 # password3: <list or string>
704 # server_type: <value in [ftp, sftp, scp]>
705 # upload: <value in [disable, enable]>
706 # upload_hour: <integer>
707 # upload_mode: <value in [backup, mirror]>
708 # upload_trigger: <value in [on-roll, on-schedule]>
709 # username: <string>
710 # username2: <string>
711 # username3: <string>
712 # when: <value in [none, daily, weekly]>
713 # port: <integer>
714 # port2: <integer>
715 # port3: <integer>
716 # rolling_upgrade_status: <integer>
717 # server: <string>
718 # server2: <string>
719 # server3: <string>
720 # rolling_local:
721 # days: ["sun", "mon", "tue", "wed", "thu", "fri", "sat"]
722 # del_files: <value in [disable, enable]>
723 # directory: <string>
724 # file_size: <integer>
725 # gzip_format: <value in [disable, enable]>
726 # hour: <integer>
727 # ip: <string>
728 # ip2: <string>
729 # ip3: <string>
730 # log_format: <value in [native, text, csv]>
731 # min: <integer>
732 # password: <list or string>
733 # password2: <list or string>
734 # password3: <list or string>
735 # server_type: <value in [ftp, sftp, scp]>
736 # upload: <value in [disable, enable]>
737 # upload_hour: <integer>
738 # upload_mode: <value in [backup, mirror]>
739 # upload_trigger: <value in [on-roll, on-schedule]>
740 # username: <string>
741 # username2: <string>
742 # username3: <string>
743 # when: <value in [none, daily, weekly]>
744 # port: <integer>
745 # port2: <integer>
746 # port3: <integer>
747 # rolling_upgrade_status: <integer>
748 # server: <string>
749 # server2: <string>
750 # server3: <string>
751 # rolling_regular:
752 # days: ["sun", "mon", "tue", "wed", "thu", "fri", "sat"]
753 # del_files: <value in [disable, enable]>
754 # directory: <string>
755 # file_size: <integer>
756 # gzip_format: <value in [disable, enable]>
757 # hour: <integer>
758 # ip: <string>
759 # ip2: <string>
760 # ip3: <string>
761 # log_format: <value in [native, text, csv]>
762 # min: <integer>
763 # password: <list or string>
764 # password2: <list or string>
765 # password3: <list or string>
766 # server_type: <value in [ftp, sftp, scp]>
767 # upload: <value in [disable, enable]>
768 # upload_hour: <integer>
769 # upload_mode: <value in [backup, mirror]>
770 # upload_trigger: <value in [on-roll, on-schedule]>
771 # username: <string>
772 # username2: <string>
773 # username3: <string>
774 # when: <value in [none, daily, weekly]>
775 # port: <integer>
776 # port2: <integer>
777 # port3: <integer>
778 # rolling_upgrade_status: <integer>
779 # server: <string>
780 # server2: <string>
781 # server3: <string>
782 # sync_search_timeout: <integer>
783 # keep_dev_logs: <value in [disable, enable]>
784 # device_auto_detect: <value in [disable, enable]>
785 # unencrypted_logging: <value in [disable, enable]>
786 # log_interval_dev_no_logging: <integer>
787 # log_upload_interval_dev_no_logging: <integer>
788 # legacy_auth_mode: <value in [disable, enable]>
789 # log_process_fast_mode: <value in [disable, enable]>
790 # FFW_custom_field1: <string>
791 # unencrypted_logging_tcp: <value in [disable, enable]>
792 # unencrypted_logging_udp: <value in [disable, enable]>
793 # syslog_over_tls_port: <value in [514, 6514]>
794 # client_cert_auth:
795 # mode: <value in [basic, strict]>
796 # tls_port: <value in [both, 514, 6514]>
797 # trusted_client:
798 # - certificate: <list or string>
799 # description: <string>
800 # domain: <string>
801 # id: <integer>
802 # type: <value in [certificate, domain]>
803 '''
804
805 RETURN = '''
806 meta:
807 description: The result of the request.
808 type: dict
809 returned: always
810 contains:
811 request_url:
812 description: The full url requested.
813 returned: always
814 type: str
815 sample: /sys/login/user
816 response_code:
817 description: The status of api request.
818 returned: always
819 type: int
820 sample: 0
821 response_data:
822 description: The api response.
823 type: list
824 returned: always
825 response_message:
826 description: The descriptive message of the api response.
827 type: str
828 returned: always
829 sample: OK.
830 system_information:
831 description: The information of the target system.
832 type: dict
833 returned: always
834 rc:
835 description: The status the request.
836 type: int
837 returned: always
838 sample: 0
839 version_check_warning:
840 description: Warning if the parameters used in the playbook are not supported by the current FortiManager version.
841 type: list
842 returned: complex
843 '''
844 from ansible.module_utils.basic import AnsibleModule
845 from ansible.module_utils.connection import Connection
846 from ansible_collections.fortinet.fortimanager.plugins.module_utils.napi import NAPIManager, check_galaxy_version, check_parameter_bypass
847 from ansible_collections.fortinet.fortimanager.plugins.module_utils.common import get_module_arg_spec
848
849
850 def main():
851 urls_list = [
852 '/cli/global/system/log/settings'
853 ]
854 module_arg_spec = {
855 'system_log_settings': {
856 'type': 'dict', 'v_range': [['6.0.0', '']],
857 'options': {
858 'FAC-custom-field1': {'type': 'str'},
859 'FAZ-custom-field1': {'v_range': [['6.0.0', '7.2.0']], 'type': 'str'},
860 'FCH-custom-field1': {'type': 'str'},
861 'FCT-custom-field1': {'type': 'str'},
862 'FDD-custom-field1': {'type': 'str'},
863 'FGT-custom-field1': {'type': 'str'},
864 'FMG-custom-field1': {'v_range': [['6.0.0', '7.2.0']], 'type': 'str'},
865 'FML-custom-field1': {'type': 'str'},
866 'FPX-custom-field1': {'type': 'str'},
867 'FSA-custom-field1': {'type': 'str'},
868 'FWB-custom-field1': {'type': 'str'},
869 'browse-max-logfiles': {'type': 'int'},
870 'dns-resolve-dstip': {'choices': ['disable', 'enable'], 'type': 'str'},
871 'download-max-logs': {'type': 'int'},
872 'ha-auto-migrate': {'choices': ['disable', 'enable'], 'type': 'str'},
873 'import-max-logfiles': {'type': 'int'},
874 'log-file-archive-name': {'choices': ['basic', 'extended'], 'type': 'str'},
875 'rolling-analyzer': {
876 'type': 'dict',
877 'options': {
878 'days': {'type': 'list', 'choices': ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'], 'elements': 'str'},
879 'del-files': {'choices': ['disable', 'enable'], 'type': 'str'},
880 'directory': {'type': 'str'},
881 'file-size': {'type': 'int'},
882 'gzip-format': {'choices': ['disable', 'enable'], 'type': 'str'},
883 'hour': {'type': 'int'},
884 'ip': {'v_range': [['6.0.0', '7.0.16']], 'type': 'str'},
885 'ip2': {'v_range': [['6.0.0', '7.0.16']], 'type': 'str'},
886 'ip3': {'v_range': [['6.0.0', '7.0.16']], 'type': 'str'},
887 'log-format': {'choices': ['native', 'text', 'csv'], 'type': 'str'},
888 'min': {'type': 'int'},
889 'password': {'no_log': True, 'type': 'raw'},
890 'password2': {'no_log': True, 'type': 'raw'},
891 'password3': {'no_log': True, 'type': 'raw'},
892 'server-type': {'choices': ['ftp', 'sftp', 'scp'], 'type': 'str'},
893 'upload': {'choices': ['disable', 'enable'], 'type': 'str'},
894 'upload-hour': {'type': 'int'},
895 'upload-mode': {'choices': ['backup', 'mirror'], 'type': 'str'},
896 'upload-trigger': {'choices': ['on-roll', 'on-schedule'], 'type': 'str'},
897 'username': {'type': 'str'},
898 'username2': {'type': 'str'},
899 'username3': {'type': 'str'},
900 'when': {'choices': ['none', 'daily', 'weekly'], 'type': 'str'},
901 'port': {'v_range': [['6.2.2', '']], 'type': 'int'},
902 'port2': {'v_range': [['6.2.2', '']], 'type': 'int'},
903 'port3': {'v_range': [['6.2.2', '']], 'type': 'int'},
904 'rolling-upgrade-status': {'v_range': [['7.0.3', '']], 'type': 'int'},
905 'server': {'v_range': [['7.2.0', '']], 'type': 'str'},
906 'server2': {'v_range': [['7.2.0', '']], 'type': 'str'},
907 'server3': {'v_range': [['7.2.0', '']], 'type': 'str'}
908 }
909 },
910 'rolling-local': {
911 'type': 'dict',
912 'options': {
913 'days': {'type': 'list', 'choices': ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'], 'elements': 'str'},
914 'del-files': {'choices': ['disable', 'enable'], 'type': 'str'},
915 'directory': {'type': 'str'},
916 'file-size': {'type': 'int'},
917 'gzip-format': {'choices': ['disable', 'enable'], 'type': 'str'},
918 'hour': {'type': 'int'},
919 'ip': {'v_range': [['6.0.0', '7.0.16']], 'type': 'str'},
920 'ip2': {'v_range': [['6.0.0', '7.0.16']], 'type': 'str'},
921 'ip3': {'v_range': [['6.0.0', '7.0.16']], 'type': 'str'},
922 'log-format': {'choices': ['native', 'text', 'csv'], 'type': 'str'},
923 'min': {'type': 'int'},
924 'password': {'no_log': True, 'type': 'raw'},
925 'password2': {'no_log': True, 'type': 'raw'},
926 'password3': {'no_log': True, 'type': 'raw'},
927 'server-type': {'choices': ['ftp', 'sftp', 'scp'], 'type': 'str'},
928 'upload': {'choices': ['disable', 'enable'], 'type': 'str'},
929 'upload-hour': {'type': 'int'},
930 'upload-mode': {'choices': ['backup', 'mirror'], 'type': 'str'},
931 'upload-trigger': {'choices': ['on-roll', 'on-schedule'], 'type': 'str'},
932 'username': {'type': 'str'},
933 'username2': {'type': 'str'},
934 'username3': {'type': 'str'},
935 'when': {'choices': ['none', 'daily', 'weekly'], 'type': 'str'},
936 'port': {'v_range': [['6.2.2', '']], 'type': 'int'},
937 'port2': {'v_range': [['6.2.2', '']], 'type': 'int'},
938 'port3': {'v_range': [['6.2.2', '']], 'type': 'int'},
939 'rolling-upgrade-status': {'v_range': [['7.0.3', '']], 'type': 'int'},
940 'server': {'v_range': [['7.2.0', '']], 'type': 'str'},
941 'server2': {'v_range': [['7.2.0', '']], 'type': 'str'},
942 'server3': {'v_range': [['7.2.0', '']], 'type': 'str'}
943 }
944 },
945 'rolling-regular': {
946 'type': 'dict',
947 'options': {
948 'days': {'type': 'list', 'choices': ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'], 'elements': 'str'},
949 'del-files': {'choices': ['disable', 'enable'], 'type': 'str'},
950 'directory': {'type': 'str'},
951 'file-size': {'type': 'int'},
952 'gzip-format': {'choices': ['disable', 'enable'], 'type': 'str'},
953 'hour': {'type': 'int'},
954 'ip': {'v_range': [['6.0.0', '7.0.16']], 'type': 'str'},
955 'ip2': {'v_range': [['6.0.0', '7.0.16']], 'type': 'str'},
956 'ip3': {'v_range': [['6.0.0', '7.0.16']], 'type': 'str'},
957 'log-format': {'choices': ['native', 'text', 'csv'], 'type': 'str'},
958 'min': {'type': 'int'},
959 'password': {'no_log': True, 'type': 'raw'},
960 'password2': {'no_log': True, 'type': 'raw'},
961 'password3': {'no_log': True, 'type': 'raw'},
962 'server-type': {'choices': ['ftp', 'sftp', 'scp'], 'type': 'str'},
963 'upload': {'choices': ['disable', 'enable'], 'type': 'str'},
964 'upload-hour': {'type': 'int'},
965 'upload-mode': {'choices': ['backup', 'mirror'], 'type': 'str'},
966 'upload-trigger': {'choices': ['on-roll', 'on-schedule'], 'type': 'str'},
967 'username': {'type': 'str'},
968 'username2': {'type': 'str'},
969 'username3': {'type': 'str'},
970 'when': {'choices': ['none', 'daily', 'weekly'], 'type': 'str'},
971 'port': {'v_range': [['6.2.2', '']], 'type': 'int'},
972 'port2': {'v_range': [['6.2.2', '']], 'type': 'int'},
973 'port3': {'v_range': [['6.2.2', '']], 'type': 'int'},
974 'rolling-upgrade-status': {'v_range': [['7.0.3', '']], 'type': 'int'},
975 'server': {'v_range': [['7.2.0', '']], 'type': 'str'},
976 'server2': {'v_range': [['7.2.0', '']], 'type': 'str'},
977 'server3': {'v_range': [['7.2.0', '']], 'type': 'str'}
978 }
979 },
980 'sync-search-timeout': {'type': 'int'},
981 'keep-dev-logs': {'v_range': [['6.4.7', '6.4.15'], ['7.0.2', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
982 'device-auto-detect': {
983 'v_range': [['7.0.10', '7.0.16'], ['7.2.4', '7.2.12'], ['7.4.1', '']],
984 'choices': ['disable', 'enable'],
985 'type': 'str'
986 },
987 'unencrypted-logging': {
988 'v_range': [['7.0.10', '7.0.16'], ['7.2.4', '7.2.12'], ['7.4.1', '7.6.2']],
989 'choices': ['disable', 'enable'],
990 'type': 'str'
991 },
992 'log-interval-dev-no-logging': {'v_range': [['7.2.5', '7.2.12'], ['7.4.2', '']], 'type': 'int'},
993 'log-upload-interval-dev-no-logging': {'v_range': [['7.2.5', '7.2.12'], ['7.4.2', '']], 'type': 'int'},
994 'legacy-auth-mode': {
995 'v_range': [['7.0.14', '7.0.16'], ['7.2.10', '7.2.12'], ['7.4.7', '7.4.10'], ['7.6.3', '']],
996 'choices': ['disable', 'enable'],
997 'type': 'str'
998 },
999 'log-process-fast-mode': {'v_range': [['7.4.7', '7.4.10'], ['7.6.4', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
1000 'FFW-custom-field1': {'v_range': [['7.6.3', '']], 'type': 'str'},
1001 'unencrypted-logging-tcp': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
1002 'unencrypted-logging-udp': {'v_range': [['7.6.3', '']], 'choices': ['disable', 'enable'], 'type': 'str'},
1003 'syslog-over-tls-port': {'v_range': [['7.6.4', '']], 'choices': ['514', '6514'], 'type': 'str'},
1004 'client-cert-auth': {
1005 'v_range': [['7.6.5', '']],
1006 'type': 'dict',
1007 'options': {
1008 'mode': {'v_range': [['7.6.5', '']], 'choices': ['basic', 'strict'], 'type': 'str'},
1009 'tls-port': {'v_range': [['7.6.5', '']], 'choices': ['both', '514', '6514'], 'type': 'str'},
1010 'trusted-client': {
1011 'v_range': [['7.6.5', '']],
1012 'type': 'list',
1013 'options': {
1014 'certificate': {'v_range': [['7.6.5', '']], 'type': 'raw'},
1015 'description': {'v_range': [['7.6.5', '']], 'type': 'str'},
1016 'domain': {'v_range': [['7.6.5', '']], 'type': 'str'},
1017 'id': {'v_range': [['7.6.5', '']], 'type': 'int'},
1018 'type': {'v_range': [['7.6.5', '']], 'choices': ['certificate', 'domain'], 'type': 'str'}
1019 },
1020 'elements': 'dict'
1021 }
1022 }
1023 }
1024 }
1025 }
1026 }
1027
1028 module_option_spec = get_module_arg_spec('partial crud')
1029 module_arg_spec.update(module_option_spec)
1030 check_galaxy_version(module_arg_spec)
1031 module = AnsibleModule(argument_spec=check_parameter_bypass(module_arg_spec, 'system_log_settings'),
1032 supports_check_mode=True)
1033 if not module._socket_path:
1034 module.fail_json(msg='MUST RUN IN HTTPAPI MODE')
1035 connection = Connection(module._socket_path)
1036 fmgr = NAPIManager('partial crud', module_arg_spec, urls_list,
1037 None, 'data', module, connection)
1038 fmgr.process_partial_crud()
1039 module.exit_json(meta=module.params)
1040
1041
1042 if __name__ == '__main__':
1043 main()