f5networks / f5networks.f5_bigip / 3.4.0 / module / bigip_do_deploy Manages DO declarations sent to BIG-IP | "added in version" 1.0.0 of f5networks.f5_bigip" Authors: Wojciech Wypior (@wojtek0806)f5networks.f5_bigip.bigip_do_deploy (3.4.0) — module
Install with ansible-galaxy collection install f5networks.f5_bigip:==3.4.0
collections: - name: f5networks.f5_bigip version: 3.4.0
Manages DO declarations sent to BIG-IP.
- name: Start complex declaration with restart bigip_do_deploy: content: "{{ lookup('file', 'do_provision_restart.json') }}" register: task
- name: Check for task that will reboot bigip_do_deploy: task_id: "{{ task.task_id }}" register: result
- name: Wait for 4 minutes if device is restarting services pause: minutes: 4 when: - result.message == "Device is restarting services, unable to check task status."
- name: Check for task again after restart bigip_do_deploy: task_id: "{{ task.task_id }}" register: repeat when: - result.message == "Device is restarting services, unable to check task status."
- name: Dry run DO declaration bigip_do_deploy: content: "{{ lookup('file', 'do_provision.json') }}" dry_run: 'yes' register: result
- name: Assert Dry run DO declaration assert: that: - result is not changed - result is success - result.message is search("Dry run completed successfully") - result.diff | length > 0
content: description: - Declaration to be configured on the system. - This parameter is most often used along with the C(file) or C(template) lookup plugins. Refer to the examples section for correct usage. - For anything advanced or with formatting consider using the C(template) lookup. - This can additionally be used for specifying application service configurations directly in YAML, however that is not an encouraged practice and, if used at all, should only be used for the absolute smallest of configurations to prevent your Playbooks from becoming too large. - If you C(content) includes encrypted values (such as ciphertexts, passphrases, etc), the returned C(changed) value will always be true. - If you are using the C(to_nice_json) filter, it will cause this module to fail because the purpose of that filter is to format the JSON to be human-readable and this process includes inserting "extra characters that break JSON validators. type: raw dry_run: description: - Set this option to check what changes would be made on device if DO declaration was committed on device. - When C(true) the submitted DO declaration in C(content) is checked against existing configuration for any changes, with diff returned in results, without making any changes. - This option is mutually exclusive with C(task_id), and requires C(content) to be specified. - No changes are required in to be made by the user to DO declaration to perform a dry run. - While the operation is asynchronous, module does not require re-running to check for task status, for longer running tasks which would be with larger DO declarations, it is recommended to increase C(timeout) parameter from its default value. type: bool version_added: 2.0.0 version_added_collection: f5networks.f5_bigip task_id: description: - The ID of the async task as returned by the system in a previous module run. - Used to query the status of the task on the device, useful with longer running operations that require restarting services. - This option is mutually exclusive with C(dry_run). type: str timeout: default: 300 description: - The amount of time in seconds to wait for the DO async interface to complete its task. - The accepted value range is between C(150) and C(3600) seconds. - If the device needs to restart the module will return with no change and an appropriate message. In such case, it is up to the user to pause task execution until device is ready, see C(EXAMPLES) section. type: int
content: description: The declaration sent to the system. returned: changed sample: hash/dictionary of values type: dict diff: description: Returns the detailed results of a diff from dry run operation. returned: when dry_run is yes sample: - foo: bar - baz: bar type: list message: description: Informative message of the task status. returned: always sample: task has been completed type: str task_id: description: The task ID returned by the system. returned: changed sample: 9fe61ef703d0d3192016 type: str