summaryrefslogtreecommitdiffstats
path: root/roles/hostnames/tasks/main.yaml
blob: c34d079158877dafa2aa3667ca9e0a96d4c59ebe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
---
  - name: Setting master(s) hostname
    hostname: name="{% for thishost in groups['openshift_masters'] %}{% if inventory_hostname == thishost %}master{{ counter }}.{{ dns_domain }}{% endif %}{% set counter = counter + 1 %}{% endfor %}"
    when: "'openshift_masters' in group_names"

  - name: Setting node(s) hostname
    hostname: name="{% for thishost in groups['openshift_nodes'] %}{% if inventory_hostname == thishost %}node{{ counter }}.{{ dns_domain }}{% endif %}{% set counter = counter + 1 %}{% endfor %}"
    when: "'openshift_nodes' in group_names"

  - name: "Templating records"
    become: false
    remote_user: cloud-user
    template:
      src: "{{ role_path }}/templates/records.template.yaml"
      dest: "/tmp/records.yaml"
      force: yes
    delegate_to: localhost

  - name: "Updating hostname facts"
    setup: filter=ansible_hostname