summaryrefslogtreecommitdiffstats
path: root/roles/openshift_node/tasks/dnsmasq_install.yml
diff options
context:
space:
mode:
authorMichael Gugino <mgugino@redhat.com>2017-12-08 18:30:09 -0500
committerMichael Gugino <mgugino@redhat.com>2017-12-12 18:00:05 -0500
commita6d5c625956a5051b7bbd9fc48430b9df11084ee (patch)
treed6ad72c967c3fcf2bdecb195b93f03a4c4941b47 /roles/openshift_node/tasks/dnsmasq_install.yml
parent1dccaa2ad90b363cf7f2c04d5781693e69451ffb (diff)
downloadopenshift-a6d5c625956a5051b7bbd9fc48430b9df11084ee.tar.gz
openshift-a6d5c625956a5051b7bbd9fc48430b9df11084ee.tar.bz2
openshift-a6d5c625956a5051b7bbd9fc48430b9df11084ee.tar.xz
openshift-a6d5c625956a5051b7bbd9fc48430b9df11084ee.zip
Refactor node upgrade to include less serial tasks
This commit moves the pulling of images, packages, and updating config files into a non-serialized play. The serialized play is now in charge of marking unschedulable, draining, stopping and restarting services, and marking schedulable. If rpm install / container download takes 60s per host, this will save 3 hours and 10 minutes at 200 hosts per cluster and forks of 20 hosts.
Diffstat (limited to 'roles/openshift_node/tasks/dnsmasq_install.yml')
-rw-r--r--roles/openshift_node/tasks/dnsmasq_install.yml43
1 files changed, 43 insertions, 0 deletions
diff --git a/roles/openshift_node/tasks/dnsmasq_install.yml b/roles/openshift_node/tasks/dnsmasq_install.yml
new file mode 100644
index 000000000..9f66bf12d
--- /dev/null
+++ b/roles/openshift_node/tasks/dnsmasq_install.yml
@@ -0,0 +1,43 @@
+---
+- name: Check for NetworkManager service
+ command: >
+ systemctl show NetworkManager
+ register: nm_show
+ changed_when: false
+ ignore_errors: True
+
+- name: Set fact using_network_manager
+ set_fact:
+ network_manager_active: "{{ True if 'ActiveState=active' in nm_show.stdout else False }}"
+
+- name: Install dnsmasq
+ package: name=dnsmasq state=installed
+ when: not openshift.common.is_atomic | bool
+ register: result
+ until: result | success
+
+- name: ensure origin/node directory exists
+ file:
+ state: directory
+ path: "{{ item }}"
+ owner: root
+ group: root
+ mode: '0700'
+ with_items:
+ - /etc/origin
+ - /etc/origin/node
+
+# this file is copied to /etc/dnsmasq.d/ when the node starts and is removed
+# when the node stops. A dbus-message is sent to dnsmasq to add the same entries
+# so that dnsmasq doesn't need to be restarted. Once we can use dnsmasq 2.77 or
+# newer we can use --server-file option to update the servers dynamically and
+# reload them by sending dnsmasq a SIGHUP. We write the file in case someone else
+# triggers a restart of dnsmasq but not a node restart.
+- name: Install node-dnsmasq.conf
+ template:
+ src: node-dnsmasq.conf.j2
+ dest: /etc/origin/node/node-dnsmasq.conf
+
+# Relies on ansible in order to configure static config
+- include_tasks: dnsmasq/no-network-manager.yml
+ when: not network_manager_active | bool