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 @@
become
:
true
apt
:
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
become
:
true
apt
:
...
...
@@ -15,12 +15,12 @@
state
:
absent
purge
:
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
become
:
true
apt
:
name
:
universal-ctags
when
:
"
ansible_distribution
==
'Debian'
or
ansible_distribution_release
==
'focal'"
when
:
ansible_distribution == 'Debian' or ansible_distribution_release == 'focal'
-
name
:
focal packages
become
:
true
apt
:
...
...
tasks/byobu.yml
View file @
33ac6463
...
...
@@ -8,7 +8,7 @@
shell
:
byobu-enable
args
:
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
command
:
byobu-ctrl-a emacs
args
:
...
...
tasks/docker.yml
View file @
33ac6463
...
...
@@ -5,7 +5,7 @@
-
name
:
China mirror for Docker
set_fact
:
mirror_docker
:
https://mirrors.tuna.tsinghua.edu.cn/docker-ce
when
:
"
china_mirror_docker"
when
:
china_mirror_docker
-
name
:
clean apt Docker
become
:
true
apt
:
...
...
@@ -111,7 +111,7 @@
name
:
'
{{ansible_user_id}}'
append
:
true
groups
:
docker
when
:
"
ansible_user_id
!=
'root'"
when
:
ansible_user_id != 'root'
-
name
:
docker-compose 清理 pip
file
:
path
:
~/.pip
...
...
@@ -137,14 +137,14 @@
name
:
pip
executable
:
'
{{pip_executable}}'
state
:
latest
when
:
"
not
china_mirror_docker"
when
:
not china_mirror_docker
-
name
:
docker-compose
become
:
true
pip
:
name
:
docker-compose
executable
:
'
{{pip_executable}}'
state
:
latest
when
:
"
not
china_mirror_docker"
when
:
not china_mirror_docker
-
name
:
docker-compose 国内
become
:
true
pip
:
...
...
@@ -152,7 +152,7 @@
executable
:
'
{{pip_executable}}'
state
:
latest
extra_args
:
-i https://mirrors.aliyun.com/pypi/simple/
when
:
"
china_mirror_docker"
when
:
china_mirror_docker
-
name
:
docker-compose 国内
become
:
true
pip
:
...
...
@@ -160,7 +160,7 @@
executable
:
'
{{pip_executable}}'
state
:
latest
extra_args
:
-i https://mirrors.aliyun.com/pypi/simple/
when
:
"
china_mirror_docker"
when
:
china_mirror_docker
-
name
:
docker 配置 创建目录
become
:
true
file
:
...
...
tasks/main.yml
View file @
33ac6463
...
...
@@ -13,29 +13,29 @@
when
:
'
ansible_memtotal_mb
<
1024
and
not
swap_result.stdout'
-
name
:
upgrade
include_tasks
:
'
upgrade.yml'
when
:
"
upgrade"
when
:
upgrade
-
name
:
sshd_config again
include_tasks
:
'
sshd_config.yml'
-
name
:
hypervisor
include_tasks
:
'
hypervisor.yml'
when
:
"
ansible_virtualization_role
==
'host'"
when
:
ansible_virtualization_role == 'host'
-
name
:
sysctl
include_tasks
:
'
sysctl.yml'
-
name
:
apt
include_tasks
:
apt.yml
when
:
"
ansible_os_family
==
'Debian'"
when
:
ansible_os_family == 'Debian'
-
name
:
yum
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
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
include_tasks
:
redhat_configures.yml
when
:
"
ansible_os_family
==
'RedHat'"
when
:
ansible_os_family == 'RedHat'
-
name
:
docker
include_tasks
:
docker.yml
when
:
"
install_docker"
when
:
install_docker
-
name
:
fish
include_tasks
:
fish.yml
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 @@
regexp
:
'
^#?PermitRootLogin
(no|false|prohibit-password).*$'
line
:
'
PermitRootLogin
yes'
backrefs
:
true
when
:
"
ansible_user_id
==
'root'
and
allow_password"
when
:
ansible_user_id == 'root' and allow_password
-
name
:
sshd config GSSAPIAuthentication
become
:
true
lineinfile
:
...
...
tasks/sysctl.yml
View file @
33ac6463
...
...
@@ -34,14 +34,14 @@
name
:
net.core.default_qdisc
value
:
fq
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
become
:
true
sysctl
:
name
:
net.ipv4.tcp_congestion_control
value
:
bbr
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
become
:
true
pam_limits
:
...
...
tasks/upgrade.yml
View file @
33ac6463
...
...
@@ -3,26 +3,26 @@
apt
:
update_cache
:
true
upgrade
:
dist
when
:
"
ansible_os_family
==
'Debian'"
when
:
ansible_os_family == 'Debian'
-
name
:
yum update
become
:
true
yum
:
name
:
'
*'
update_cache
:
true
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
become
:
true
dnf
:
name
:
'
*'
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
become
:
true
iptables
:
chain
:
FORWARD
flush
:
true
when
:
"
ansible_virtualization_role
==
'host'"
when
:
ansible_virtualization_role == 'host'
-
name
:
install a python alternate to prevent ansible problems
become
:
true
apt
:
...
...
tasks/utility.yml
View file @
33ac6463
...
...
@@ -10,19 +10,19 @@
insertafter
:
'
EOF'
line
:
'
{{
ansible_user_id
}}
ALL=(ALL:ALL)
NOPASSWD:
ALL'
validate
:
/usr/sbin/visudo -cf %s
when
:
"
ansible_user_id
!=
'root'"
when
:
ansible_user_id != 'root'
-
name
:
hostname
become
:
true
hostname
:
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
become
:
true
lineinfile
:
dest
:
/etc/hosts
regexp
:
"
^{{
ansible_default_ipv4.address
}}"
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
become
:
true
shell
:
|
...
...
@@ -51,7 +51,7 @@
mirror_debian_security
:
http://mirrors.tuna.tsinghua.edu.cn
mirror_ubuntu
:
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
set_fact
:
target_distribution
:
'
{{
ansible_distribution_release
}}'
...
...
@@ -89,7 +89,7 @@
state
:
absent
autoremove
:
yes
purge
:
yes
when
:
"
ansible_os_family
==
'Debian'"
when
:
ansible_os_family == 'Debian'
-
name
:
remove not proper installed wireguard
become
:
true
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