From 078b67c50f7a297ea36ae57f401a74e2166efaf8 Mon Sep 17 00:00:00 2001
From: Antoine Legrand <antoine.legrand@arkena.com>
Date: Thu, 21 Jan 2016 21:18:45 +0100
Subject: [PATCH] Remove downloader host

---
 README.md                               | 6 ------
 cluster.yml                             | 5 +----
 inventory/inventory.example             | 3 ---
 inventory/local-tests.cfg               | 3 ---
 roles/apps/k8s-kubedns                  | 2 +-
 roles/etcd/tasks/configure.yml          | 8 ++++----
 roles/etcd/tasks/install.yml            | 7 +++----
 roles/kubernetes/master/tasks/main.yml  | 2 +-
 roles/kubernetes/node/tasks/install.yml | 4 ++--
 roles/network_plugin/tasks/calico.yml   | 2 +-
 10 files changed, 13 insertions(+), 29 deletions(-)

diff --git a/README.md b/README.md
index 8b3856da0..edd01e508 100644
--- a/README.md
+++ b/README.md
@@ -36,9 +36,6 @@ These defaults are good for tests purposes.
 
 Edit the inventory according to the number of servers
 ```
-[downloader]
-localhost ansible_connection=local ansible_python_interpreter=python2
-
 [kube-master]
 10.115.99.31
 
@@ -77,9 +74,6 @@ In node-mesh mode the nodes peers with all the nodes in order to exchange routes
 
 ```
 
-[downloader]
-localhost ansible_connection=local ansible_python_interpreter=python2
-
 [kube-master]
 node1 ansible_ssh_host=10.99.0.26
 node2 ansible_ssh_host=10.99.0.27
diff --git a/cluster.yml b/cluster.yml
index d68bf8ab3..faf0fea18 100644
--- a/cluster.yml
+++ b/cluster.yml
@@ -1,10 +1,7 @@
 ---
-- hosts: downloader
-  roles:
-    - { role: download, tags: download }
-
 - hosts: k8s-cluster
   roles:
+    - { role: download, tags: download }
     - { role: kubernetes/preinstall, tags: preinstall }
     - { role: docker, tags: docker }
     - { role: kubernetes/node, tags: node }
diff --git a/inventory/inventory.example b/inventory/inventory.example
index ab0d1fca1..90bc3d5ac 100644
--- a/inventory/inventory.example
+++ b/inventory/inventory.example
@@ -1,6 +1,3 @@
-[downloader]
-localhost ansible_connection=local ansible_python_interpreter=python2
-
 [kube-master]
 node1 ansible_ssh_host=10.99.0.26
 node2 ansible_ssh_host=10.99.0.27
diff --git a/inventory/local-tests.cfg b/inventory/local-tests.cfg
index 06fd3977b..425ad23ef 100644
--- a/inventory/local-tests.cfg
+++ b/inventory/local-tests.cfg
@@ -1,8 +1,5 @@
 node1 ansible_connection=local local_release_dir={{ansible_env.HOME}}/releases
 
-[downloader]
-node1
-
 [kube-master]
 node1
 
diff --git a/roles/apps/k8s-kubedns b/roles/apps/k8s-kubedns
index d6df09a89..b5015aed8 160000
--- a/roles/apps/k8s-kubedns
+++ b/roles/apps/k8s-kubedns
@@ -1 +1 @@
-Subproject commit d6df09a89721d98e2969a8abf29b4eb5e787fca6
+Subproject commit b5015aed8ff5eed9c325911205cfbb23ad0e57be
diff --git a/roles/etcd/tasks/configure.yml b/roles/etcd/tasks/configure.yml
index 6f11a743b..ab3a5052d 100644
--- a/roles/etcd/tasks/configure.yml
+++ b/roles/etcd/tasks/configure.yml
@@ -1,5 +1,5 @@
 ---
-- name: Copy etcd.service systemd file
+- name: Configure |  Copy etcd.service systemd file
   template:
     src: etcd.service.j2
     dest: /lib/systemd/system/etcd.service
@@ -8,7 +8,7 @@
   notify:
     - restart systemd-etcd
 
-- name: Write calico-node initd script
+- name: Configure |  Write calico-node initd script
   template:
     src: deb-etcd.initd.j2
     dest: /etc/init.d/etcd
@@ -17,11 +17,11 @@
   when: init_system == "sysvinit" and ansible_os_family == "Debian"
   notify: restart etcd
 
-- name: Create etcd environment vars file
+- name: Configure |  Create etcd environment vars file
   template:
     src: etcd.j2
     dest: /etc/etcd.env
   notify: restart etcd
 
-- name: Ensure etcd is running
+- name: Configure |  Ensure etcd is running
   service: name=etcd state=started enabled=yes
diff --git a/roles/etcd/tasks/install.yml b/roles/etcd/tasks/install.yml
index f594ae9bc..c19b26c9c 100644
--- a/roles/etcd/tasks/install.yml
+++ b/roles/etcd/tasks/install.yml
@@ -1,17 +1,16 @@
 ---
-- name: Create etcd user
+- name: INSTALL | Create etcd user
   user: name=etcd shell=/bin/nologin home=/var/lib/etcd
 
-- name: Install etcd binaries
+- name: INSTALL | Copy  etcd binaries
   synchronize:
      src: "{{ etcd_bin_dir }}/{{ item }}"
      dest: "{{ bin_dir }}"
      times: yes
      archive: no
      set_remote_user: false
-  delegate_to: "{{ groups['downloader'][0] }}"
+  delegate_to: "{{ inventory_hostname }}"
   with_items:
     - etcdctl
     - etcd
   notify: restart etcd
-
diff --git a/roles/kubernetes/master/tasks/main.yml b/roles/kubernetes/master/tasks/main.yml
index 9e50200f6..7e941e422 100644
--- a/roles/kubernetes/master/tasks/main.yml
+++ b/roles/kubernetes/master/tasks/main.yml
@@ -12,7 +12,7 @@
      checksum: yes
      times: yes
      set_remote_user: false
-  delegate_to: "{{ groups['downloader'][0] }}"
+  delegate_to: "{{  inventory_hostname  }}"
 
 - name: Perms kubectl binary
   file: path={{ bin_dir }}/kubectl owner=kube mode=0755 state=file
diff --git a/roles/kubernetes/node/tasks/install.yml b/roles/kubernetes/node/tasks/install.yml
index 9fa4398f5..847db5390 100644
--- a/roles/kubernetes/node/tasks/install.yml
+++ b/roles/kubernetes/node/tasks/install.yml
@@ -24,7 +24,7 @@
      times: yes
      archive: no
      set_remote_user: false
-  delegate_to: "{{ groups['downloader'][0] }}"
+  delegate_to: "{{  inventory_hostname  }}"
   notify:
     - restart kubelet
 
@@ -42,7 +42,7 @@
     times: yes
     archive: no
     set_remote_user: false
-  delegate_to: "{{ groups['downloader'][0] }}"
+  delegate_to: "{{  inventory_hostname  }}"
   when: kube_network_plugin == "calico"
   notify: restart kubelet
 
diff --git a/roles/network_plugin/tasks/calico.yml b/roles/network_plugin/tasks/calico.yml
index 790642399..c75a4b3a1 100644
--- a/roles/network_plugin/tasks/calico.yml
+++ b/roles/network_plugin/tasks/calico.yml
@@ -6,7 +6,7 @@
     archive: no
     times: yes
     set_remote_user: false
-  delegate_to: "{{ groups['downloader'][0] }}"
+  delegate_to: "{{  inventory_hostname  }}"
   notify: restart calico-node
 
 - name: Calico | install calicoctl
-- 
GitLab