Skip to content

Commit

Permalink
更改os-harden为手动选择执行
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmzj committed May 29, 2018
1 parent 6e9eb60 commit af31805
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 22 deletions.
5 changes: 0 additions & 5 deletions 01.prepare.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# [可选]操作系统安全加固 https://github.com/dev-sec/ansible-os-hardening
- hosts: all
roles:
- { role: os-harden, when: "OS_HARDEN is defined and OS_HARDEN == 'yes'" }

# 在deploy节点生成CA相关证书,以及kubedns.yaml配置文件
- hosts: deploy
roles:
Expand Down
1 change: 0 additions & 1 deletion 11.harbor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
- hosts: harbor
roles:
- { role: os-harden, when: "OS_HARDEN is defined and OS_HARDEN == 'yes'" }
- prepare
- docker
- harbor
Expand Down
1 change: 0 additions & 1 deletion 20.addnode.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
- hosts: new-node
roles:
- { role: os-harden, when: "OS_HARDEN is defined and OS_HARDEN == 'yes'" }
- prepare
- docker
- kube-node
Expand Down
1 change: 0 additions & 1 deletion 21.addmaster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

- hosts: new-master
roles:
- { role: os-harden, when: "OS_HARDEN is defined and OS_HARDEN == 'yes'" }
- prepare
- docker
- kube-master
Expand Down
5 changes: 0 additions & 5 deletions 90.setup.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# [可选]操作系统安全加固 https://github.com/dev-sec/ansible-os-hardening
- hosts: all
roles:
- { role: os-harden, when: "OS_HARDEN is defined and OS_HARDEN == 'yes'" }

# 在deploy节点生成CA相关证书,以供整个集群使用
# 以及初始化kubedns.yaml配置文件
- hosts: deploy
Expand Down
1 change: 1 addition & 0 deletions docs/00-集群规划和基础参数设定.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ ansible all -m ping
}
```
+ 开始集群安装,如果你对集群安装流程不熟悉,请阅读分步安装讲解后一步一步安装,并对每步都进行验证
+ [可选]安装集群前对所有节点进行操作系统层面的安全加固 `ansible-playbook roles/os-harden/os-harden.yml`,详情请参考[os-harden项目](https://github.com/dev-sec/ansible-os-hardening)

``` bash
# 分步安装
Expand Down
2 changes: 2 additions & 0 deletions docs/quickStart.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ ansible-playbook 06.network.yml
```
如果执行成功,k8s集群就安装好了。详细分步讲解请查看项目目录 `/docs` 下相关文档
+ [可选]对节点进行操作系统层面的安全加固 `ansible-playbook roles/os-harden/os-harden.yml`,详情请参考[os-harden项目](https://github.com/dev-sec/ansible-os-hardening)
### 5.验证安装
``` bash
# 如果提示kubectl: command not found,退出重新ssh登陆一下,环境变量生效即可
Expand Down
3 changes: 0 additions & 3 deletions example/hosts.allinone.example
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ BASIC_AUTH_USER="admin"
BASIC_AUTH_PASS="test1234"

# ---------附加参数--------------------
#是否对操作系统进行安全加固 "yes"/"no"
OS_HARDEN="no"

#默认二进制文件目录
bin_dir="/opt/kube/bin"

Expand Down
3 changes: 0 additions & 3 deletions example/hosts.m-masters.example
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ BASIC_AUTH_USER="admin"
BASIC_AUTH_PASS="test1234"

# ---------附加参数--------------------
#是否对操作系统进行安全加固 "yes"/"no"
OS_HARDEN="no"

#默认二进制文件目录
bin_dir="/opt/kube/bin"

Expand Down
3 changes: 0 additions & 3 deletions example/hosts.s-master.example
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ BASIC_AUTH_USER="admin"
BASIC_AUTH_PASS="test1234"

# ---------附加参数--------------------
#是否对操作系统进行安全加固 "yes"/"no"
OS_HARDEN="no"

#默认二进制文件目录
bin_dir="/opt/kube/bin"

Expand Down
5 changes: 5 additions & 0 deletions roles/os-harden/os-harden.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# [可选]操作系统安全加固 https://github.com/dev-sec/ansible-os-hardening
- hosts: all
roles:
- { role: os-harden, when: "OS_HARDEN is defined and OS_HARDEN == 'yes'" }

0 comments on commit af31805

Please sign in to comment.