bigip_do_deploy – Manages DO declarations sent to BIG-IP¶
New in version 1.0.0.
Parameters¶
Parameter | Choices/Defaults | Configuration | Comments |
---|---|---|---|
content
raw
|
Declaration to be configured on the system.
This parameter is most often used along with the
file or template lookup plugins. Refer to the examples section for correct usage.For anything advanced or with formatting consider using the
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
content includes encrypted values (such as ciphertexts, passphrases, etc), the returned changed value will always be true.If you are using the
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. |
||
dry_run
boolean
added in 2.0.0 |
|
Set this option to check what changes would be made on device if DO declaration was committed on device.
When
true the submitted DO declaration in content is checked against existing configuration for any changes, with diff returned in results, without making any changes.This option is mutually exclusive with
task_id , and requires 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
timeout parameter from its default value. |
|
task_id
string
|
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
dry_run . |
||
timeout
integer
|
Default: 300
|
The amount of time in seconds to wait for the DO async interface to complete its task.
The accepted value range is between
150 and 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
EXAMPLES section. |
Notes¶
Note
- While this module is not idempotent it offers a dry-run option to check for changes in configuration before they are committed, see Parameters section for details.
Examples¶
- 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
Return Values¶
The following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
content
dictionary
|
changed |
The declaration sent to the system.
Sample:
hash/dictionary of values
|
diff
list
|
when dry_run is yes |
Returns the detailed results of a diff from dry run operation.
Sample:
[{'foo': 'bar'}, {'baz': 'bar'}]
|
message
string
|
always |
Informative message of the task status.
Sample:
task has been completed
|
task_id
string
|
changed |
The task ID returned by the system.
Sample:
9fe61ef703d0d3192016
|