Bladeren bron

Combine openshift_node and openshift_node_upgrade

Currently, having openshift_node and openshift_node_upgrade
as two distinct roles has created a duplication across
handlers, templates, and some tasks.

This commit combines the roles to reduce duplication
and bugs encountered by not putting code in both places.
Michael Gugino 7 jaren geleden
bovenliggende
commit
afa4fd5799
28 gewijzigde bestanden met toevoegingen van 25 en 483 verwijderingen
  1. 5 5
      playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml
  2. 10 8
      playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml
  3. 6 0
      roles/openshift_node/meta/main.yml
  4. 0 0
      roles/openshift_node/tasks/config/install-node-docker-service-file.yml
  5. 0 0
      roles/openshift_node/tasks/docker/upgrade.yml
  6. 3 3
      roles/openshift_node_upgrade/tasks/main.yml
  7. 1 1
      roles/openshift_node_upgrade/tasks/containerized_node_upgrade.yml
  8. 0 0
      roles/openshift_node/tasks/upgrade/restart.yml
  9. 0 0
      roles/openshift_node/tasks/upgrade/rpm_upgrade.yml
  10. 0 111
      roles/openshift_node_upgrade/README.md
  11. 0 15
      roles/openshift_node_upgrade/defaults/main.yml
  12. 0 25
      roles/openshift_node_upgrade/files/nuke_images.sh
  13. 0 36
      roles/openshift_node_upgrade/handlers/main.yml
  14. 0 13
      roles/openshift_node_upgrade/meta/main.yml
  15. 0 16
      roles/openshift_node_upgrade/tasks/config/configure-node-settings.yml
  16. 0 17
      roles/openshift_node_upgrade/tasks/config/configure-proxy-settings.yml
  17. 0 8
      roles/openshift_node_upgrade/tasks/config/install-node-deps-docker-service-file.yml
  18. 0 8
      roles/openshift_node_upgrade/tasks/config/install-ovs-docker-service-file.yml
  19. 0 8
      roles/openshift_node_upgrade/tasks/config/install-ovs-service-env-file.yml
  20. 0 13
      roles/openshift_node_upgrade/tasks/config/workaround-bz1331590-ovs-oom-fix.yml
  21. 0 46
      roles/openshift_node_upgrade/tasks/registry_auth.yml
  22. 0 37
      roles/openshift_node_upgrade/tasks/systemd_units.yml
  23. 0 31
      roles/openshift_node_upgrade/templates/node.service.j2
  24. 0 11
      roles/openshift_node_upgrade/templates/openshift.docker.node.dep.service
  25. 0 50
      roles/openshift_node_upgrade/templates/openshift.docker.node.service
  26. 0 3
      roles/openshift_node_upgrade/templates/openvswitch-avoid-oom.conf
  27. 0 17
      roles/openshift_node_upgrade/templates/openvswitch.docker.service
  28. 0 1
      roles/openshift_node_upgrade/templates/openvswitch.sysconfig.j2

+ 5 - 5
playbooks/common/openshift-cluster/upgrades/upgrade_control_plane.yml

@@ -317,13 +317,13 @@
     delay: 60
 
   roles:
-  - lib_openshift
   - openshift_facts
-  - docker
-  - openshift_node_dnsmasq
-  - openshift_node_upgrade
-
   post_tasks:
+  - include_role:
+      name: openshift_node
+      tasks_from: upgrade.yml
+    vars:
+      openshift_node_upgrade_in_progress: True
   - name: Set node schedulability
     oc_adm_manage_node:
       node: "{{ openshift.node.nodename | lower }}"

+ 10 - 8
playbooks/common/openshift-cluster/upgrades/upgrade_nodes.yml

@@ -34,16 +34,18 @@
     delay: 60
 
   roles:
-  - lib_openshift
   - openshift_facts
-  - docker
-  - openshift_node_dnsmasq
-  - openshift_node_upgrade
-  - role: openshift_excluder
-    r_openshift_excluder_action: enable
-    r_openshift_excluder_service_type: "{{ openshift.common.service_type }}"
-
   post_tasks:
+  - include_role:
+      name: openshift_node
+      tasks_from: upgrade.yml
+    vars:
+      openshift_node_upgrade_in_progress: True
+  - include_role:
+      name: openshift_excluder
+    vars:
+      r_openshift_excluder_action: enable
+      r_openshift_excluder_service_type: "{{ openshift.common.service_type }}"
   - name: Set node schedulability
     oc_adm_manage_node:
       node: "{{ openshift.node.nodename | lower }}"

+ 6 - 0
roles/openshift_node/meta/main.yml

@@ -13,9 +13,15 @@ galaxy_info:
   - cloud
 dependencies:
 - role: openshift_node_facts
+  when: not (openshift_node_upgrade_in_progress | default(False))
 - role: lib_openshift
 - role: lib_os_firewall
+  when: not (openshift_node_upgrade_in_progress | default(False))
 - role: openshift_clock
+  when: not (openshift_node_upgrade_in_progress | default(False))
 - role: openshift_docker
 - role: openshift_cloud_provider
+  when: not (openshift_node_upgrade_in_progress | default(False))
 - role: openshift_node_dnsmasq
+- role: lib_utils
+  when: openshift_node_upgrade_in_progress | default(False)

roles/openshift_node_upgrade/tasks/config/install-node-docker-service-file.yml → roles/openshift_node/tasks/config/install-node-docker-service-file.yml


roles/openshift_node_upgrade/tasks/docker/upgrade.yml → roles/openshift_node/tasks/docker/upgrade.yml


+ 3 - 3
roles/openshift_node_upgrade/tasks/main.yml

@@ -59,7 +59,7 @@
 - include: "{{ node_config_hook }}"
   when: node_config_hook is defined
 
-- include: rpm_upgrade.yml
+- include: upgrade/rpm_upgrade.yml
   vars:
     component: "node"
     openshift_version: "{{ openshift_pkg_version | default('') }}"
@@ -70,7 +70,7 @@
     path: "/etc/systemd/system/docker.service.d/docker-sdn-ovs.conf"
     state: absent
 
-- include: containerized_node_upgrade.yml
+- include: upgrade/containerized_node_upgrade.yml
   when: openshift.common.is_containerized | bool
 
 - name: Ensure containerized services stopped before Docker restart
@@ -165,7 +165,7 @@
     value: "/etc/origin/node/resolv.conf"
 
 # Restart all services
-- include: restart.yml
+- include: upgrade/restart.yml
 
 - name: Wait for node to be ready
   oc_obj:

+ 1 - 1
roles/openshift_node_upgrade/tasks/containerized_node_upgrade.yml

@@ -6,7 +6,7 @@
     skip_node_svc_handlers: True
 
 - name: Update systemd units
-  include: systemd_units.yml
+  include: ../systemd_units.yml
 
 # This is a no-op because of skip_node_svc_handlers, but lets us trigger it before end of
 # play when the node has already been marked schedulable again. (this would look strange

roles/openshift_node_upgrade/tasks/restart.yml → roles/openshift_node/tasks/upgrade/restart.yml


roles/openshift_node_upgrade/tasks/rpm_upgrade.yml → roles/openshift_node/tasks/upgrade/rpm_upgrade.yml


+ 0 - 111
roles/openshift_node_upgrade/README.md

@@ -1,111 +0,0 @@
-OpenShift Node upgrade
-=========
-
-Role responsible for a single node upgrade.
-It is expected a node is functioning and a part of an OpenShift cluster.
-
-Requirements
-------------
-
-TODO
-
-Role Variables
---------------
-From this role:
-
-| Name                           | Default value         |                                                        |
-|--------------------------------|-----------------------|--------------------------------------------------------|
-| deployment_type                |                       | Inventory var                                          |
-| docker_upgrade_nuke_images     |                       | Optional inventory var                                 |
-| docker_version                 |                       | Optional inventory var                                 |
-| l_docker_upgrade               |                       |                                                        |
-| node_config_hook               |                       |                                                        |
-| openshift.docker.gte_1_10      |                       |                                                        |
-| openshift_image_tag            |                       | Set by openshift_version role                          |
-| openshift_pkg_version          |                       | Set by openshift_version role                          |
-| openshift_release              |                       | Set by openshift_version role                          |
-| skip_docker_restart            |                       |                                                        |
-| openshift_cloudprovider_kind   |                       |                                                        |
-
-From openshift.common:
-
-| Name                               |  Default Value      |                     |
-|------------------------------------|---------------------|---------------------|
-| openshift.common.config_base       |---------------------|---------------------|
-| openshift.common.hostname          |---------------------|---------------------|
-| openshift.common.http_proxy        |---------------------|---------------------|
-| openshift.common.is_atomic         |---------------------|---------------------|
-| openshift.common.is_containerized  |---------------------|---------------------|
-| openshift.common.portal_net        |---------------------|---------------------|
-| openshift.common.service_type      |---------------------|---------------------|
-
-From openshift.master:
-
-| Name                               |  Default Value      |                     |
-|------------------------------------|---------------------|---------------------|
-| openshift.master.api_port          |---------------------|---------------------|
-
-From openshift.node:
-
-| Name                               |  Default Value      |                     |
-|------------------------------------|---------------------|---------------------|
-| openshift.node.node_image          |---------------------|---------------------|
-| openshift.node.ovs_image           |---------------------|---------------------|
-
-
-Dependencies
-------------
-
-
-TODO
-
-Example Playbook
-----------------
-
-Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
-
-```
----
-- name: Upgrade nodes
-  hosts: oo_nodes_to_upgrade
-  serial: 1
-  any_errors_fatal: true
-
-  pre_tasks:
-  - name: Mark unschedulable
-    command: >
-      {{ hostvars[groups.oo_first_master.0].openshift.common.client_binary }} adm manage-node {{ openshift.node.nodename | lower }} --schedulable=false
-    delegate_to: "{{ groups.oo_first_master.0 }}"
-
-  - name: Drain Node for Kubelet upgrade
-    command: >
-      {{ hostvars[groups.oo_first_master.0].openshift.common.admin_binary }} drain {{ openshift.node.nodename | lower }} --force --delete-local-data --ignore-daemonsets
-    delegate_to: "{{ groups.oo_first_master.0 }}"
-    register: l_docker_upgrade_drain_result
-    until: not l_docker_upgrade_drain_result | failed
-    retries: 60
-    delay: 60
-
-
-  roles:
-  - openshift_facts
-  - docker
-  - openshift_node_dnsmasq
-  - openshift_node_upgrade
-
-  post_tasks:
-  - name: Set node schedulability
-    command: >
-      {{ hostvars[groups.oo_first_master.0].openshift.common.client_binary }} adm manage-node {{ openshift.node.nodename | lower }} --schedulable=true
-    delegate_to: "{{ groups.oo_first_master.0 }}"
-```
-
-License
--------
-
-Apache License, Version 2.0
-
-Author Information
-------------------
-
-TODO

+ 0 - 15
roles/openshift_node_upgrade/defaults/main.yml

@@ -1,15 +0,0 @@
----
-openshift_node_debug_level: "{{ debug_level | default(2) }}"
-
-openshift_use_openshift_sdn: True
-os_sdn_network_plugin_name: "redhat/openshift-ovs-subnet"
-
-openshift_node_data_dir_default: "{{ openshift_data_dir | default('/var/lib/origin') }}"
-openshift_node_data_dir: "{{ openshift_node_data_dir_default }}"
-
-# oreg_url is defined by user input
-oreg_host: "{{ oreg_url.split('/')[0] if (oreg_url is defined and '.' in oreg_url.split('/')[0]) else '' }}"
-oreg_auth_credentials_path: "{{ openshift_node_data_dir }}/.docker"
-oreg_auth_credentials_replace: False
-l_bind_docker_reg_auth: False
-openshift_docker_alternative_creds: "{{ (openshift_docker_use_system_container | default(False)) or (openshift_use_crio_only | default(False)) }}"

+ 0 - 25
roles/openshift_node_upgrade/files/nuke_images.sh

@@ -1,25 +0,0 @@
-#!/bin/bash
-
-# Stop any running containers
-running_container_ids=`docker ps -q`
-if test -n "$running_container_ids"
-then
-    docker stop $running_container_ids
-fi
-
-# Delete all containers
-container_ids=`docker ps -a -q`
-if test -n "$container_ids"
-then
-    docker rm -f -v $container_ids
-fi
-
-# Delete all images (forcefully)
-image_ids=`docker images -aq`
-if test -n "$image_ids"
-then
-    # Some layers are deleted recursively and are no longer present
-    # when docker goes to remove them:
-    docker rmi -f `docker images -aq` || true
-fi
-

+ 0 - 36
roles/openshift_node_upgrade/handlers/main.yml

@@ -1,36 +0,0 @@
----
-- name: restart openvswitch
-  systemd:
-    name: openvswitch
-    state: restarted
-  when:
-  - not skip_node_svc_handlers | default(False) | bool
-  - not (ovs_service_status_changed | default(false) | bool)
-  - openshift_use_openshift_sdn | bool
-  register: l_openshift_node_upgrade_stop_openvswitch_result
-  until: not l_openshift_node_upgrade_stop_openvswitch_result | failed
-  retries: 3
-  delay: 30
-  notify:
-  - restart openvswitch pause
-
-- name: restart openvswitch pause
-  pause: seconds=15
-  when: (not skip_node_svc_handlers | default(False) | bool) and openshift.common.is_containerized | bool
-
-- name: restart node
-  systemd:
-    name: "{{ openshift.common.service_type }}-node"
-    state: restarted
-  register: l_openshift_node_upgrade_restart_node_result
-  until: not l_openshift_node_upgrade_restart_node_result | failed
-  retries: 3
-  delay: 30
-  when:
-  - (not skip_node_svc_handlers | default(False) | bool)
-  - not (node_service_status_changed | default(false) | bool)
-
-# TODO(jchaloup): once it is verified the systemd module works as expected
-# switch to it: http://docs.ansible.com/ansible/latest/systemd_module.html
-- name: reload systemd units
-  command: systemctl daemon-reload

+ 0 - 13
roles/openshift_node_upgrade/meta/main.yml

@@ -1,13 +0,0 @@
----
-galaxy_info:
-  author: your name
-  description: OpenShift Node upgrade
-  company: Red Hat, Inc.
-  license: Apache License, Version 2.0
-  min_ansible_version: 2.1
-  platforms:
-  - name: EL
-    versions:
-    - 7
-dependencies:
-- role: lib_utils

+ 0 - 16
roles/openshift_node_upgrade/tasks/config/configure-node-settings.yml

@@ -1,16 +0,0 @@
----
-- name: Configure Node settings
-  lineinfile:
-    dest: /etc/sysconfig/{{ openshift.common.service_type }}-node
-    regexp: "{{ item.regex }}"
-    line: "{{ item.line }}"
-    create: true
-  with_items:
-  - regex: '^OPTIONS='
-    line: "OPTIONS=--loglevel={{ openshift_node_debug_level }}"
-  - regex: '^CONFIG_FILE='
-    line: "CONFIG_FILE={{ openshift.common.config_base }}/node/node-config.yaml"
-  - regex: '^IMAGE_VERSION='
-    line: "IMAGE_VERSION={{ openshift_image_tag }}"
-  notify:
-  - restart node

+ 0 - 17
roles/openshift_node_upgrade/tasks/config/configure-proxy-settings.yml

@@ -1,17 +0,0 @@
----
-- name: Configure Proxy Settings
-  lineinfile:
-    dest: /etc/sysconfig/{{ openshift.common.service_type }}-node
-    regexp: "{{ item.regex }}"
-    line: "{{ item.line }}"
-    create: true
-  with_items:
-  - regex: '^HTTP_PROXY='
-    line: "HTTP_PROXY={{ openshift.common.http_proxy | default('') }}"
-  - regex: '^HTTPS_PROXY='
-    line: "HTTPS_PROXY={{ openshift.common.https_proxy | default('') }}"
-  - regex: '^NO_PROXY='
-    line: "NO_PROXY={{ openshift.common.no_proxy | default([]) }},{{ openshift.common.portal_net }},{{ hostvars[groups.oo_first_master.0].openshift.master.sdn_cluster_network_cidr }}"
-  when: ('http_proxy' in openshift.common and openshift.common.http_proxy != '')
-  notify:
-  - restart node

+ 0 - 8
roles/openshift_node_upgrade/tasks/config/install-node-deps-docker-service-file.yml

@@ -1,8 +0,0 @@
----
-- name: Install Node dependencies docker service file
-  template:
-    dest: "/etc/systemd/system/{{ openshift.common.service_type }}-node-dep.service"
-    src: openshift.docker.node.dep.service
-  notify:
-  - reload systemd units
-  - restart node

+ 0 - 8
roles/openshift_node_upgrade/tasks/config/install-ovs-docker-service-file.yml

@@ -1,8 +0,0 @@
----
-- name: Install OpenvSwitch docker service file
-  template:
-    dest: "/etc/systemd/system/openvswitch.service"
-    src: openvswitch.docker.service
-  notify:
-  - reload systemd units
-  - restart openvswitch

+ 0 - 8
roles/openshift_node_upgrade/tasks/config/install-ovs-service-env-file.yml

@@ -1,8 +0,0 @@
----
-- name: Create the openvswitch service env file
-  template:
-    src: openvswitch.sysconfig.j2
-    dest: /etc/sysconfig/openvswitch
-  notify:
-  - reload systemd units
-  - restart openvswitch

+ 0 - 13
roles/openshift_node_upgrade/tasks/config/workaround-bz1331590-ovs-oom-fix.yml

@@ -1,13 +0,0 @@
----
-# May be a temporary workaround.
-# https://bugzilla.redhat.com/show_bug.cgi?id=1331590
-- name: Create OpenvSwitch service.d directory
-  file: path=/etc/systemd/system/openvswitch.service.d/ state=directory
-
-- name: Install OpenvSwitch service OOM fix
-  template:
-    dest: "/etc/systemd/system/openvswitch.service.d/01-avoid-oom.conf"
-    src: openvswitch-avoid-oom.conf
-  notify:
-  - reload systemd units
-  - restart openvswitch

+ 0 - 46
roles/openshift_node_upgrade/tasks/registry_auth.yml

@@ -1,46 +0,0 @@
----
-- name: Check for credentials file for registry auth
-  stat:
-    path: "{{ oreg_auth_credentials_path }}"
-  when: oreg_auth_user is defined
-  register: node_oreg_auth_credentials_stat
-
-- name: Create credentials for registry auth
-  command: "docker --config={{ oreg_auth_credentials_path }} login -u {{ oreg_auth_user }} -p {{ oreg_auth_password }} {{ oreg_host }}"
-  when:
-    - not (openshift_docker_alternative_creds | default(False))
-    - oreg_auth_user is defined
-    - (not node_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool
-  register: node_oreg_auth_credentials_create
-  retries: 3
-  delay: 5
-  until: node_oreg_auth_credentials_create.rc == 0
-  notify:
-    - restart node
-
-# docker_creds is a custom module from lib_utils
-# 'docker login' requires a docker.service running on the local host, this is an
-# alternative implementation for non-docker hosts.  This implementation does not
-# check the registry to determine whether or not the credentials will work.
-- name: Create credentials for registry auth (alternative)
-  docker_creds:
-    path: "{{ oreg_auth_credentials_path }}"
-    registry: "{{ oreg_host }}"
-    username: "{{ oreg_auth_user }}"
-    password: "{{ oreg_auth_password }}"
-  when:
-    - openshift_docker_alternative_creds | bool
-    - oreg_auth_user is defined
-    - (not node_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace) | bool
-  register: node_oreg_auth_credentials_create
-  notify:
-    - restart node
-
-# Container images may need the registry credentials
-- name: Setup ro mount of /root/.docker for containerized hosts
-  set_fact:
-    l_bind_docker_reg_auth: True
-  when:
-    - openshift.common.is_containerized | bool
-    - oreg_auth_user is defined
-    - (node_oreg_auth_credentials_stat.stat.exists or oreg_auth_credentials_replace or node_oreg_auth_credentials_create.changed) | bool

+ 0 - 37
roles/openshift_node_upgrade/tasks/systemd_units.yml

@@ -1,37 +0,0 @@
----
-# input variables
-# - openshift.node.node_image
-# - openshift_image_tag
-# - openshift.common.is_containerized
-# - openshift.node.ovs_image
-# - openshift_use_openshift_sdn
-# - openshift.common.service_type
-# - openshift_node_debug_level
-# - openshift.common.config_base
-# - openshift.common.http_proxy
-# - openshift.common.portal_net
-# - openshift.common
-# - openshift.common.http_proxy
-# notify:
-# - restart openvswitch
-# - restart node
-
-# This file is included both in the openshift_master role and in the upgrade
-# playbooks.
-- include: config/install-node-deps-docker-service-file.yml
-  when: openshift.common.is_containerized | bool
-
-- include: config/install-node-docker-service-file.yml
-  when: openshift.common.is_containerized | bool
-
-- include: config/install-ovs-service-env-file.yml
-  when: openshift.common.is_containerized | bool
-
-- include: config/workaround-bz1331590-ovs-oom-fix.yml
-  when: openshift_use_openshift_sdn | bool
-
-- include: config/install-ovs-docker-service-file.yml
-  when: openshift.common.is_containerized | bool and openshift_use_openshift_sdn | bool
-
-- include: config/configure-node-settings.yml
-- include: config/configure-proxy-settings.yml

+ 0 - 31
roles/openshift_node_upgrade/templates/node.service.j2

@@ -1,31 +0,0 @@
-[Unit]
-Description=OpenShift Node
-After={{ openshift.docker.service_name }}.service
-Wants=openvswitch.service
-After=ovsdb-server.service
-After=ovs-vswitchd.service
-Wants={{ openshift.docker.service_name }}.service
-Documentation=https://github.com/openshift/origin
-Requires=dnsmasq.service
-After=dnsmasq.service
-
-[Service]
-Type=notify
-EnvironmentFile=/etc/sysconfig/{{ openshift.common.service_type }}-node
-Environment=GOTRACEBACK=crash
-ExecStartPre=/usr/bin/cp /etc/origin/node/node-dnsmasq.conf /etc/dnsmasq.d/
-ExecStartPre=/usr/bin/dbus-send --system --dest=uk.org.thekelleys.dnsmasq /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetDomainServers array:string:/in-addr.arpa/127.0.0.1,/{{ openshift.common.dns_domain }}/127.0.0.1
-ExecStopPost=/usr/bin/rm /etc/dnsmasq.d/node-dnsmasq.conf
-ExecStopPost=/usr/bin/dbus-send --system --dest=uk.org.thekelleys.dnsmasq /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetDomainServers array:string:
-ExecStart=/usr/bin/openshift start node --config=${CONFIG_FILE} $OPTIONS
-LimitNOFILE=65536
-LimitCORE=infinity
-WorkingDirectory=/var/lib/origin/
-SyslogIdentifier={{ openshift.common.service_type }}-node
-Restart=always
-RestartSec=5s
-TimeoutStartSec=300
-OOMScoreAdjust=-999
-
-[Install]
-WantedBy=multi-user.target

+ 0 - 11
roles/openshift_node_upgrade/templates/openshift.docker.node.dep.service

@@ -1,11 +0,0 @@
-[Unit]
-Requires={{ openshift.docker.service_name }}.service
-After={{ openshift.docker.service_name }}.service
-PartOf={{ openshift.common.service_type }}-node.service
-Before={{ openshift.common.service_type }}-node.service
-
-
-[Service]
-ExecStart=/bin/bash -c "if [[ -f /usr/bin/docker-current ]]; then echo \"DOCKER_ADDTL_BIND_MOUNTS=--volume=/usr/bin/docker-current:/usr/bin/docker-current:ro --volume=/etc/sysconfig/docker:/etc/sysconfig/docker:ro --volume=/etc/containers/registries:/etc/containers/registries:ro\" > /etc/sysconfig/{{ openshift.common.service_type }}-node-dep; else echo \"#DOCKER_ADDTL_BIND_MOUNTS=\" > /etc/sysconfig/{{ openshift.common.service_type }}-node-dep; fi"
-ExecStop=
-SyslogIdentifier={{ openshift.common.service_type }}-node-dep

+ 0 - 50
roles/openshift_node_upgrade/templates/openshift.docker.node.service

@@ -1,50 +0,0 @@
-[Unit]
-After={{ openshift.common.service_type }}-master.service
-After={{ openshift.docker.service_name }}.service
-After=openvswitch.service
-PartOf={{ openshift.docker.service_name }}.service
-Requires={{ openshift.docker.service_name }}.service
-{% if openshift_use_openshift_sdn %}
-Wants=openvswitch.service
-PartOf=openvswitch.service
-After=ovsdb-server.service
-After=ovs-vswitchd.service
-{% endif %}
-Wants={{ openshift.common.service_type }}-master.service
-Requires={{ openshift.common.service_type }}-node-dep.service
-After={{ openshift.common.service_type }}-node-dep.service
-Requires=dnsmasq.service
-After=dnsmasq.service
-
-[Service]
-EnvironmentFile=/etc/sysconfig/{{ openshift.common.service_type }}-node
-EnvironmentFile=/etc/sysconfig/{{ openshift.common.service_type }}-node-dep
-ExecStartPre=-/usr/bin/docker rm -f {{ openshift.common.service_type }}-node
-ExecStartPre=/usr/bin/cp /etc/origin/node/node-dnsmasq.conf /etc/dnsmasq.d/
-ExecStartPre=/usr/bin/dbus-send --system --dest=uk.org.thekelleys.dnsmasq /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetDomainServers array:string:/in-addr.arpa/127.0.0.1,/{{ openshift.common.dns_domain }}/127.0.0.1
-ExecStart=/usr/bin/docker run --name {{ openshift.common.service_type }}-node \
-  --rm --privileged --net=host --pid=host --env-file=/etc/sysconfig/{{ openshift.common.service_type }}-node \
-  -v /:/rootfs:ro,rslave -e CONFIG_FILE=${CONFIG_FILE} -e OPTIONS=${OPTIONS} \
-  -e HOST=/rootfs -e HOST_ETC=/host-etc \
-  -v {{ openshift_node_data_dir }}:{{ openshift_node_data_dir }}{{ ':rslave' if openshift.docker.gte_1_10 | default(False) | bool else '' }} \
-  -v {{ openshift.common.config_base }}/node:{{ openshift.common.config_base }}/node \
-  {% if openshift_cloudprovider_kind | default('') != '' -%} -v {{ openshift.common.config_base }}/cloudprovider:{{ openshift.common.config_base}}/cloudprovider {% endif -%} \
-  -v /etc/localtime:/etc/localtime:ro -v /etc/machine-id:/etc/machine-id:ro \
-  -v /run:/run -v /sys:/sys:rw -v /sys/fs/cgroup:/sys/fs/cgroup:rw \
-  -v /usr/bin/docker:/usr/bin/docker:ro -v /var/lib/docker:/var/lib/docker \
-  -v /lib/modules:/lib/modules -v /etc/origin/openvswitch:/etc/openvswitch \
-  -v /etc/origin/sdn:/etc/openshift-sdn -v /var/lib/cni:/var/lib/cni \
-  -v /etc/systemd/system:/host-etc/systemd/system -v /var/log:/var/log \
-  -v /dev:/dev $DOCKER_ADDTL_BIND_MOUNTS -v /etc/pki:/etc/pki:ro \
-  {% if l_bind_docker_reg_auth %} -v {{ oreg_auth_credentials_path }}:/root/.docker:ro{% endif %}\
-  {{ openshift.node.node_image }}:${IMAGE_VERSION}
-ExecStartPost=/usr/bin/sleep 10
-ExecStop=/usr/bin/docker stop {{ openshift.common.service_type }}-node
-ExecStopPost=/usr/bin/rm /etc/dnsmasq.d/node-dnsmasq.conf
-ExecStopPost=/usr/bin/dbus-send --system --dest=uk.org.thekelleys.dnsmasq /uk/org/thekelleys/dnsmasq uk.org.thekelleys.SetDomainServers array:string:
-SyslogIdentifier={{ openshift.common.service_type }}-node
-Restart=always
-RestartSec=5s
-
-[Install]
-WantedBy={{ openshift.docker.service_name }}.service

+ 0 - 3
roles/openshift_node_upgrade/templates/openvswitch-avoid-oom.conf

@@ -1,3 +0,0 @@
-# Avoid the OOM killer for openvswitch and it's children:
-[Service]
-OOMScoreAdjust=-1000

+ 0 - 17
roles/openshift_node_upgrade/templates/openvswitch.docker.service

@@ -1,17 +0,0 @@
-[Unit]
-After={{ openshift.docker.service_name }}.service
-Requires={{ openshift.docker.service_name }}.service
-PartOf={{ openshift.docker.service_name }}.service
-
-[Service]
-EnvironmentFile=/etc/sysconfig/openvswitch
-ExecStartPre=-/usr/bin/docker rm -f openvswitch
-ExecStart=/usr/bin/docker run --name openvswitch --rm --privileged --net=host --pid=host -v /lib/modules:/lib/modules -v /run:/run -v /sys:/sys:ro -v /etc/origin/openvswitch:/etc/openvswitch {{ openshift.node.ovs_image }}:${IMAGE_VERSION}
-ExecStartPost=/usr/bin/sleep 5
-ExecStop=/usr/bin/docker stop openvswitch
-SyslogIdentifier=openvswitch
-Restart=always
-RestartSec=5s
-
-[Install]
-WantedBy={{ openshift.docker.service_name }}.service

+ 0 - 1
roles/openshift_node_upgrade/templates/openvswitch.sysconfig.j2

@@ -1 +0,0 @@
-IMAGE_VERSION={{ openshift_image_tag }}