summaryrefslogtreecommitdiffstats
path: root/playbooks/provisioning/openstack/post-provision-openstack.yml
blob: d65e075b80bab87b60b1a39a32a08e13df05715c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---

# Assign hostnames
- hosts: cluster_hosts
  pre_tasks:
  - include: roles/common/pre_tasks/pre_tasks.yml
  roles:
  - role: hostnames

# Subscribe DNS Host to allow for configuration below
- hosts: dns
  roles:
    - { role: subscription-manager, when: hostvars.localhost.rhsm_register, tags: 'subscription-manager', ansible_sudo: true }

# Determine which DNS server(s) to use for our generated records
- hosts: localhost
  roles: 
  - dns-server-detect

# Build the DNS Server Views and Configure DNS Server(s)
- hosts: dns
  pre_tasks:
  - include: roles/common/pre_tasks/pre_tasks.yml
  - name: "Generate dns-server views"
    include: openstack_dns_views.yml
  roles:
  - role: dns-server

# Build and process DNS Records
- hosts: localhost
  pre_tasks:
  - include: roles/common/pre_tasks/pre_tasks.yml
  - name: "Generate dns records"
    include: openstack_dns_records.yml
  roles:
  - role: dns

# Use newly configured DNS server for this container ...
- hosts: localhost
  tasks:
  - name: "Edit /etc/resolv.conf in container"
    shell: "sed '0,/.*nameserver.*/s/.*nameserver.*/nameserver {{ public_dns_server }} \\n&/' /etc/resolv.conf > /tmp/resolv.conf && /bin/cp -f /tmp/resolv.conf /etc/resolv.conf"

# OpenShift Pre-Requisites
- hosts: OSEv3
  tasks:
  - name: "Edit /etc/resolv.conf on masters/nodes"
    lineinfile:
      state: present
      dest: /etc/resolv.conf
      regexp: "nameserver {{ hostvars['localhost'].private_dns_server }}"
      line: "nameserver {{ hostvars['localhost'].private_dns_server }}"
      insertafter: search*
  - name: "Include DNS configuration to ensure proper name resolution"
    lineinfile:
      state: present
      dest: /etc/sysconfig/network
      regexp: "IP4_NAMESERVERS={{ hostvars['localhost'].private_dns_server }}"
      line: "IP4_NAMESERVERS={{ hostvars['localhost'].private_dns_server }}"