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
de4b87aa
Commit
de4b87aa
authored
Apr 26, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unfinished
parent
edeec0b3
Pipeline
#26692
failed with stage
in 5 minutes and 18 seconds
Changes
8
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
107 additions
and
105 deletions
+107
-105
tasks/apt-clean.yml
tasks/apt-clean.yml
+35
-7
tasks/apt.yml
tasks/apt.yml
+43
-44
tasks/byobu.yml
tasks/byobu.yml
+4
-4
tasks/debian-pre-upgrade.yml
tasks/debian-pre-upgrade.yml
+0
-21
tasks/docker.yml
tasks/docker.yml
+0
-8
tasks/pip.yml
tasks/pip.yml
+18
-16
tasks/upgrade.yml
tasks/upgrade.yml
+5
-3
tasks/utility.yml
tasks/utility.yml
+2
-2
No files found.
tasks/apt-clean.yml
View file @
de4b87aa
-
name
:
clean some Debian packages
-
name
:
set packages to remove
set_fact
:
apt_packages_remove
:
[
wireguard-dkms
,
ufw
,
iptables-persistent
,
needrestart
,
docker
,
docker-engine
,
docker.io
,
docker-io
,
docker-ee
,
lxd
,
unattended-upgrades
]
-
name
:
remove wireguard when upgrade
set_fact
:
apt_packages_remove
:
'
{{
apt_packages_remove
+
[
"wireguard-tools",
"wireguard"
]
}}'
when
:
ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int < 20 and target_distribution != ansible_distribution_release
-
name
:
remove old ctags
set_fact
:
apt_packages_remove
:
'
{{
apt_packages_remove
+
[
"exuberant-ctags"
]
}}'
when
:
ansible_distribution == 'Debian' or ansible_distribution_major_version|int >=
20
-
name
:
remove not proper installed wireguard-tools
set_fact
:
apt_packages_remove
:
'
{{
apt_packages_remove
+
[
"wireguard-tools",
"wireguard"
]
}}'
when
:
ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int <
20
-
name
:
remove open-vm-tools
become
:
true
set_fact
:
apt_packages_remove
:
'
{{
apt_packages_remove
+
[
"open-vm-tools"
]
}}'
when
:
ansible_virtualization_role == "guest" and ansible_virtualization_type == "VMware" and vm_agents_status == "absent"
-
name
:
qemu-guest-agent
become
:
true
set_fact
:
apt_packages_remove
:
'
{{
apt_packages_remove
+
[
"qemu-guest-agent"
]
}}'
when
:
ansible_virtualization_role == "guest" and ansible_virtualization_type == "kvm" and vm_agents_status == "absent"
-
name
:
apt remove
become
:
true
apt
:
name
:
ufw,iptables-persistent,needrestart,docker,docker-engine,docker.io,docker-io,docker-ee,lxd,unattended-upgrades
name
:
'
{{
apt_packages_remove
}}'
state
:
absent
purge
:
true
autoclean
:
true
-
name
:
remove not proper installed wireguard repo
become
:
true
file
:
path
:
'
/etc/apt/sources.list.d/wireguard_ubuntu_wireguard_{{
ansible_distribution_release|lower
}}.list'
state
:
absent
autoremove
:
yes
purge
:
yes
environment
:
NEEDRESTART_SUSPEND
:
'
1'
when
:
ansible_os_family == 'Debian'
when
:
ansible_distribution == 'Ubuntu'
tasks/apt.yml
View file @
de4b87aa
...
...
@@ -3,63 +3,62 @@
apt
:
update_cache
:
true
name
:
aptitude
-
name
:
apt
become
:
true
apt
:
# update_cache: true
name
:
curl,wget,git,vim,sudo,byobu,iftop,iotop,build-essential,p7zip-full,p7zip-rar,xclip,astyle,tcpdump,rsync,htop,locales,mtr,dnsutils,net-tools,traceroute,tar,unzip,iperf,iperf3,nmap,mosh,subversion,nfs-common,zsh,haveged,iptables,ipset,iproute2,python3-setuptools,python3-dev,python3-pip,wireguard-tools,zstd,gnupg2,python3-distro
-
name
:
disable rpcbind
become
:
true
systemd
:
name
:
'
{{
item
}}'
state
:
stopped
enabled
:
false
ignore_errors
:
true
when
:
not nfs
with_items
:
-
rpcbind
-
rpcbind.socket
-
name
:
set packages to install
set_fact
:
apt_packages
:
[
curl
,
wget
,
git
,
vim
,
sudo
,
byobu
,
iftop
,
iotop
,
build-essential
,
p7zip-full
,
p7zip-rar
,
xclip
,
astyle
,
tcpdump
,
rsync
,
htop
,
locales
,
mtr
,
dnsutils
,
net-tools
,
traceroute
,
tar
,
unzip
,
iperf
,
iperf3
,
nmap
,
mosh
,
subversion
,
nfs-common
,
zsh
,
haveged
,
iptables
,
ipset
,
iproute2
,
python3-setuptools
,
python3-dev
,
python3-pip
,
wireguard-tools
,
zstd
,
gnupg2
,
python3-distro
]
# extra packages to install
-
name
:
ctags in old Ubuntu
become
:
true
apt
:
name
:
exuberant-ctags
set_fact
:
apt_packages
:
'
{{
apt_packages
+
[
"exuberant-ctags"
]
}}'
when
:
ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int <
20
-
name
:
remove old ctags
become
:
true
apt
:
name
:
exuberant-ctags
state
:
absent
purge
:
true
autoremove
:
true
when
:
ansible_distribution == 'Debian' or ansible_distribution_major_version|int >=
20
-
name
:
ctags in new Ubuntu and Debian
become
:
true
apt
:
name
:
universal-ctags
set_fact
:
apt_packages
:
'
{{
apt_packages
+
[
"universal-ctags"
]
}}'
when
:
ansible_distribution == 'Debian' or ansible_distribution_major_version|int >=
20
-
name
:
python-is-python3
become
:
true
apt
:
name
:
python-is-python3
set_fact
:
apt_packages
:
'
{{
apt_packages
+
[
"python-is-python3"
]
}}'
when
:
(ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int >= 20) or (ansible_distribution == 'Debian' and ansible_distribution_major_version|int >= 11)
-
name
:
pve kernel header
become
:
true
apt
:
name
:
'
pve-headers-{{ansible_kernel}},ifupdown2'
set_fact
:
apt_packages
:
'
{{
apt_packages
+
[
"pve-headers-"
+
ansible_kernel,
"ifupdown2"
]
}}'
when
:
ansible_kernel.endswith("-pve")
-
name
:
add docker
set_fact
:
apt_packages
:
'
{{
apt_packages
+
[
"docker-ce",
"docker-compose-plugin"
]
}}'
when
:
install_docker
-
name
:
open-vm-tools
become
:
true
apt
:
name
:
open-vm-tools
state
:
'
{{vm_agents_status}}'
when
:
ansible_virtualization_role == "guest" and ansible_virtualization_type == "VMware"
set_fact
:
apt_packages
:
'
{{
apt_packages
+
[
"open-vm-tools"
]
}}'
when
:
ansible_virtualization_role == "guest" and ansible_virtualization_type == "VMware" and vm_agents_status == "present"
-
name
:
qemu-guest-agent
set_fact
:
apt_packages
:
'
{{
apt_packages
+
[
"qemu-guest-agent"
]
}}'
when
:
ansible_virtualization_role == "guest" and ansible_virtualization_type == "kvm" and vm_agents_status == "present"
-
name
:
apt
become
:
true
apt
:
name
:
qemu-guest-agent
state
:
'
{{vm_agents_status}}'
when
:
ansible_virtualization_role == "guest" and ansible_virtualization_type == "kvm"
# update_cache: true
name
:
'
{{
apt_packages
}}'
-
name
:
apt autoremove
become
:
true
apt
:
autoremove
:
true
purge
:
true
-
name
:
set services to disable
set_fact
:
services_to_disable
:
-
iperf3
-
name
:
non nfs should disable rpcbind
set_fact
:
# append to the list
services_to_disable
:
'
{{
services_to_disable
+
[
"rpcbind",
"rpcbind.socket"
]
}}'
-
name
:
disable services
become
:
true
systemd
:
name
:
'
{{
item
}}'
state
:
stopped
enabled
:
false
ignore_errors
:
true
when
:
not nfs
with_items
:
'
{{services_to_disable}}'
tasks/byobu.yml
View file @
de4b87aa
...
...
@@ -4,10 +4,10 @@
name
:
/usr/share/byobu/status/status
line
:
'
tmux_right="#network
#disk_io
#custom
#entropy
raid
reboot_required
updates_available
#apport
#services
#mail
#users
uptime
#ec2_cost
#rcs_cost
#fan_speed
#cpu_temp
#battery
#wifi_quality
#processes
load_average
cpu_count
cpu_freq
memory
#swap
disk
#whoami
hostname
#ip_address
#time_utc
#date
#time"'
regexp
:
^tmux_right=
-
name
:
终端环境 byobu enable
shell
:
echo 'exit 0' | byobu-enable
changed_when
:
false
failed_when
:
false
#
- name: 终端环境 byobu enable
#
shell: echo 'exit 0' | byobu-enable
#
changed_when: false
#
failed_when: false
-
name
:
终端环境 byobu ctrl-a
command
:
byobu-ctrl-a emacs
args
:
...
...
tasks/debian-pre-upgrade.yml
deleted
100644 → 0
View file @
edeec0b3
-
name
:
remove not proper installed wireguard-tools
become
:
true
apt
:
name
:
wireguard-tools,wireguard
state
:
absent
autoremove
:
yes
purge
:
yes
when
:
ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int <
20
-
name
:
remove not proper installed wireguard
become
:
true
apt
:
name
:
wireguard-dkms
state
:
absent
autoremove
:
yes
purge
:
yes
-
name
:
remove not proper installed wireguard repo
become
:
true
file
:
path
:
'
/etc/apt/sources.list.d/wireguard_ubuntu_wireguard_{{
ansible_distribution_release|lower
}}.list'
state
:
absent
when
:
ansible_distribution == 'Ubuntu'
tasks/docker.yml
View file @
de4b87aa
-
name
:
安装 Docker (apt)
become
:
true
apt
:
name
:
docker-ce,docker-compose-plugin
state
:
latest
update_cache
:
yes
when
:
ansible_os_family == 'Debian'
notify
:
restart_docker
-
name
:
clean yum Docker
become
:
true
yum
:
...
...
tasks/pip.yml
View file @
de4b87aa
...
...
@@ -57,28 +57,30 @@
path
:
'
/usr/local/lib/python{{item}}/dist-packages/easy-install.pth'
state
:
absent
with_items
:
-
2.7
-
3.5
-
3.6
-
3.7
-
3.8
-
3.9
-
3.10
-
3.11
-
'
2.7'
-
'
3.5'
-
'
3.6'
-
'
3.7'
-
'
3.8'
-
'
3.9'
-
'
3.10'
-
'
3.11'
-
'
3.12'
-
name
:
clean external managed flag
become
:
true
file
:
path
:
/usr/lib/python{{item}}/EXTERNALLY-MANAGED
state
:
absent
with_items
:
-
2.7
-
3.5
-
3.6
-
3.7
-
3.8
-
3.9
-
3.10
-
3.11
-
'
2.7'
-
'
3.5'
-
'
3.6'
-
'
3.7'
-
'
3.8'
-
'
3.9'
-
'
3.10'
-
'
3.11'
-
'
3.12'
-
name
:
upgrade pip
become
:
true
pip
:
...
...
tasks/upgrade.yml
View file @
de4b87aa
-
name
:
debian-pre-upgrade
include_tasks
:
'
debian-pre-upgrade.yml'
when
:
ansible_os_family == 'Debian' and target_distribution != ansible_distribution_release
-
name
:
byobu disable when upgrading to Ubuntu
24.04
shell
:
byobu-disable
ignore_errors
:
true
changed_when
:
false
when
:
target_distribution != ansible_distribution_release and target_distribution == 'noble'
-
name
:
apt upgrade
become
:
true
apt
:
...
...
tasks/utility.yml
View file @
de4b87aa
...
...
@@ -77,9 +77,9 @@
set_fact
:
target_distribution
:
'
{{
ansible_distribution_release
}}'
when
:
not upgrade or ansible_distribution_release == 'sid' or keep_distro
-
name
:
move to
jammy
-
name
:
move to
noble
set_fact
:
target_distribution
:
'
jammy
'
target_distribution
:
'
noble
'
when
:
ansible_distribution == 'Ubuntu' and upgrade and not keep_distro
-
name
:
move to bookworm
set_fact
:
...
...
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