Server IP : 85.214.239.14 / Your IP : 3.142.212.225 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/2/root/usr/lib/python3/dist-packages/ansible_collections/ibm/qradar/plugins/modules/ |
Upload File : |
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2019, Adam Miller (admiller@redhat.com) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = """ --- module: deploy short_description: Trigger a qradar configuration deployment description: - This module allows for INCREMENTAL or FULL deployments version_added: "1.0.0" options: type: description: - Type of deployment required: false type: str choices: - "INCREMENTAL" - "FULL" default: "INCREMENTAL" notes: - This module does not support check mode because the QRadar REST API does not offer stateful inspection of configuration deployments author: "Ansible Security Automation Team (@maxamillion) <https://github.com/ansible-security>" """ EXAMPLES = """ - name: run an incremental deploy ibm.qradar.deploy: type: INCREMENTAL """ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils._text import to_text from ansible_collections.ibm.qradar.plugins.module_utils.qradar import ( QRadarRequest, ) def main(): argspec = dict( type=dict( choices=["INCREMENTAL", "FULL"], required=False, default="INCREMENTAL", ) ) module = AnsibleModule(argument_spec=argspec, supports_check_mode=False) qradar_request = QRadarRequest( module, not_rest_data_keys=["state", "type_name", "identifier"], ) qradar_return_data = qradar_request.post_by_path( "api/staged_config/deploy_status" ) if "message" in qradar_return_data and ( to_text("No changes to deploy") in to_text(qradar_return_data["message"]) ): module.exit_json( msg="No changes to deploy", qradar_return_data=qradar_return_data, changed=False, ) else: module.exit_json( msg="Successfully initiated {0} deployment.".format( module.params["type"] ), qradar_return_data=qradar_return_data, changed=True, ) if __name__ == "__main__": main()