b1ea2ce1e3
'with_' clauses are evaluated before 'when' clauses. In Ansible 1.9 the task is silently skipped when a variable within a 'with_' clause is undefined, Ansible 2 provides a deprecation warning. Separate the task deploying a user provided ssl cert and key into two and check them individually for 'rabbitmq_user_ssl_cert' or 'rabbitmq_user_ssl_key' being defined. Change-Id: I68afa3066ad88ecae95fcb29c78764d02dc38627
56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
---
|
|
# Copyright 2015, Rackspace US, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
# If we have a user-provided SSL certificate from
|
|
# /etc/openstack_deploy/user_variables.yml, we should deploy that certificate
|
|
# and key to each RabbitMQ container.
|
|
- name: Deploy user provided ssl cert
|
|
copy:
|
|
src: "{{ rabbitmq_user_ssl_cert }}"
|
|
dest: "{{ rabbitmq_ssl_cert }}"
|
|
owner: "rabbitmq"
|
|
group: "rabbitmq"
|
|
mode: "0644"
|
|
when: rabbitmq_user_ssl_cert is defined
|
|
tags:
|
|
- rabbitmq-configs
|
|
- rabbitmq-ssl
|
|
|
|
- name: Deploy user provided ssl key
|
|
copy:
|
|
src: "{{ rabbitmq_user_ssl_key }}"
|
|
dest: "{{ rabbitmq_ssl_key }}"
|
|
owner: "rabbitmq"
|
|
group: "rabbitmq"
|
|
mode: "0600"
|
|
when: rabbitmq_user_ssl_key is defined
|
|
tags:
|
|
- rabbitmq-configs
|
|
- rabbitmq-ssl
|
|
|
|
# Deploy the user provided CA certificate as well (if the user defined it
|
|
# within /etc/openstack_deploy/user_variables.yml).
|
|
- name: Deploy user provided ssl CA cert
|
|
copy:
|
|
src: "{{ rabbitmq_user_ssl_ca_cert }}"
|
|
dest: "{{ rabbitmq_ssl_ca_cert }}"
|
|
owner: "rabbitmq"
|
|
group: "rabbitmq"
|
|
mode: "0644"
|
|
when: rabbitmq_user_ssl_ca_cert is defined
|
|
tags:
|
|
- keystone-configs
|
|
- keystone-ssl
|