ansible-collections / ansible-collections/cloud.common
How to best increase the daemon server ttl (override the 15s)
- Dominant language
- Python
- Stars
- 19
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
##### SUMMARY
Need the ability to override the default ttl for the daemon process to preserve the client session for specific period of time longer than the 15s default or until the playbook finishes executing.
What's the best way to do that currently?
##### ISSUE TYPE
- Feature Idea
- Question on how to set ttl when using AnsibleTurboModule
##### COMPONENT NAME
ansible_collections.cloud.common.plugins.module_utils.turbo.server
ansible_collections.cloud.common.plugins.module_utils.turbo.module
##### ADDITIONAL INFORMATION
Can an implementation like this be supported?
```python
class AnsibleTurboModule(ansible.module_utils.basic.AnsibleModule):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
...
self.ttl = kwargs.get("ttl", 15)
```
##### EXAMPLE PLAYBOOK
```yaml
- name: "Establish config session and send commands to candidate mode"
my_cutom_module_router_config:
router_ip: "{{ r_ip] }}"
username: "{{ r_user }}"
password: "{{ r_pass }}"
operations:
- config
config: "{{ cli_command_set }}"
- Name: "Do other stuff..."
pause:
minutes: 15
- name: "Must use previously created config session to commit config to running datastore"
my_cutom_module_router_config:
router_ip: "{{ r_ip] }}"
username: "{{ r_user }}"
password: "{{ r_pass }}"
operations:
- commit
config: "{{ cli_command_set }}"
```
Contributor guide
Research direction
Start by reading ansible_collections.cloud.common.plugins.module_utils.turbo.server and ansible_collections.cloud.common.plugins.module_utils.turbo.module to understand where the daemon's 15-second TTL is defined and how module sessions are reused. Clarify whether the supported behavior should allow a caller-provided TTL or preserve the session through playbook completion, then identify the relevant test entry points before defining done.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100