Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Reduce ansible logs when deploy #5305

Merged
merged 4 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions contrib/kubespray/quick-start-kubespray.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
#!/bin/bash

if getopts "v" opt; then
case $opt in
v)
export ANSIBLE_DISPLAY_OK_HOSTS=yes
export DISPLAY_SKIPPED_HOSTS=yes
export ANSIBLE_CALLBACK_WHITELIST="profile_tasks"
;;
\?)
echo "Invalid option: -$OPTARG"
exit 1
;;
esac
else
export ANSIBLE_DISPLAY_OK_HOSTS=no
export DISPLAY_SKIPPED_HOSTS=no
export ANSIBLE_CALLBACK_WHITELIST=""
suiguoxin marked this conversation as resolved.
Show resolved Hide resolved
fi

# assume pwd is pai/contrib/kubespray
LAYOUT="$PWD/config/layout.yaml"
CLUSTER_CONFIG="$PWD/config/config.yaml"
Expand Down
6 changes: 6 additions & 0 deletions docs/manual/cluster-admin/installation-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,12 @@ Please run the following script to deploy Kubernetes first. As the name explains
/bin/bash quick-start-kubespray.sh
```

By default, ansible logs of `skip` and `ok` hosts are not displayed. To view more complete ansible logs, run the script in `verbose` mode:

``` bash
/bin/bash quick-start-kubespray.sh -v
```

If there is any problem, please double-check the environment requirements first. Here we provide a requirement checker to help you verify:

``` bash
Expand Down
6 changes: 6 additions & 0 deletions docs_zh_CN/manual/cluster-admin/installation-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,12 @@ cd <pai-code-dir>/contrib/kubespray
/bin/bash quick-start-kubespray.sh
```

安装过程中默认不显示`skip`和`ok`类型的ansible log。如需查看更完全的ansible log,请使用`verbose`模式:

``` bash
/bin/bash quick-start-kubespray.sh -v
```

如果在安装过程中出现任何问题,请再次检查上述环境要求。我们也提供了一个脚本,帮助您进行检查:

``` bash
Expand Down