1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Type options of cache plugins (#8624)

* Type options of cache plugins.

* Do not change type of _timeout for now.
This commit is contained in:
Felix Fontein 2024-07-28 13:09:46 +02:00 committed by GitHub
parent 1a8f172186
commit 37c8560542
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 17 additions and 2 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- "memcached, pickle, redis, yaml cache plugins - make sure that all options are typed (https://github.com/ansible-collections/community.general/pull/8624)."

View file

@ -29,6 +29,7 @@ DOCUMENTATION = '''
section: defaults
_prefix:
description: User defined prefix to use when creating the DB entries
type: string
default: ansible_facts
env:
- name: ANSIBLE_CACHE_PLUGIN_PREFIX
@ -37,13 +38,14 @@ DOCUMENTATION = '''
section: defaults
_timeout:
default: 86400
type: integer
# TODO: determine whether it is OK to change to: type: float
description: Expiration timeout in seconds for the cache plugin data. Set to 0 to never expire
env:
- name: ANSIBLE_CACHE_PLUGIN_TIMEOUT
ini:
- key: fact_caching_timeout
section: defaults
type: integer
'''
import collections

View file

@ -24,6 +24,7 @@ DOCUMENTATION = '''
ini:
- key: fact_caching_connection
section: defaults
type: path
_prefix:
description: User defined prefix to use when creating the files
env:
@ -31,6 +32,7 @@ DOCUMENTATION = '''
ini:
- key: fact_caching_prefix
section: defaults
type: string
_timeout:
default: 86400
description: Expiration timeout in seconds for the cache plugin data. Set to 0 to never expire
@ -39,6 +41,7 @@ DOCUMENTATION = '''
ini:
- key: fact_caching_timeout
section: defaults
type: float
'''
try:

View file

@ -21,6 +21,7 @@ DOCUMENTATION = '''
- The format is V(host:port:db:password), for example V(localhost:6379:0:changeme).
- To use encryption in transit, prefix the connection with V(tls://), as in V(tls://localhost:6379:0:changeme).
- To use redis sentinel, use separator V(;), for example V(localhost:26379;localhost:26379;0:changeme). Requires redis>=2.9.0.
type: string
required: true
env:
- name: ANSIBLE_CACHE_PLUGIN_CONNECTION
@ -29,6 +30,7 @@ DOCUMENTATION = '''
section: defaults
_prefix:
description: User defined prefix to use when creating the DB entries
type: string
default: ansible_facts
env:
- name: ANSIBLE_CACHE_PLUGIN_PREFIX
@ -37,6 +39,7 @@ DOCUMENTATION = '''
section: defaults
_keyset_name:
description: User defined name for cache keyset name.
type: string
default: ansible_cache_keys
env:
- name: ANSIBLE_CACHE_REDIS_KEYSET_NAME
@ -46,6 +49,7 @@ DOCUMENTATION = '''
version_added: 1.3.0
_sentinel_service_name:
description: The redis sentinel service name (or referenced as cluster name).
type: string
env:
- name: ANSIBLE_CACHE_REDIS_SENTINEL
ini:
@ -54,13 +58,14 @@ DOCUMENTATION = '''
version_added: 1.3.0
_timeout:
default: 86400
type: integer
# TODO: determine whether it is OK to change to: type: float
description: Expiration timeout in seconds for the cache plugin data. Set to 0 to never expire
env:
- name: ANSIBLE_CACHE_PLUGIN_TIMEOUT
ini:
- key: fact_caching_timeout
section: defaults
type: integer
'''
import re

View file

@ -24,6 +24,7 @@ DOCUMENTATION = '''
ini:
- key: fact_caching_connection
section: defaults
type: string
_prefix:
description: User defined prefix to use when creating the files
env:
@ -31,6 +32,7 @@ DOCUMENTATION = '''
ini:
- key: fact_caching_prefix
section: defaults
type: string
_timeout:
default: 86400
description: Expiration timeout in seconds for the cache plugin data. Set to 0 to never expire
@ -40,6 +42,7 @@ DOCUMENTATION = '''
- key: fact_caching_timeout
section: defaults
type: integer
# TODO: determine whether it is OK to change to: type: float
'''