Grzegorz Grasza 331d8e0133 Add tripleo_ipa_dns role
The new role adds DNS entries, using TripleO's hosts_entry var,
which contains host entries in a format similar to /etc/hosts.

Change-Id: I91b8d1e67f381da8abe2317f62327e8a5ed4a367
2020-04-03 11:51:08 +02:00

37 lines
1.1 KiB
YAML

---
# Copyright 2020 Red Hat, Inc.
# All Rights Reserved.
#
# 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.
#
# This role adds a host entries to FreeIPA, as defined in the host_entry variable.
#
# The following variables are required:
# - cloud_domain (Base domain, eg. example.com)
# - host_entry (host entries string, in a format similar to /etc/hosts)
- name: split host entries
set_fact:
hosts_entries_list: "{{ hosts_entry.splitlines() }}"
- name: add cloud_domain dns zone
ipa_dnszone:
zone_name: "{{ cloud_domain }}"
- name: add dns records
include_tasks:
file: dns.yaml
loop: "{{ hosts_entries_list }}"
when: item != ''