summaryrefslogtreecommitdiffstats
path: root/roles/openshift_node/files/bootstrap.yml
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2017-09-11 14:13:43 -0400
committerKenny Woodson <kwoodson@redhat.com>2017-10-17 15:34:00 -0400
commit47d2e205fa6c76ec66cd22b9100b561cd71e6976 (patch)
tree6dd9459a73e60282cfa204abfb00ca998e2a11d7 /roles/openshift_node/files/bootstrap.yml
parent1d75eb325c0dbfd4614ab6e6535d07a2ea3ecbc3 (diff)
downloadopenshift-47d2e205fa6c76ec66cd22b9100b561cd71e6976.tar.gz
openshift-47d2e205fa6c76ec66cd22b9100b561cd71e6976.tar.bz2
openshift-47d2e205fa6c76ec66cd22b9100b561cd71e6976.tar.xz
openshift-47d2e205fa6c76ec66cd22b9100b561cd71e6976.zip
Do not remove files for bootstrap if resolv or dns.
Diffstat (limited to 'roles/openshift_node/files/bootstrap.yml')
-rw-r--r--roles/openshift_node/files/bootstrap.yml63
1 files changed, 63 insertions, 0 deletions
diff --git a/roles/openshift_node/files/bootstrap.yml b/roles/openshift_node/files/bootstrap.yml
new file mode 100644
index 000000000..ea280640f
--- /dev/null
+++ b/roles/openshift_node/files/bootstrap.yml
@@ -0,0 +1,63 @@
+#!/usr/bin/ansible-playbook
+---
+- hosts: localhost
+ gather_facts: yes
+ vars:
+ origin_dns:
+ file: /etc/dnsmasq.d/origin-dns.conf
+ lines:
+ - regex: ^listen-address
+ state: present
+ line: "listen-address={{ ansible_default_ipv4.address }}"
+ node_dns:
+ file: /etc/dnsmasq.d/node-dnsmasq.conf
+ lines:
+ - regex: "^server=/in-addr.arpa/127.0.0.1$"
+ line: server=/in-addr.arpa/127.0.0.1
+ - regex: "^server=/cluster.local/127.0.0.1$"
+ line: server=/cluster.local/127.0.0.1
+
+ tasks:
+ - include_vars: openshift_settings.yaml
+
+ - name: set the data for node_dns
+ lineinfile:
+ create: yes
+ insertafter: EOF
+ path: "{{ node_dns.file }}"
+ regexp: "{{ item.regex }}"
+ line: "{{ item.line | default(omit) }}"
+ with_items: "{{ node_dns.lines }}"
+
+ - name: set the data for origin_dns
+ lineinfile:
+ create: yes
+ state: "{{ item.state | default('present') }}"
+ insertafter: "{{ item.after | default(omit) }}"
+ path: "{{ origin_dns.file }}"
+ regexp: "{{ item.regex }}"
+ line: "{{ item.line | default(omit)}}"
+ with_items: "{{ origin_dns.lines }}"
+
+ - when:
+ - openshift_group_type is defined
+ - openshift_group_type != ''
+ - openshift_group_type != 'master'
+ block:
+ - name: determine the openshift_service_type
+ stat:
+ path: /etc/sysconfig/atomic-openshift-node
+ register: service_type_results
+
+ - name: set openshift_service_type fact based on stat results
+ set_fact:
+ openshift_service_type: "{{ service_type_results.stat.exists | ternary('atomic-openshift', 'origin') }}"
+
+ - name: update the sysconfig to have necessary variables
+ lineinfile:
+ dest: "/etc/sysconfig/{{ openshift_service_type }}-node"
+ line: "{{ item.line }}"
+ regexp: "{{ item.regexp }}"
+ with_items:
+ - line: "BOOTSTRAP_CONFIG_NAME=node-config-{{ openshift_group_type }}"
+ regexp: "^BOOTSTRAP_CONFIG_NAME=.*"