5ba88401eb
This commit add CentOS support to os_designate Change-Id: Idfae25a8a769348da629bc0a4a79d1ee56d60aad
81 lines
2.8 KiB
YAML
81 lines
2.8 KiB
YAML
---
|
|
# Copyright 2016, 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.
|
|
|
|
- name: Playbook for deploying designate
|
|
hosts: designate_all
|
|
user: root
|
|
gather_facts: true
|
|
pre_tasks:
|
|
- include: common/ensure-rabbitmq.yml
|
|
vhost_name: "{{ designate_rabbitmq_vhost }}"
|
|
user_name: "{{ designate_rabbitmq_userid }}"
|
|
user_password: "{{ designate_rabbitmq_password }}"
|
|
- include: common/create-grant-db.yml
|
|
db_name: "{{ designate_galera_user }}"
|
|
db_password: "{{ designate_galera_password }}"
|
|
- include: common/create-grant-db.yml
|
|
db_name: "{{ designate_pool_manager_galera_database }}"
|
|
db_password: "{{ designate_pool_manager_galera_password }}"
|
|
- name: Install bind9
|
|
package:
|
|
name: "{{ bind_package_name }}"
|
|
state: present
|
|
- name: Drop bind configuration
|
|
copy:
|
|
src: "{{ named_src_file }}"
|
|
dest: "{{ named_config_file }}"
|
|
- name: fix perms for named directory (centos)
|
|
file:
|
|
mode: '770'
|
|
state: directory
|
|
path: '/var/named/'
|
|
owner: 'root'
|
|
group: 'named'
|
|
when:
|
|
- ansible_pkg_mgr == 'yum'
|
|
- name: Restart bind9
|
|
service:
|
|
name: "{{ bind_service_name }}"
|
|
state: "{{ bind_service_state }}"
|
|
vars:
|
|
named_config_file: "{{ (ansible_pkg_mgr == 'apt') | ternary('/etc/bind/named.conf.options','/etc/named.conf') }}"
|
|
named_src_file: "{{ (ansible_pkg_mgr == 'apt') | ternary('named.conf.options','named.conf') }}"
|
|
bind_package_name: "{{ (ansible_pkg_mgr == 'apt') | ternary('bind9','bind') }}"
|
|
bind_service_name: "{{ (ansible_pkg_mgr == 'apt') | ternary('bind9','named') }}"
|
|
bind_service_state: "{{ (ansible_pkg_mgr == 'apt') | ternary('restarted','started') }}"
|
|
roles:
|
|
- role: "os_designate"
|
|
vars_files:
|
|
- common/test-vars.yml
|
|
|
|
|
|
- name: Import pools
|
|
hosts: designate_all[0]
|
|
user: root
|
|
gather_facts: true
|
|
tasks:
|
|
- name: Copy sample pools.yaml file
|
|
copy:
|
|
src: "{{ sample_pool_file }}"
|
|
dest: /etc/designate/pools.yaml
|
|
- name: Import sample pools.yaml file
|
|
shell: |
|
|
. /root/openrc
|
|
{{ designate_bin }}/designate-manage pool update --file /etc/designate/pools.yaml
|
|
vars:
|
|
sample_pool_file: "{{ (ansible_pkg_mgr == 'apt') | ternary('pools.yaml.sample','pools.yaml.sample.centos') }}"
|
|
vars_files:
|
|
- common/test-vars.yml
|