Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
I
init
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
init
Commits
33ac6463
Commit
33ac6463
authored
May 28, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format
parent
3ce57190
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
29 deletions
+29
-29
tasks/apt.yml
tasks/apt.yml
+3
-3
tasks/byobu.yml
tasks/byobu.yml
+1
-1
tasks/docker.yml
tasks/docker.yml
+6
-6
tasks/main.yml
tasks/main.yml
+7
-7
tasks/sshd_config.yml
tasks/sshd_config.yml
+1
-1
tasks/sysctl.yml
tasks/sysctl.yml
+2
-2
tasks/upgrade.yml
tasks/upgrade.yml
+4
-4
tasks/utility.yml
tasks/utility.yml
+5
-5
No files found.
tasks/apt.yml
View file @
33ac6463
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
become
:
true
become
:
true
apt
:
apt
:
name
:
exuberant-ctags
name
:
exuberant-ctags
when
:
"
ansible_distribution
==
'Ubuntu'
and
ansible_distribution_release
!=
'focal'"
when
:
ansible_distribution == 'Ubuntu' and ansible_distribution_release != 'focal'
-
name
:
remove old ctags
-
name
:
remove old ctags
become
:
true
become
:
true
apt
:
apt
:
...
@@ -15,12 +15,12 @@
...
@@ -15,12 +15,12 @@
state
:
absent
state
:
absent
purge
:
true
purge
:
true
autoremove
:
true
autoremove
:
true
when
:
"
ansible_distribution
==
'Debian'
or
ansible_distribution_release
==
'focal'"
when
:
ansible_distribution == 'Debian' or ansible_distribution_release == 'focal'
-
name
:
ctags in new Ubuntu and Debian
-
name
:
ctags in new Ubuntu and Debian
become
:
true
become
:
true
apt
:
apt
:
name
:
universal-ctags
name
:
universal-ctags
when
:
"
ansible_distribution
==
'Debian'
or
ansible_distribution_release
==
'focal'"
when
:
ansible_distribution == 'Debian' or ansible_distribution_release == 'focal'
-
name
:
focal packages
-
name
:
focal packages
become
:
true
become
:
true
apt
:
apt
:
...
...
tasks/byobu.yml
View file @
33ac6463
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
shell
:
byobu-enable
shell
:
byobu-enable
args
:
args
:
creates
:
'
~/.hushlogin'
creates
:
'
~/.hushlogin'
when
:
"
ansible_os_family
!=
'RedHat'
or
ansible_distribution_major_version|int
!=
7"
when
:
ansible_os_family != 'RedHat' or ansible_distribution_major_version|int !=
7
-
name
:
终端环境 byobu ctrl-a
-
name
:
终端环境 byobu ctrl-a
command
:
byobu-ctrl-a emacs
command
:
byobu-ctrl-a emacs
args
:
args
:
...
...
tasks/docker.yml
View file @
33ac6463
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
-
name
:
China mirror for Docker
-
name
:
China mirror for Docker
set_fact
:
set_fact
:
mirror_docker
:
https://mirrors.tuna.tsinghua.edu.cn/docker-ce
mirror_docker
:
https://mirrors.tuna.tsinghua.edu.cn/docker-ce
when
:
"
china_mirror_docker"
when
:
china_mirror_docker
-
name
:
clean apt Docker
-
name
:
clean apt Docker
become
:
true
become
:
true
apt
:
apt
:
...
@@ -111,7 +111,7 @@
...
@@ -111,7 +111,7 @@
name
:
'
{{ansible_user_id}}'
name
:
'
{{ansible_user_id}}'
append
:
true
append
:
true
groups
:
docker
groups
:
docker
when
:
"
ansible_user_id
!=
'root'"
when
:
ansible_user_id != 'root'
-
name
:
docker-compose 清理 pip
-
name
:
docker-compose 清理 pip
file
:
file
:
path
:
~/.pip
path
:
~/.pip
...
@@ -137,14 +137,14 @@
...
@@ -137,14 +137,14 @@
name
:
pip
name
:
pip
executable
:
'
{{pip_executable}}'
executable
:
'
{{pip_executable}}'
state
:
latest
state
:
latest
when
:
"
not
china_mirror_docker"
when
:
not china_mirror_docker
-
name
:
docker-compose
-
name
:
docker-compose
become
:
true
become
:
true
pip
:
pip
:
name
:
docker-compose
name
:
docker-compose
executable
:
'
{{pip_executable}}'
executable
:
'
{{pip_executable}}'
state
:
latest
state
:
latest
when
:
"
not
china_mirror_docker"
when
:
not china_mirror_docker
-
name
:
docker-compose 国内
-
name
:
docker-compose 国内
become
:
true
become
:
true
pip
:
pip
:
...
@@ -152,7 +152,7 @@
...
@@ -152,7 +152,7 @@
executable
:
'
{{pip_executable}}'
executable
:
'
{{pip_executable}}'
state
:
latest
state
:
latest
extra_args
:
-i https://mirrors.aliyun.com/pypi/simple/
extra_args
:
-i https://mirrors.aliyun.com/pypi/simple/
when
:
"
china_mirror_docker"
when
:
china_mirror_docker
-
name
:
docker-compose 国内
-
name
:
docker-compose 国内
become
:
true
become
:
true
pip
:
pip
:
...
@@ -160,7 +160,7 @@
...
@@ -160,7 +160,7 @@
executable
:
'
{{pip_executable}}'
executable
:
'
{{pip_executable}}'
state
:
latest
state
:
latest
extra_args
:
-i https://mirrors.aliyun.com/pypi/simple/
extra_args
:
-i https://mirrors.aliyun.com/pypi/simple/
when
:
"
china_mirror_docker"
when
:
china_mirror_docker
-
name
:
docker 配置 创建目录
-
name
:
docker 配置 创建目录
become
:
true
become
:
true
file
:
file
:
...
...
tasks/main.yml
View file @
33ac6463
...
@@ -13,29 +13,29 @@
...
@@ -13,29 +13,29 @@
when
:
'
ansible_memtotal_mb
<
1024
and
not
swap_result.stdout'
when
:
'
ansible_memtotal_mb
<
1024
and
not
swap_result.stdout'
-
name
:
upgrade
-
name
:
upgrade
include_tasks
:
'
upgrade.yml'
include_tasks
:
'
upgrade.yml'
when
:
"
upgrade"
when
:
upgrade
-
name
:
sshd_config again
-
name
:
sshd_config again
include_tasks
:
'
sshd_config.yml'
include_tasks
:
'
sshd_config.yml'
-
name
:
hypervisor
-
name
:
hypervisor
include_tasks
:
'
hypervisor.yml'
include_tasks
:
'
hypervisor.yml'
when
:
"
ansible_virtualization_role
==
'host'"
when
:
ansible_virtualization_role == 'host'
-
name
:
sysctl
-
name
:
sysctl
include_tasks
:
'
sysctl.yml'
include_tasks
:
'
sysctl.yml'
-
name
:
apt
-
name
:
apt
include_tasks
:
apt.yml
include_tasks
:
apt.yml
when
:
"
ansible_os_family
==
'Debian'"
when
:
ansible_os_family == 'Debian'
-
name
:
yum
-
name
:
yum
include_tasks
:
yum.yml
include_tasks
:
yum.yml
when
:
"
ansible_os_family
==
'RedHat'
and
ansible_distribution_major_version|int
==
7"
when
:
ansible_os_family == 'RedHat' and ansible_distribution_major_version|int ==
7
-
name
:
dnf
-
name
:
dnf
include_tasks
:
dnf.yml
include_tasks
:
dnf.yml
when
:
"
ansible_os_family
==
'RedHat'
and
ansible_distribution_major_version|int
>=
8"
when
:
ansible_os_family == 'RedHat' and ansible_distribution_major_version|int >=
8
-
name
:
redhat configures
-
name
:
redhat configures
include_tasks
:
redhat_configures.yml
include_tasks
:
redhat_configures.yml
when
:
"
ansible_os_family
==
'RedHat'"
when
:
ansible_os_family == 'RedHat'
-
name
:
docker
-
name
:
docker
include_tasks
:
docker.yml
include_tasks
:
docker.yml
when
:
"
install_docker"
when
:
install_docker
-
name
:
fish
-
name
:
fish
include_tasks
:
fish.yml
include_tasks
:
fish.yml
when
:
ansible_os_family == 'Debian' or ansible_distribution == 'Fedora'
# RedHat has too many problems on fish, so aborted
when
:
ansible_os_family == 'Debian' or ansible_distribution == 'Fedora'
# RedHat has too many problems on fish, so aborted
...
...
tasks/sshd_config.yml
View file @
33ac6463
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
regexp
:
'
^#?PermitRootLogin
(no|false|prohibit-password).*$'
regexp
:
'
^#?PermitRootLogin
(no|false|prohibit-password).*$'
line
:
'
PermitRootLogin
yes'
line
:
'
PermitRootLogin
yes'
backrefs
:
true
backrefs
:
true
when
:
"
ansible_user_id
==
'root'
and
allow_password"
when
:
ansible_user_id == 'root' and allow_password
-
name
:
sshd config GSSAPIAuthentication
-
name
:
sshd config GSSAPIAuthentication
become
:
true
become
:
true
lineinfile
:
lineinfile
:
...
...
tasks/sysctl.yml
View file @
33ac6463
...
@@ -34,14 +34,14 @@
...
@@ -34,14 +34,14 @@
name
:
net.core.default_qdisc
name
:
net.core.default_qdisc
value
:
fq
value
:
fq
sysctl_set
:
true
sysctl_set
:
true
when
:
"
ansible_os_family
==
'Debian'
or
ansible_distribution_major_version|int
>
7"
when
:
ansible_os_family == 'Debian' or ansible_distribution_major_version|int >
7
-
name
:
TCP BBR
-
name
:
TCP BBR
become
:
true
become
:
true
sysctl
:
sysctl
:
name
:
net.ipv4.tcp_congestion_control
name
:
net.ipv4.tcp_congestion_control
value
:
bbr
value
:
bbr
sysctl_set
:
true
sysctl_set
:
true
when
:
"
ansible_os_family
==
'Debian'
or
ansible_distribution_major_version|int
>
7"
when
:
ansible_os_family == 'Debian' or ansible_distribution_major_version|int >
7
-
name
:
limit
-
name
:
limit
become
:
true
become
:
true
pam_limits
:
pam_limits
:
...
...
tasks/upgrade.yml
View file @
33ac6463
...
@@ -3,26 +3,26 @@
...
@@ -3,26 +3,26 @@
apt
:
apt
:
update_cache
:
true
update_cache
:
true
upgrade
:
dist
upgrade
:
dist
when
:
"
ansible_os_family
==
'Debian'"
when
:
ansible_os_family == 'Debian'
-
name
:
yum update
-
name
:
yum update
become
:
true
become
:
true
yum
:
yum
:
name
:
'
*'
name
:
'
*'
update_cache
:
true
update_cache
:
true
state
:
latest
state
:
latest
when
:
"
ansible_os_family
==
'RedHat'
and
ansible_distribution_major_version|int
==
7"
when
:
ansible_os_family == 'RedHat' and ansible_distribution_major_version|int ==
7
-
name
:
dnf update
-
name
:
dnf update
become
:
true
become
:
true
dnf
:
dnf
:
name
:
'
*'
name
:
'
*'
state
:
latest
state
:
latest
when
:
"
ansible_os_family
==
'RedHat'
and
ansible_distribution_major_version|int
>=
8"
when
:
ansible_os_family == 'RedHat' and ansible_distribution_major_version|int >=
8
-
name
:
fixup iptables with qemu
-
name
:
fixup iptables with qemu
become
:
true
become
:
true
iptables
:
iptables
:
chain
:
FORWARD
chain
:
FORWARD
flush
:
true
flush
:
true
when
:
"
ansible_virtualization_role
==
'host'"
when
:
ansible_virtualization_role == 'host'
-
name
:
install a python alternate to prevent ansible problems
-
name
:
install a python alternate to prevent ansible problems
become
:
true
become
:
true
apt
:
apt
:
...
...
tasks/utility.yml
View file @
33ac6463
...
@@ -10,19 +10,19 @@
...
@@ -10,19 +10,19 @@
insertafter
:
'
EOF'
insertafter
:
'
EOF'
line
:
'
{{
ansible_user_id
}}
ALL=(ALL:ALL)
NOPASSWD:
ALL'
line
:
'
{{
ansible_user_id
}}
ALL=(ALL:ALL)
NOPASSWD:
ALL'
validate
:
/usr/sbin/visudo -cf %s
validate
:
/usr/sbin/visudo -cf %s
when
:
"
ansible_user_id
!=
'root'"
when
:
ansible_user_id != 'root'
-
name
:
hostname
-
name
:
hostname
become
:
true
become
:
true
hostname
:
hostname
:
name
:
"
{{
inventory_hostname_short
}}"
name
:
"
{{
inventory_hostname_short
}}"
when
:
"
inventory_hostname_short
!=
'10'
and
inventory_hostname_short
!=
'172'
and
inventory_hostname_short
!=
'192'"
when
:
inventory_hostname_short != '10' and inventory_hostname_short != '172' and inventory_hostname_short != '192'
-
name
:
hostname hosts
-
name
:
hostname hosts
become
:
true
become
:
true
lineinfile
:
lineinfile
:
dest
:
/etc/hosts
dest
:
/etc/hosts
regexp
:
"
^{{
ansible_default_ipv4.address
}}"
regexp
:
"
^{{
ansible_default_ipv4.address
}}"
line
:
"
{{
ansible_default_ipv4.address
}}
{{
inventory_hostname
}}
{{
inventory_hostname_short
}}"
line
:
"
{{
ansible_default_ipv4.address
}}
{{
inventory_hostname
}}
{{
inventory_hostname_short
}}"
when
:
"
inventory_hostname_short
!=
'10'
and
inventory_hostname_short
!=
'172'
and
inventory_hostname_short
!=
'192'"
when
:
inventory_hostname_short != '10' and inventory_hostname_short != '172' and inventory_hostname_short != '192'
-
name
:
clean aliyun
-
name
:
clean aliyun
become
:
true
become
:
true
shell
:
|
shell
:
|
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
mirror_debian_security
:
http://mirrors.tuna.tsinghua.edu.cn
mirror_debian_security
:
http://mirrors.tuna.tsinghua.edu.cn
mirror_ubuntu
:
http://mirrors.tuna.tsinghua.edu.cn
mirror_ubuntu
:
http://mirrors.tuna.tsinghua.edu.cn
mirror_ubuntu_security
:
http://mirrors.tuna.tsinghua.edu.cn
mirror_ubuntu_security
:
http://mirrors.tuna.tsinghua.edu.cn
when
:
"
china_mirror"
when
:
china_mirror
-
name
:
set facts for not upgrade
-
name
:
set facts for not upgrade
set_fact
:
set_fact
:
target_distribution
:
'
{{
ansible_distribution_release
}}'
target_distribution
:
'
{{
ansible_distribution_release
}}'
...
@@ -89,7 +89,7 @@
...
@@ -89,7 +89,7 @@
state
:
absent
state
:
absent
autoremove
:
yes
autoremove
:
yes
purge
:
yes
purge
:
yes
when
:
"
ansible_os_family
==
'Debian'"
when
:
ansible_os_family == 'Debian'
-
name
:
remove not proper installed wireguard
-
name
:
remove not proper installed wireguard
become
:
true
become
:
true
apt
:
apt
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment