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:
parent
1a8f172186
commit
37c8560542
5 changed files with 17 additions and 2 deletions
2
changelogs/fragments/8624-cache-types.yml
Normal file
2
changelogs/fragments/8624-cache-types.yml
Normal 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)."
|
4
plugins/cache/memcached.py
vendored
4
plugins/cache/memcached.py
vendored
|
@ -29,6 +29,7 @@ DOCUMENTATION = '''
|
||||||
section: defaults
|
section: defaults
|
||||||
_prefix:
|
_prefix:
|
||||||
description: User defined prefix to use when creating the DB entries
|
description: User defined prefix to use when creating the DB entries
|
||||||
|
type: string
|
||||||
default: ansible_facts
|
default: ansible_facts
|
||||||
env:
|
env:
|
||||||
- name: ANSIBLE_CACHE_PLUGIN_PREFIX
|
- name: ANSIBLE_CACHE_PLUGIN_PREFIX
|
||||||
|
@ -37,13 +38,14 @@ DOCUMENTATION = '''
|
||||||
section: defaults
|
section: defaults
|
||||||
_timeout:
|
_timeout:
|
||||||
default: 86400
|
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
|
description: Expiration timeout in seconds for the cache plugin data. Set to 0 to never expire
|
||||||
env:
|
env:
|
||||||
- name: ANSIBLE_CACHE_PLUGIN_TIMEOUT
|
- name: ANSIBLE_CACHE_PLUGIN_TIMEOUT
|
||||||
ini:
|
ini:
|
||||||
- key: fact_caching_timeout
|
- key: fact_caching_timeout
|
||||||
section: defaults
|
section: defaults
|
||||||
type: integer
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
|
3
plugins/cache/pickle.py
vendored
3
plugins/cache/pickle.py
vendored
|
@ -24,6 +24,7 @@ DOCUMENTATION = '''
|
||||||
ini:
|
ini:
|
||||||
- key: fact_caching_connection
|
- key: fact_caching_connection
|
||||||
section: defaults
|
section: defaults
|
||||||
|
type: path
|
||||||
_prefix:
|
_prefix:
|
||||||
description: User defined prefix to use when creating the files
|
description: User defined prefix to use when creating the files
|
||||||
env:
|
env:
|
||||||
|
@ -31,6 +32,7 @@ DOCUMENTATION = '''
|
||||||
ini:
|
ini:
|
||||||
- key: fact_caching_prefix
|
- key: fact_caching_prefix
|
||||||
section: defaults
|
section: defaults
|
||||||
|
type: string
|
||||||
_timeout:
|
_timeout:
|
||||||
default: 86400
|
default: 86400
|
||||||
description: Expiration timeout in seconds for the cache plugin data. Set to 0 to never expire
|
description: Expiration timeout in seconds for the cache plugin data. Set to 0 to never expire
|
||||||
|
@ -39,6 +41,7 @@ DOCUMENTATION = '''
|
||||||
ini:
|
ini:
|
||||||
- key: fact_caching_timeout
|
- key: fact_caching_timeout
|
||||||
section: defaults
|
section: defaults
|
||||||
|
type: float
|
||||||
'''
|
'''
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
7
plugins/cache/redis.py
vendored
7
plugins/cache/redis.py
vendored
|
@ -21,6 +21,7 @@ DOCUMENTATION = '''
|
||||||
- The format is V(host:port:db:password), for example V(localhost:6379:0:changeme).
|
- 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 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.
|
- 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
|
required: true
|
||||||
env:
|
env:
|
||||||
- name: ANSIBLE_CACHE_PLUGIN_CONNECTION
|
- name: ANSIBLE_CACHE_PLUGIN_CONNECTION
|
||||||
|
@ -29,6 +30,7 @@ DOCUMENTATION = '''
|
||||||
section: defaults
|
section: defaults
|
||||||
_prefix:
|
_prefix:
|
||||||
description: User defined prefix to use when creating the DB entries
|
description: User defined prefix to use when creating the DB entries
|
||||||
|
type: string
|
||||||
default: ansible_facts
|
default: ansible_facts
|
||||||
env:
|
env:
|
||||||
- name: ANSIBLE_CACHE_PLUGIN_PREFIX
|
- name: ANSIBLE_CACHE_PLUGIN_PREFIX
|
||||||
|
@ -37,6 +39,7 @@ DOCUMENTATION = '''
|
||||||
section: defaults
|
section: defaults
|
||||||
_keyset_name:
|
_keyset_name:
|
||||||
description: User defined name for cache keyset name.
|
description: User defined name for cache keyset name.
|
||||||
|
type: string
|
||||||
default: ansible_cache_keys
|
default: ansible_cache_keys
|
||||||
env:
|
env:
|
||||||
- name: ANSIBLE_CACHE_REDIS_KEYSET_NAME
|
- name: ANSIBLE_CACHE_REDIS_KEYSET_NAME
|
||||||
|
@ -46,6 +49,7 @@ DOCUMENTATION = '''
|
||||||
version_added: 1.3.0
|
version_added: 1.3.0
|
||||||
_sentinel_service_name:
|
_sentinel_service_name:
|
||||||
description: The redis sentinel service name (or referenced as cluster name).
|
description: The redis sentinel service name (or referenced as cluster name).
|
||||||
|
type: string
|
||||||
env:
|
env:
|
||||||
- name: ANSIBLE_CACHE_REDIS_SENTINEL
|
- name: ANSIBLE_CACHE_REDIS_SENTINEL
|
||||||
ini:
|
ini:
|
||||||
|
@ -54,13 +58,14 @@ DOCUMENTATION = '''
|
||||||
version_added: 1.3.0
|
version_added: 1.3.0
|
||||||
_timeout:
|
_timeout:
|
||||||
default: 86400
|
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
|
description: Expiration timeout in seconds for the cache plugin data. Set to 0 to never expire
|
||||||
env:
|
env:
|
||||||
- name: ANSIBLE_CACHE_PLUGIN_TIMEOUT
|
- name: ANSIBLE_CACHE_PLUGIN_TIMEOUT
|
||||||
ini:
|
ini:
|
||||||
- key: fact_caching_timeout
|
- key: fact_caching_timeout
|
||||||
section: defaults
|
section: defaults
|
||||||
type: integer
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
3
plugins/cache/yaml.py
vendored
3
plugins/cache/yaml.py
vendored
|
@ -24,6 +24,7 @@ DOCUMENTATION = '''
|
||||||
ini:
|
ini:
|
||||||
- key: fact_caching_connection
|
- key: fact_caching_connection
|
||||||
section: defaults
|
section: defaults
|
||||||
|
type: string
|
||||||
_prefix:
|
_prefix:
|
||||||
description: User defined prefix to use when creating the files
|
description: User defined prefix to use when creating the files
|
||||||
env:
|
env:
|
||||||
|
@ -31,6 +32,7 @@ DOCUMENTATION = '''
|
||||||
ini:
|
ini:
|
||||||
- key: fact_caching_prefix
|
- key: fact_caching_prefix
|
||||||
section: defaults
|
section: defaults
|
||||||
|
type: string
|
||||||
_timeout:
|
_timeout:
|
||||||
default: 86400
|
default: 86400
|
||||||
description: Expiration timeout in seconds for the cache plugin data. Set to 0 to never expire
|
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
|
- key: fact_caching_timeout
|
||||||
section: defaults
|
section: defaults
|
||||||
type: integer
|
type: integer
|
||||||
|
# TODO: determine whether it is OK to change to: type: float
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue