diff --git a/defaults/main.yml b/defaults/main.yml index 3faca81e..a7734969 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -88,11 +88,6 @@ keystone_resource_driver: sql keystone_bind_address: 0.0.0.0 -## Memcached servers used within keystone. -# String or Comma separated list of servers. -keystone_memcached_servers: 127.0.0.1 -keystone_memcached_max_compare_and_set_retry: 16 - ## Database info keystone_database_connection_string: >- mysql+pymysql://{{ keystone_galera_user }}:{{ keystone_container_mysql_password }}@{{ keystone_galera_address }}/{{ keystone_galera_database }}?charset=utf8{% if keystone_galera_use_ssl | bool %}&ssl_ca={{ keystone_galera_ssl_ca_cert }}{% endif %} @@ -253,8 +248,12 @@ keystone_external_ssl: false keystone_secure_proxy_ssl_header: HTTP_X_FORWARDED_PROTO ## Caching -# If set this will enable dog pile cache for keystone. -# keystone_cache_backend_argument: url:127.0.0.1:11211 +# This is a list of strings, each string contains a cache server's +# information (IP:port for example) +# The cache_servers default backend is memcached, so this variable +# should point to a list of memcached servers. +# If empty, caching is disabled. +keystone_cache_servers: [] ## LDAP Section # Define Keystone LDAP domain configuration here. diff --git a/releasenotes/notes/deprecated-memcached-and-backend-caching-vars-88c48117b232b37e.yaml b/releasenotes/notes/deprecated-memcached-and-backend-caching-vars-88c48117b232b37e.yaml new file mode 100644 index 00000000..aba32121 --- /dev/null +++ b/releasenotes/notes/deprecated-memcached-and-backend-caching-vars-88c48117b232b37e.yaml @@ -0,0 +1,6 @@ +--- +deprecations: + - | + The variables ``keystone_memcached_servers`` and + ``keystone_cache_backend_argument`` have been deprecated in favor of + ``keystone_cache_servers``, a list of servers for caching purposes. diff --git a/tasks/main.yml b/tasks/main.yml index 4a3dbff3..4b5e30dd 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -21,6 +21,20 @@ tags: - always +- name: Handle deprecation of keystone_memcached_servers + set_fact: + keystone_cache_servers: "{{ keystone_cache_servers + (_ | deprecated(keystone_memcached_servers, 'keystone_memcached_servers', 'keystone_cache_servers', 'queens')).split(',') }}" + when: keystone_memcached_servers is defined + tags: + - always + +- name: Handle deprecation of keystone_cache_backend_argument + set_fact: + keystone_cache_servers: "{{ keystone_cache_servers + (_ | deprecated(keystone_cache_backend_argument.replace('url:',''), 'keystone_cache_backend_argument', 'keystone_cache_servers', 'queens')).split(',') }}" + when: keystone_cache_backend_argument is defined + tags: + - always + - name: Gather variables for each operating system include_vars: "{{ item }}" with_first_found: diff --git a/templates/keystone.conf.j2 b/templates/keystone.conf.j2 index 490617c7..04d8d611 100644 --- a/templates/keystone.conf.j2 +++ b/templates/keystone.conf.j2 @@ -32,10 +32,15 @@ driver = messagingv2 transport_url = rabbit://{% for host in keystone_rabbitmq_telemetry_servers.split(',') %}{{ keystone_rabbitmq_telemetry_userid }}:{{ keystone_rabbitmq_telemetry_password }}@{{ host }}:{{ keystone_rabbitmq_telemetry_port }}{% if not loop.last %},{% else %}/{{ keystone_rabbitmq_telemetry_vhost }}{% endif %}{% endfor %} {% endif %} -{% if keystone_cache_backend_argument is defined %} +{% if keystone_cache_servers | length > 0 %} [cache] backend = dogpile.cache.memcached -backend_argument = {{ keystone_cache_backend_argument }} +# FIXME(lbragstad): Some strange behaviors have been reported when using +# multiple memcached instances with backend_argument. This has been documented +# in https://bugs.launchpad.net/oslo.cache/+bug/1743036 +# For the time being, memcache_servers works with a single memcached instance +# and multiple instances. +memcache_servers = {{ keystone_cache_servers | join(',') }} config_prefix = cache.keystone distributed_lock = True enabled = true