-
Notifications
You must be signed in to change notification settings - Fork 0
/
node_setup.yml
47 lines (41 loc) · 1.18 KB
/
node_setup.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
---
- hosts: all
vars_files:
- env_variables
tasks:
- name: Creating a repository file for Kubernetes
file:
path: /etc/yum.repos.d/kubernetes.repo
state: touch
- name: Adding repository details in Kubernetes repo file.
blockinfile:
path: /etc/yum.repos.d/kubernetes.repo
block: |
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
- name: Installing required packages
yum:
name: "{{ item }}"
state: present
with_items: "{{ packages }}"
- name: Starting and Enabling the required services
service:
name: "{{ item }}"
state: started
enabled: yes
with_items: "{{ services }}"
- name: Allow Network Ports in Firewalld
firewalld:
port: "{{ item }}"
state: enabled
permanent: yes
immediate: yes
with_items: "{{ ports }}"
- name: Enabling Bridge Firewall Rule
shell: "echo '1' > /proc/sys/net/bridge/bridge-nf-call-iptables"