-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvagrant-playbook.yml
112 lines (105 loc) · 3.12 KB
/
vagrant-playbook.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
- name: install minikube
hosts: minikube
become: yes
gather_facts: True
tasks:
- name: "setup kubectl responsitory"
yum_repository:
name: epel
description: kubectl repository
file: external_repos
baseurl: https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
gpgcheck: no
- name: "Installing Docker Prerequisite packages"
yum:
name:
- kubectl
- git
- yum-utils
- device-mapper-persistent-data
- lvm2
- python-setuptools
- python-devel
- socat
state: latest
- name: insatll pip
easy_install:
name: pip
state: latest
- name: install openshift
shell: |
sudo pip install -U setuptools
sudo pip install --ignore-installed openshift
- name: "Configuring docker-ce repo"
get_url:
url: https://download.docker.com/linux/centos/docker-ce.repo
dest: /etc/yum.repos.d/docker-ce.repo
mode: 0644
- name: " Installing Docker latest version"
yum:
name: docker-ce
state: present
- name: " Starting and Enabling Docker service"
service:
name: docker
state: started
enabled: yes
- name: install minikube
get_url:
#url: https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
url: https://storage.googleapis.com/minikube/releases/v0.35.0/minikube-linux-amd64
dest: /usr/local/bin/minikube
mode: 777
- name: setup cluster
#if needed add kube version flag to minikube --kubernetes-version=v1.12.0
shell: "/usr/local/bin/minikube start --feature-gates=BlockVolume=true,CSIBlockVolume=true,VolumeSnapshotDataSource=true --vm-driver=none"
- name: get cluster info
shell: kubectl cluster-info
- name: Copy kube config for vagrant user
hosts: minikube
remote_user: vagrant
tasks:
- name: Create a directory
file:
path: /home/vagrant/.kube
state: directory
group: vagrant
owner: vagrant
mode: 755
- name: Copy kube config for vagrant user
copy:
remote_src: yes
src: /etc/kubernetes/admin.conf
dest: /home/vagrant/.kube/config
- name: Fetch config
hosts: minikube
become: true
tasks:
- name: Retrieve kubectl config
fetch:
dest: ./kubeconfig
flat: yes
src: /home/vagrant/.kube/config
- name: git clone rook
git:
repo: https://github.com/rook/rook
dest: /root/rook
- name: install ceph common
k8s:
state: present
src: /root/rook/cluster/examples/kubernetes/ceph/common.yaml
- name: install operator
k8s:
state: present
src: /root/rook/cluster/examples/kubernetes/ceph/operator.yaml
- pause:
seconds: 10
- name: install ceph cluster
k8s:
state: present
src: /root/rook/cluster/examples/kubernetes/ceph/cluster.yaml
- name: install tool-box
k8s:
state: present
src: /root/rook/cluster/examples/kubernetes/ceph/toolbox.yaml