Merge branch 'master' into pedantic-syntax-cleanup

This commit is contained in:
Matthew Mosesohn
2017-02-20 20:19:38 +03:00
committed by GitHub
10 changed files with 170 additions and 39 deletions

View File

@@ -1,6 +1,5 @@
#FIXME: remove if kubernetes/features#124 is implemented
- name: Weave | Purge old weave daemonset
run_once: true
kube:
name: "weave-net"
kubectl: "{{ bin_dir }}/kubectl"
@@ -12,7 +11,6 @@
- name: Weave | Start Resources
run_once: true
kube:
name: "weave-net"
kubectl: "{{ bin_dir }}/kubectl"
@@ -21,17 +19,16 @@
namespace: "{{system_namespace}}"
state: "{{ item | ternary('latest','present') }}"
with_items: "{{ weave_manifest.changed }}"
delegate_to: "{{groups['kube-master'][0]}}"
when: inventory_hostname == groups['kube-master'][0]
- name: "Weave | wait for weave to become available"
uri:
url: http://127.0.0.1:6784/status
return_content: yes
run_once: true
register: weave_status
retries: 12
retries: 180
delay: 10
until: "{{ weave_status.status == 200 and
'Status: ready' in weave_status.content }}"
delegate_to: "{{groups['kube-master'][0]}}"
when: inventory_hostname == groups['kube-master'][0]

View File

@@ -131,11 +131,17 @@
tags: bootstrap-os
# Todo : selinux configuration
- name: Confirm selinux deployed
stat:
path: /etc/selinux/config
when: ansible_os_family == "RedHat"
register: slc
- name: Set selinux policy to permissive
selinux:
policy: targeted
state: permissive
when: ansible_os_family == "RedHat"
when: ansible_os_family == "RedHat" and slc.stat.exists == True
changed_when: False
tags: bootstrap-os

View File

@@ -0,0 +1,5 @@
---
- name: Uncordon node
command: "{{ bin_dir }}/kubectl uncordon {{ ansible_hostname }}"
delegate_to: "{{ groups['kube-master'][0] }}"

View File

@@ -0,0 +1,12 @@
---
- name: Cordon node
command: "{{ bin_dir }}/kubectl cordon {{ ansible_hostname }}"
delegate_to: "{{ groups['kube-master'][0] }}"
- name: Drain node
command: "{{ bin_dir }}/kubectl drain --force --ignore-daemonsets --grace-period 30 --delete-local-data {{ ansible_hostname }}"
delegate_to: "{{ groups['kube-master'][0] }}"
- name: Sleep for grace period for draining
pause: seconds=30