summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sauer <esauer@redhat.com>2016-06-08 14:58:36 -0400
committerEric Sauer <esauer@redhat.com>2016-06-08 14:58:36 -0400
commite2181a706679666a6fff2e2aaca648ed982060bd (patch)
tree66008fbe9ed364e14df1ce3f3284b7d38401e1de
parent61ea8e62e232bb86d9abfb1f2acb0786a67bbb78 (diff)
downloadopenshift-e2181a706679666a6fff2e2aaca648ed982060bd.tar.gz
openshift-e2181a706679666a6fff2e2aaca648ed982060bd.tar.bz2
openshift-e2181a706679666a6fff2e2aaca648ed982060bd.tar.xz
openshift-e2181a706679666a6fff2e2aaca648ed982060bd.zip
Channging hard coded host groups to match openshift-ansible expected host groups. Importing byo playbook now instead of nested ansible run. Need to refactor how we generate hostnames to make it fit this.
-rw-r--r--roles/hostnames/tasks/main.yaml17
-rw-r--r--roles/hostnames/templates/records.template.yaml8
2 files changed, 12 insertions, 13 deletions
diff --git a/roles/hostnames/tasks/main.yaml b/roles/hostnames/tasks/main.yaml
index 700845e47..bf2fafb97 100644
--- a/roles/hostnames/tasks/main.yaml
+++ b/roles/hostnames/tasks/main.yaml
@@ -1,23 +1,22 @@
---
- 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"
+ hostname: name="{% for thishost in groups['masters'] %}{% if inventory_hostname == thishost %}master{{ counter }}.{{ dns_domain }}{% endif %}{% set counter = counter + 1 %}{% endfor %}"
+ when: "'masters' in group_names"
- name: Setting facts for masters
- set_fact: ansible_hostname="{% for thishost in groups['openshift_masters'] %}{% if inventory_hostname == thishost %}master{{ counter }}{% endif %}{% set counter = counter + 1 %}{% endfor %}"
- when: "'openshift_masters' in group_names"
+ set_fact: ansible_hostname="{% for thishost in groups['masters'] %}{% if inventory_hostname == thishost %}master{{ counter }}{% endif %}{% set counter = counter + 1 %}{% endfor %}"
+ when: "'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"
+ hostname: name="{% for thishost in groups['nodes'] %}{% if inventory_hostname == thishost %}node{{ counter }}.{{ dns_domain }}{% endif %}{% set counter = counter + 1 %}{% endfor %}"
+ when: "'nodes' in group_names"
- name: Setting facts for nodes
- set_fact: ansible_hostname="{% for thishost in groups['openshift_nodes'] %}{% if inventory_hostname == thishost %}node{{ counter }}{% endif %}{% set counter = counter + 1 %}{% endfor %}"
- when: "'openshift_nodes' in group_names"
+ set_fact: ansible_hostname="{% for thishost in groups['nodes'] %}{% if inventory_hostname == thishost %}node{{ counter }}{% endif %}{% set counter = counter + 1 %}{% endfor %}"
+ when: "'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"
diff --git a/roles/hostnames/templates/records.template.yaml b/roles/hostnames/templates/records.template.yaml
index a916fd2b3..2f2420464 100644
--- a/roles/hostnames/templates/records.template.yaml
+++ b/roles/hostnames/templates/records.template.yaml
@@ -3,12 +3,12 @@ dns_records_add:
- view: private
zone: {{ dns_domain }}
entries:
-{% for mst in groups['openshift_masters'] %}
+{% for mst in groups['masters'] %}
- type: A
hostname: {{ hostvars[mst]['ansible_hostname'] }}
ip: {{ hostvars[mst]['dns_private_ip'] }}
{% endfor %}
-{% for node in groups['openshift_nodes'] %}
+{% for node in groups['nodes'] %}
- type: A
hostname: {{ hostvars[node]['ansible_hostname'] }}
ip: {{ hostvars[node]['dns_private_ip'] }}
@@ -16,12 +16,12 @@ dns_records_add:
- view: public
zone: {{ dns_domain}}
entries:
-{% for mst in groups['openshift_masters']%}
+{% for mst in groups['masters']%}
- type: A
hostname: {{ hostvars[mst]['ansible_hostname'] }}
ip: {{ hostvars[mst]['dns_public_ip'] }}
{% endfor %}
-{% for node in groups['openshift_nodes'] %}
+{% for node in groups['nodes'] %}
- type: A
hostname: {{ hostvars[node]['ansible_hostname'] }}
ip: {{ hostvars[node]['dns_public_ip'] }}