diff --git a/defaults/main.yml b/defaults/main.yml index 1a09afe2..600e0573 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,8 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Enable/Disable Ceilometer +# Enable/Disable Telemetry projects swift_ceilometer_enabled: False +swift_gnocchi_enabled: False ## Verbosity Options debug: False diff --git a/tasks/swift_service_setup.yml b/tasks/swift_service_setup.yml index 9ab581cf..ec9f53df 100644 --- a/tasks/swift_service_setup.yml +++ b/tasks/swift_service_setup.yml @@ -168,3 +168,31 @@ until: add_service|success retries: 5 delay: 10 + +# KNOWN ISSUE(stevelle) Never fail. Swift playbook runs before Gnocchi in a +# standard deploy. The project for Gnocchi will not have been created yet. +# There is a known issue in project / user / role lifecycles that causes a +# circular service dependency here. The Swift playbook must be run a second +# time, after the Gnocchi playbook runs, when it uses Swift storage as a +# workaround. +- name: Get Gnocchi project id + keystone: + command: get_project + tenant_name: "{{ gnocchi_service_project_name }}" + endpoint: "{{ keystone_service_adminurl }}" + login_user: "{{ keystone_admin_user_name }}" + login_password: "{{ keystone_auth_admin_password }}" + login_project_name: "{{ keystone_admin_tenant_name }}" + insecure: "{{ keystone_service_adminuri_insecure }}" + register: get_gnocchi_project + failed_when: False + when: + - swift_gnocchi_enabled | bool + - swift_gnocchi_service_project_id is not defined + +- name: Store Gnocchi project id + set_fact: + swift_gnocchi_service_project_id: "{{ keystone_facts.id }}" + when: + - swift_gnocchi_enabled | bool + - get_gnocchi_project | success diff --git a/templates/proxy-server.conf.j2 b/templates/proxy-server.conf.j2 index 8c0aec91..957f4aaf 100644 --- a/templates/proxy-server.conf.j2 +++ b/templates/proxy-server.conf.j2 @@ -190,5 +190,8 @@ driver = messagingv2 url = rabbit://{% for host in swift_rabbitmq_telemetry_servers.split(',') %}{{ swift_rabbitmq_telemetry_userid }}:{{ swift_rabbitmq_telemetry_password }}@{{ host }}:{{ swift_rabbitmq_telemetry_port }}{% if not loop.last %},{% else %}/{{ swift_rabbitmq_telemetry_vhost }}{% endif %}{% endfor %} topic = notifications +{% if swift_gnocchi_service_project_id is defined %} +ignore_projects = "{{ swift_gnocchi_service_project_id }}"" +{% endif %} log_level = WARN {% endif %}