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

[PR #8624/37c85605 backport][stable-9] Type options of cache plugins (#8686)

Type options of cache plugins (#8624)

* Type options of cache plugins.

* Do not change type of _timeout for now.

(cherry picked from commit 37c8560542)

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot] 2024-07-28 22:39:07 +02:00 committed by GitHub
parent 4c734ea134
commit 9b0ebef408
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 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

View file

@ -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:

View file

@ -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

View file

@ -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
''' '''