-
Notifications
You must be signed in to change notification settings - Fork 101
/
Copy pathpre_sanity.yml
45 lines (40 loc) · 1.58 KB
/
pre_sanity.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
- hosts: all
become: yes
become_method: sudo
tags:
- pre_sanity
- master
- node
tasks:
- name: check 127.0.1.1 /etc/hosts
# For a system with a permanent IP address, that permanent IP address should be used here instead of 127.0.1.1
# https://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_hostname_resolution
# This is a good rule, while not mandatory. If you want, you can skip this task with --skip-tags check_etc_hosts
command: grep '^\s*127.0.1.1' /etc/hosts
register: command_result
failed_when: command_result.stdout != ""
tags:
- check_etc_hosts
changed_when: false
- name: check docker is running
command: 'docker info'
tags:
- check_docker
when: docker_setup is defined and docker_setup=false
changed_when: false
- name: check docker hello world
shell: docker run --rm -i hello-world | awk '/Hello/ {print $1}'
register: command_result
failed_when: command_result.stdout != "Hello"
tags:
- check_docker
when: docker_setup is defined and docker_setup=false
changed_when: false
# Ideally, to ensure there is no x509 certificate error like:
#' docker pull gcr.io/google_containers/kube-apiserver-amd64:v1.7.2
#Trying to pull repository gcr.io/google_containers/kube-apiserver-amd64 ...
#Get https://gcr.io/v1/_ping: x509: certificate signed by unknown authority '
# yum check-update ca-certificates; (($?==100)) && yum update ca-certificates || yum reinstall ca-certificates
# update-ca-trust extract
# Check ports: https://kubernetes.io/docs/setup/independent/install-kubeadm/