From ed736fd783a60d583caf4727e15fe813e8d78757 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Tue, 7 Jul 2020 07:30:17 +0300 Subject: [PATCH] Cleanup glance-registry service Glance-registry service has been removed in V cycle with [1] We do all necessary cleanup to fully remove service deployment. [1] https://review.opendev.org/738671/ Change-Id: I0b2e2e39040fd0daef04724f94a39f2d11e4d105 --- README.rst | 3 +- defaults/main.yml | 22 ------- doc/source/index.rst | 1 - handlers/main.yml | 54 ---------------- .../glance_registry-0a1a1f8c60f5a368.yaml | 4 ++ tasks/glance_install.yml | 1 - tasks/glance_post_install.yml | 5 -- templates/glance-api.conf.j2 | 8 --- templates/glance-cache.conf.j2 | 2 - templates/glance-registry.conf.j2 | 63 ------------------- tests/inventory | 4 -- tox.ini | 7 --- vars/main.yml | 4 -- vars/redhat.yml | 5 -- 14 files changed, 5 insertions(+), 178 deletions(-) create mode 100644 releasenotes/notes/glance_registry-0a1a1f8c60f5a368.yaml delete mode 100644 templates/glance-registry.conf.j2 diff --git a/README.rst b/README.rst index 64f66beb..857e89a1 100644 --- a/README.rst +++ b/README.rst @@ -11,8 +11,7 @@ Team and repository tags OpenStack-Ansible glance ======================== -This Ansible role installs and configures OpenStack glance api and the -glance registry. +This Ansible role installs and configures OpenStack glance api. Documentation for the project can be found at: https://docs.openstack.org/openstack-ansible-os_glance/latest/ diff --git a/defaults/main.yml b/defaults/main.yml index 245c028d..cad30136 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -75,7 +75,6 @@ glance_system_user_home: "/var/lib/{{ glance_system_user_name }}" # glance_system_user_uid: # glance_system_group_gid: -glance_registry_host: "{{ internal_lb_vip_address }}" glance_default_store: file # For support of multiple backends provide `glance_additional_stores` in the format: # glance_additional_stores: @@ -92,9 +91,6 @@ glance_memcached_servers: "{{ memcached_servers }}" ## API options glance_enable_v2_api: True -# The v2 API does not require the registry service. -# The registry service is scheduled for removal in the S cycle. -glance_enable_v2_registry: False ## Oslo Messaging Info @@ -135,15 +131,11 @@ glance_role_name: admin glance_api_bind_address: "{{ openstack_service_bind_address | default('0.0.0.0') }}" glance_api_service_port: 9292 -glance_registry_bind_address: "{{ openstack_service_bind_address | default('0.0.0.0') }}" -glance_registry_service_port: 9191 - ## Service Type and Data glance_service_region: RegionOne glance_service_name: glance glance_service_port: 9292 glance_service_proto: http -glance_service_registry_proto: "{{ glance_service_proto }}" glance_service_publicuri_proto: "{{ openstack_service_publicuri_proto | default(glance_service_proto) }}" glance_service_adminuri_proto: "{{ openstack_service_adminuri_proto | default(glance_service_proto) }}" glance_service_internaluri_proto: "{{ openstack_service_internaluri_proto | default(glance_service_proto) }}" @@ -191,10 +183,6 @@ glance_cors_allowed_origin: "{{ (glance_show_multiple_locations | bool) | ternar # compute the number of api workers to use. # glance_api_workers: 16 -# If ``glance_registry_workers`` is unset the system will use half the number of available VCPUS to -# compute the number of api workers to use. -# glance_registry_workers: 16 - ## Cap the maximum number of threads / workers when a user value is unspecified. glance_api_threads_max: 16 glance_api_threads: "{{ [[ansible_processor_vcpus|default(2) // 2, 1] | max, glance_api_threads_max] | min }}" @@ -265,7 +253,6 @@ glance_optional_oslomsg_amqp1_pip_packages: - oslo.messaging[amqp1] glance_api_init_overrides: {} -glance_registry_init_overrides: {} # With enabled uwsgi glance has broken functionality of # the interoperable import feature (and maybe smth else) @@ -284,13 +271,6 @@ glance_services: uwsgi_overrides: "{{ glance_api_uwsgi_ini_overrides }}" uwsgi_bind_address: "{{ glance_api_bind_address }}" uwsgi_port: "{{ glance_api_service_port }}" - glance-registry: - group: glance_registry - service_name: glance-registry - condition: "{{ glance_enable_v2_registry | bool }}" - init_config_overrides: "{{ glance_registry_init_overrides }}" - start_order: 2 - execstarts: "{{ glance_bin }}/glance-registry" # Glance uWSGI settings glance_wsgi_processes_max: 16 @@ -302,8 +282,6 @@ glance_glance_api_paste_ini_overrides: {} glance_glance_api_conf_overrides: {} glance_glance_cache_conf_overrides: {} glance_glance_manage_conf_overrides: {} -glance_glance_registry_paste_ini_overrides: {} -glance_glance_registry_conf_overrides: {} glance_glance_scrubber_conf_overrides: {} glance_glance_scheme_json_overrides: {} glance_glance_swift_store_conf_overrides: {} diff --git a/doc/source/index.rst b/doc/source/index.rst index c27f121a..dce85a68 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -10,7 +10,6 @@ OpenStack-Ansible glance role This role installs the following Systemd services: * glance-api - * glance-registry To clone or view the source code for this repository, visit the role repository for `os_glance `_. diff --git a/handlers/main.yml b/handlers/main.yml index f3ae2d12..fdeddf6f 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -28,60 +28,6 @@ - "Restart glance services" - "venv changed" -# TODO(odyssey4me): -# Assuming glance-registry is removed in the S cycle as planned, this -# task can be removed in the T cycle. -# Note that this uses shell task because the unit may not exist. When it -# does not exist, the ansible task which stops/disables it fails and it -# is important that we see failures, but get failures in the right -# circumstances. -- name: Stop and disable glance-registry when it is no longer used - shell: | - return_code=0 - if [[ "$(systemctl is-active {{ glance_services['glance-registry']['service_name'] }})" == "active" ]]; then - systemctl stop {{ glance_services['glance-registry']['service_name'] }} - return_code=2 - fi - if [[ "$(systemctl is-enabled {{ glance_services['glance-registry']['service_name'] }})" == "enabled" ]]; then - systemctl disable {{ glance_services['glance-registry']['service_name'] }} - return_code=2 - fi - exit ${return_code} - args: - executable: /bin/bash - when: - - not glance_services['glance-registry']['condition'] - register: _remove_glance_service - changed_when: _remove_glance_service.rc == 2 - failed_when: _remove_glance_service.rc not in [0, 2] - listen: - - "Restart glance services" - - "venv changed" - # This task causes ansible-lint to give a ANSIBLE0014 - # error, which does not make much sense given how the - # environment variable is used in this case. - # TODO(odyssey4me): - # Try to understand the issue ansible-lint is trying - # to highlight and address it. - tags: - - skip_ansible_lint - -# TODO(odyssey4me): -# Assuming glance-registry is removed in the S cycle as planned, this -# task can be removed in the T cycle. -- name: Clean up glance-registry init files when they are no longer needed - file: - path: "{{ item }}" - state: absent - with_items: - - "/etc/tmpfiles.d/openstack-{{ glance_services['glance-registry']['service_name'] }}.conf" - - "/etc/systemd/system/{{ glance_services['glance-registry']['service_name'] }}.service" - when: - - not glance_services['glance-registry']['condition'] - listen: - - "Restart glance services" - - "venv changed" - - name: Start services service: name: "{{ item.service_name }}" diff --git a/releasenotes/notes/glance_registry-0a1a1f8c60f5a368.yaml b/releasenotes/notes/glance_registry-0a1a1f8c60f5a368.yaml new file mode 100644 index 00000000..9f5adee1 --- /dev/null +++ b/releasenotes/notes/glance_registry-0a1a1f8c60f5a368.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - | + Glance registry service has been finally removed diff --git a/tasks/glance_install.yml b/tasks/glance_install.yml index 930d7640..9415517d 100644 --- a/tasks/glance_install.yml +++ b/tasks/glance_install.yml @@ -109,7 +109,6 @@ - path: "{{ glance_system_user_home }}/cache" - path: "{{ glance_system_user_home }}/cache/api" mode: "0700" - - path: "{{ glance_system_user_home }}/cache/registry" - path: "{{ glance_system_user_home }}/scrubber" - path: "{{ glance_system_user_home }}/{{ glance_nfs_local_directory }}" mode: "0755" diff --git a/tasks/glance_post_install.yml b/tasks/glance_post_install.yml index e490c76f..d042c577 100644 --- a/tasks/glance_post_install.yml +++ b/tasks/glance_post_install.yml @@ -63,11 +63,6 @@ dest: "{{ glance_etc_dir }}/glance-manage.conf" config_overrides: "{{ glance_glance_manage_conf_overrides }}" config_type: "ini" - - src: "glance-registry.conf.j2" - dest: "{{ glance_etc_dir }}/glance-registry.conf" - config_overrides: "{{ glance_glance_registry_conf_overrides }}" - config_type: "ini" - condition: "{{ glance_services['glance-registry']['condition'] | bool }}" - src: "glance-scrubber.conf.j2" dest: "{{ glance_etc_dir }}/glance-scrubber.conf" config_overrides: "{{ glance_glance_scrubber_conf_overrides }}" diff --git a/templates/glance-api.conf.j2 b/templates/glance-api.conf.j2 index ee6715a9..5a77ce00 100644 --- a/templates/glance-api.conf.j2 +++ b/templates/glance-api.conf.j2 @@ -12,18 +12,10 @@ http_keepalive = {{ glance_http_keepalive }} digest_algorithm = {{ glance_digest_algorithm }} backlog = 4096 workers = {{ glance_api_workers | default(glance_api_threads) }} -registry_host = {{ glance_registry_host }} -registry_port = {{ glance_registry_service_port }} -registry_client_protocol = {{ glance_service_registry_proto }} cinder_catalog_info = volume:cinder:internalURL enable_image_import = {{ not glance_use_uwsgi | bool }} enable_v2_api = {{ glance_enable_v2_api | bool }} -enable_v2_registry = {{ glance_enable_v2_registry | bool }} - -{% if glance_enable_v2_registry | bool %} -data_api = glance.db.registry.api -{% endif %} transport_url = {{ glance_oslomsg_rpc_transport }}://{% for host in glance_oslomsg_rpc_servers.split(',') %}{{ glance_oslomsg_rpc_userid }}:{{ glance_oslomsg_rpc_password }}@{{ host }}:{{ glance_oslomsg_rpc_port }}{% if not loop.last %},{% else %}/{{ glance_oslomsg_rpc_vhost }}{% if glance_oslomsg_rpc_use_ssl | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} diff --git a/templates/glance-cache.conf.j2 b/templates/glance-cache.conf.j2 index 8f182694..7e8258b1 100644 --- a/templates/glance-cache.conf.j2 +++ b/templates/glance-cache.conf.j2 @@ -11,7 +11,5 @@ admin_tenant_name = {{ glance_service_project_name }} image_cache_dir = {{ glance_system_user_home }}/cache/ image_cache_stall_time = 86400 image_cache_max_size = {{ glance_image_cache_max_size }} -registry_host = {{ glance_registry_host }} -registry_port = 9191 auth_url = {{ keystone_service_internalurl }} filesystem_store_datadir = {{ glance_system_user_home }}/images/ diff --git a/templates/glance-registry.conf.j2 b/templates/glance-registry.conf.j2 deleted file mode 100644 index 205c18dd..00000000 --- a/templates/glance-registry.conf.j2 +++ /dev/null @@ -1,63 +0,0 @@ -# {{ ansible_managed }} - -[DEFAULT] -# Disable stderr logging -use_stderr = False -debug = {{ debug }} -fatal_deprecations = {{ glance_fatal_deprecations }} -use_journal = True -bind_host = {{ glance_registry_bind_address }} -bind_port = {{ glance_registry_service_port }} -http_keepalive = {{ glance_http_keepalive }} -backlog = 4096 -workers = {{ glance_registry_workers | default(glance_api_threads) }} -api_limit_max = 1000 -limit_param_default = 25 - -enable_v2_api = {{ glance_enable_v2_api | bool }} -enable_v2_registry = {{ glance_enable_v2_registry | bool }} - -transport_url = {{ glance_oslomsg_rpc_transport }}://{% for host in glance_oslomsg_rpc_servers.split(',') %}{{ glance_oslomsg_rpc_userid }}:{{ glance_oslomsg_rpc_password }}@{{ host }}:{{ glance_oslomsg_rpc_port }}{% if not loop.last %},{% else %}/{{ glance_oslomsg_rpc_vhost }}{% if glance_oslomsg_rpc_use_ssl | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} - -[database] -connection = mysql+pymysql://{{ glance_galera_user }}:{{ glance_container_mysql_password }}@{{ glance_galera_address }}/{{ glance_galera_database }}?charset=utf8{% if glance_galera_use_ssl | bool %}&ssl_ca={{ glance_galera_ssl_ca_cert }}{% endif %} - -[keystone_authtoken] -insecure = {{ keystone_service_internaluri_insecure | bool }} -auth_type = {{ glance_keystone_auth_plugin }} -auth_url = {{ keystone_service_adminurl }} -www_authenticate_uri = {{ keystone_service_internaluri }} -project_domain_id = {{ glance_service_project_domain_id }} -user_domain_id = {{ glance_service_user_domain_id }} -project_name = {{ glance_service_project_name }} -username = {{ glance_service_user_name }} -password = {{ glance_service_password }} -region_name = {{ keystone_service_region }} - -memcached_servers = {{ glance_memcached_servers }} - -token_cache_time = 300 - -# if your memcached server is shared, use these settings to avoid cache poisoning -memcache_security_strategy = ENCRYPT -memcache_secret_key = {{ memcached_encryption_key }} - -[oslo_messaging_rabbit] -ssl = {{ glance_oslomsg_notify_use_ssl | bool }} -rabbit_notification_exchange = glance -rabbit_notification_topic = notifications - -[oslo_messaging_notifications] -driver = {% if glance_ceilometer_enabled %}messagingv2{% else %}noop{% endif %} -transport_url = {{ glance_oslomsg_notify_transport }}://{% for host in glance_oslomsg_notify_servers.split(',') %}{{ glance_oslomsg_notify_userid }}:{{ glance_oslomsg_notify_password }}@{{ host }}:{{ glance_oslomsg_notify_port }}{% if not loop.last %},{% else %}/{{ glance_oslomsg_notify_vhost }}{% if glance_oslomsg_notify_use_ssl | bool %}?ssl=1{% else %}?ssl=0{% endif %}{% endif %}{% endfor %} - -[oslo_policy] -policy_file = {{ glance_policy_file }} -policy_default_rule = {{ glance_policy_default_rule }} -policy_dirs = {{ glance_policy_dirs }} - -[paste_deploy] -flavor = keystone - -[profiler] -enabled = {{ glance_profiler_enabled }} diff --git a/tests/inventory b/tests/inventory index a5950d2e..e94b210c 100644 --- a/tests/inventory +++ b/tests/inventory @@ -36,9 +36,5 @@ openstack1 [glance_api] openstack1 -[glance_registry] -openstack1 - [glance_all:children] glance_api -glance_registry diff --git a/tox.ini b/tox.ini index 8c81bbb0..060b71cf 100644 --- a/tox.ini +++ b/tox.ini @@ -94,13 +94,6 @@ setenv = commands = bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" -[testenv:v2_registry_enabled] -setenv = - {[testenv]setenv} - ANSIBLE_PARAMETERS=-e glance_enable_v2_registry=yes -commands = - bash -c "{toxinidir}/tests/common/test-ansible-functional.sh" - [testenv:nfs] setenv = {[testenv]setenv} diff --git a/vars/main.yml b/vars/main.yml index 7da19e6f..1bebf0ea 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -63,10 +63,6 @@ glance_mount_points: |- {{ mps }} glance_core_files: - - tmp_f: "/tmp/glance-registry-paste.ini" - target_f: "{{ glance_etc_dir }}/glance-registry-paste.ini" - config_overrides: "{{ glance_glance_registry_paste_ini_overrides }}" - config_type: "ini" - tmp_f: "/tmp/glance-api-paste.ini" target_f: "{{ glance_etc_dir }}/glance-api-paste.ini" config_overrides: "{{ glance_glance_api_paste_ini_overrides }}" diff --git a/vars/redhat.yml b/vars/redhat.yml index 58cc0fa1..1387f808 100644 --- a/vars/redhat.yml +++ b/vars/redhat.yml @@ -34,11 +34,6 @@ glance_oslomsg_amqp1_distro_packages: - cyrus-sasl-md5 glance_core_files: - - tmp_f: "/tmp/glance-registry-dist-paste.ini" - target_f: "{{ (glance_install_method == 'source') | ternary((glance_etc_dir ~ '/glance-registry-paste.ini'), '/usr/share/glance/glance-registry-dist-paste.ini') }}" - target_f_override: "{{ glance_etc_dir }}/glance-registry-paste.ini" - config_overrides: "{{ glance_glance_registry_paste_ini_overrides }}" - config_type: "ini" - tmp_f: "/tmp/glance-api-dist-paste.ini" target_f: "{{ (glance_install_method == 'source') | ternary((glance_etc_dir ~ '/glance-api-paste.ini'), '/usr/share/glance/glance-api-dist-paste.ini') }}" target_f_override: "{{ glance_etc_dir }}/glance-api-paste.ini"