Browse Source

Remove downloader host

pull/86/head
Antoine Legrand 8 years ago
parent
commit
078b67c50f
10 changed files with 13 additions and 29 deletions
  1. 6
      README.md
  2. 5
      cluster.yml
  3. 3
      inventory/inventory.example
  4. 3
      inventory/local-tests.cfg
  5. 2
      roles/apps/k8s-kubedns
  6. 8
      roles/etcd/tasks/configure.yml
  7. 7
      roles/etcd/tasks/install.yml
  8. 2
      roles/kubernetes/master/tasks/main.yml
  9. 4
      roles/kubernetes/node/tasks/install.yml
  10. 2
      roles/network_plugin/tasks/calico.yml

6
README.md

@ -36,9 +36,6 @@ These defaults are good for tests purposes.
Edit the inventory according to the number of servers Edit the inventory according to the number of servers
``` ```
[downloader]
localhost ansible_connection=local ansible_python_interpreter=python2
[kube-master] [kube-master]
10.115.99.31 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] [kube-master]
node1 ansible_ssh_host=10.99.0.26 node1 ansible_ssh_host=10.99.0.26
node2 ansible_ssh_host=10.99.0.27 node2 ansible_ssh_host=10.99.0.27

5
cluster.yml

@ -1,10 +1,7 @@
--- ---
- hosts: downloader
roles:
- { role: download, tags: download }
- hosts: k8s-cluster - hosts: k8s-cluster
roles: roles:
- { role: download, tags: download }
- { role: kubernetes/preinstall, tags: preinstall } - { role: kubernetes/preinstall, tags: preinstall }
- { role: docker, tags: docker } - { role: docker, tags: docker }
- { role: kubernetes/node, tags: node } - { role: kubernetes/node, tags: node }

3
inventory/inventory.example

@ -1,6 +1,3 @@
[downloader]
localhost ansible_connection=local ansible_python_interpreter=python2
[kube-master] [kube-master]
node1 ansible_ssh_host=10.99.0.26 node1 ansible_ssh_host=10.99.0.26
node2 ansible_ssh_host=10.99.0.27 node2 ansible_ssh_host=10.99.0.27

3
inventory/local-tests.cfg

@ -1,8 +1,5 @@
node1 ansible_connection=local local_release_dir={{ansible_env.HOME}}/releases node1 ansible_connection=local local_release_dir={{ansible_env.HOME}}/releases
[downloader]
node1
[kube-master] [kube-master]
node1 node1

2
roles/apps/k8s-kubedns

@ -1 +1 @@
Subproject commit d6df09a89721d98e2969a8abf29b4eb5e787fca6
Subproject commit b5015aed8ff5eed9c325911205cfbb23ad0e57be

8
roles/etcd/tasks/configure.yml

@ -1,5 +1,5 @@
--- ---
- name: Copy etcd.service systemd file
- name: Configure | Copy etcd.service systemd file
template: template:
src: etcd.service.j2 src: etcd.service.j2
dest: /lib/systemd/system/etcd.service dest: /lib/systemd/system/etcd.service
@ -8,7 +8,7 @@
notify: notify:
- restart systemd-etcd - restart systemd-etcd
- name: Write calico-node initd script
- name: Configure | Write calico-node initd script
template: template:
src: deb-etcd.initd.j2 src: deb-etcd.initd.j2
dest: /etc/init.d/etcd dest: /etc/init.d/etcd
@ -17,11 +17,11 @@
when: init_system == "sysvinit" and ansible_os_family == "Debian" when: init_system == "sysvinit" and ansible_os_family == "Debian"
notify: restart etcd notify: restart etcd
- name: Create etcd environment vars file
- name: Configure | Create etcd environment vars file
template: template:
src: etcd.j2 src: etcd.j2
dest: /etc/etcd.env dest: /etc/etcd.env
notify: restart etcd notify: restart etcd
- name: Ensure etcd is running
- name: Configure | Ensure etcd is running
service: name=etcd state=started enabled=yes service: name=etcd state=started enabled=yes

7
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 user: name=etcd shell=/bin/nologin home=/var/lib/etcd
- name: Install etcd binaries
- name: INSTALL | Copy etcd binaries
synchronize: synchronize:
src: "{{ etcd_bin_dir }}/{{ item }}" src: "{{ etcd_bin_dir }}/{{ item }}"
dest: "{{ bin_dir }}" dest: "{{ bin_dir }}"
times: yes times: yes
archive: no archive: no
set_remote_user: false set_remote_user: false
delegate_to: "{{ groups['downloader'][0] }}"
delegate_to: "{{ inventory_hostname }}"
with_items: with_items:
- etcdctl - etcdctl
- etcd - etcd
notify: restart etcd notify: restart etcd

2
roles/kubernetes/master/tasks/main.yml

@ -12,7 +12,7 @@
checksum: yes checksum: yes
times: yes times: yes
set_remote_user: false set_remote_user: false
delegate_to: "{{ groups['downloader'][0] }}"
delegate_to: "{{ inventory_hostname }}"
- name: Perms kubectl binary - name: Perms kubectl binary
file: path={{ bin_dir }}/kubectl owner=kube mode=0755 state=file file: path={{ bin_dir }}/kubectl owner=kube mode=0755 state=file

4
roles/kubernetes/node/tasks/install.yml

@ -24,7 +24,7 @@
times: yes times: yes
archive: no archive: no
set_remote_user: false set_remote_user: false
delegate_to: "{{ groups['downloader'][0] }}"
delegate_to: "{{ inventory_hostname }}"
notify: notify:
- restart kubelet - restart kubelet
@ -42,7 +42,7 @@
times: yes times: yes
archive: no archive: no
set_remote_user: false set_remote_user: false
delegate_to: "{{ groups['downloader'][0] }}"
delegate_to: "{{ inventory_hostname }}"
when: kube_network_plugin == "calico" when: kube_network_plugin == "calico"
notify: restart kubelet notify: restart kubelet

2
roles/network_plugin/tasks/calico.yml

@ -6,7 +6,7 @@
archive: no archive: no
times: yes times: yes
set_remote_user: false set_remote_user: false
delegate_to: "{{ groups['downloader'][0] }}"
delegate_to: "{{ inventory_hostname }}"
notify: restart calico-node notify: restart calico-node
- name: Calico | install calicoctl - name: Calico | install calicoctl

Loading…
Cancel
Save