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
ea5e2ea3
Commit
ea5e2ea3
authored
Sep 25, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add source in advance
parent
8523839d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
76 deletions
+62
-76
tasks/debian-pre-upgrade.yml
tasks/debian-pre-upgrade.yml
+0
-12
tasks/docker-source.yml
tasks/docker-source.yml
+36
-0
tasks/docker.yml
tasks/docker.yml
+0
-44
tasks/nvidia-source.yml
tasks/nvidia-source.yml
+19
-0
tasks/nvidia.yml
tasks/nvidia.yml
+0
-19
tasks/utility.yml
tasks/utility.yml
+7
-1
No files found.
tasks/debian-pre-upgrade.yml
View file @
ea5e2ea3
...
@@ -19,15 +19,3 @@
...
@@ -19,15 +19,3 @@
path
:
'
/etc/apt/sources.list.d/wireguard_ubuntu_wireguard_{{
ansible_distribution_release|lower
}}.list'
path
:
'
/etc/apt/sources.list.d/wireguard_ubuntu_wireguard_{{
ansible_distribution_release|lower
}}.list'
state
:
absent
state
:
absent
when
:
ansible_distribution == 'Ubuntu'
when
:
ansible_distribution == 'Ubuntu'
-
name
:
remove not proper installed docker
become
:
true
apt
:
name
:
docker-ce,docker,docker-io,docker.io,docker-ee,nvidia-container-runtime
state
:
absent
autoremove
:
yes
purge
:
yes
-
name
:
remove not proper installed docker repo
become
:
true
file
:
path
:
'
/etc/apt/sources.list.d/docker.list'
state
:
absent
tasks/docker-source.yml
0 → 100644
View file @
ea5e2ea3
-
name
:
China mirror Docker setup
set_fact
:
china_mirror_docker
:
true
when
:
china_mirror
-
name
:
China mirror for Docker
set_fact
:
mirror_docker
:
https://mirrors.tuna.tsinghua.edu.cn/docker-ce
when
:
china_mirror_docker
-
name
:
target distribution for non-sid
set_fact
:
docker_distribution
:
'
{{
ansible_distribution_release|lower
}}'
when
:
ansible_distribution_release != 'sid' and ansible_distribution_release != 'bullseye'
-
name
:
target distribution for sid
set_fact
:
docker_distribution
:
bullseye
when
:
ansible_distribution_release == 'sid' or ansible_distribution_release == 'bullseye'
-
name
:
Docker apt 源公钥
become
:
true
apt_key
:
url
:
'
{{mirror_docker}}/linux/{{
ansible_distribution|lower
}}/gpg'
when
:
ansible_os_family == 'Debian'
-
name
:
Docker apt 源
become
:
true
copy
:
content
:
'
deb
{{mirror_docker}}/linux/{{
ansible_distribution|lower
}}
{{
docker_distribution
}}
stable'
dest
:
/etc/apt/sources.list.d/docker.list
when
:
ansible_os_family == 'Debian'
-
name
:
docker yum 源
become
:
true
yum_repository
:
name
:
docker-ce
description
:
docker-ce
baseurl
:
'
{{mirror_docker}}/linux/{{
ansible_distribution|lower
}}/{{ansible_distribution_major_version}}/$basearch/stable'
ip_resolve
:
'
IPv4'
gpgkey
:
'
{{mirror_docker}}/linux/{{
ansible_distribution|lower
}}/gpg'
when
:
ansible_os_family == "RedHat"
tasks/docker.yml
View file @
ea5e2ea3
-
name
:
China mirror
set_fact
:
china_mirror_docker
:
true
when
:
china_mirror
-
name
:
China mirror for Docker
set_fact
:
mirror_docker
:
https://mirrors.tuna.tsinghua.edu.cn/docker-ce
when
:
china_mirror_docker
-
name
:
clean apt Docker
become
:
true
apt
:
name
:
docker,docker-engine,docker.io,docker-io,docker-ee
state
:
absent
autoremove
:
yes
purge
:
yes
when
:
ansible_os_family == 'Debian'
-
name
:
target distribution for non-sid
set_fact
:
docker_distribution
:
'
{{
ansible_distribution_release|lower
}}'
when
:
ansible_distribution_release != 'sid' and ansible_distribution_release != 'bullseye'
-
name
:
target distribution for sid
set_fact
:
docker_distribution
:
bullseye
when
:
ansible_distribution_release == 'sid' or ansible_distribution_release == 'bullseye'
-
name
:
Docker apt 源公钥
become
:
true
apt_key
:
url
:
'
{{mirror_docker}}/linux/{{
ansible_distribution|lower
}}/gpg'
when
:
ansible_os_family == 'Debian'
-
name
:
Docker apt 源
become
:
true
copy
:
content
:
'
deb
{{mirror_docker}}/linux/{{
ansible_distribution|lower
}}
{{
docker_distribution
}}
stable'
dest
:
/etc/apt/sources.list.d/docker.list
when
:
ansible_os_family == 'Debian'
-
name
:
安装 Docker (apt)
-
name
:
安装 Docker (apt)
become
:
true
become
:
true
apt
:
apt
:
...
@@ -55,15 +20,6 @@
...
@@ -55,15 +20,6 @@
state
:
absent
state
:
absent
autoremove
:
yes
autoremove
:
yes
when
:
ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 8 and ansible_distribution != 'Fedora'
when
:
ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 8 and ansible_distribution != 'Fedora'
-
name
:
docker yum 源
become
:
true
yum_repository
:
name
:
docker-ce
description
:
docker-ce
baseurl
:
'
{{mirror_docker}}/linux/{{
ansible_distribution|lower
}}/{{ansible_distribution_major_version}}/$basearch/stable'
ip_resolve
:
'
IPv4'
gpgkey
:
'
{{mirror_docker}}/linux/{{
ansible_distribution|lower
}}/gpg'
when
:
ansible_os_family == "RedHat"
-
name
:
安装 Docker (yum)
-
name
:
安装 Docker (yum)
become
:
true
become
:
true
yum
:
yum
:
...
...
tasks/nvidia-source.yml
0 → 100644
View file @
ea5e2ea3
-
name
:
nvidia apt key
become
:
true
apt_key
:
url
:
'
https://nvidia.github.io/nvidia-container-runtime/gpgkey'
-
name
:
set distribution string
set_fact
:
container_runtime_distribution_string
:
'
{{
ansible_distribution
|
lower
}}{{
ansible_distribution_version
}}'
when
:
ansible_distribution_major_version|int <
20
-
name
:
set distribution string for Ubuntu
20
set_fact
:
container_runtime_distribution_string
:
'
ubuntu18.04'
when
:
ansible_distribution_major_version|int >=
20
-
name
:
container runtime apt repo
become
:
true
copy
:
content
:
|
deb https://nvidia.github.io/nvidia-container-runtime/stable/{{container_runtime_distribution_string}}/$(ARCH) /
deb https://nvidia.github.io/libnvidia-container/stable/{{container_runtime_distribution_string}}/$(ARCH) /
dest
:
/etc/apt/sources.list.d/nvidia-container-runtime.list
tasks/nvidia.yml
View file @
ea5e2ea3
-
name
:
nvidia apt key
become
:
true
apt_key
:
url
:
'
https://nvidia.github.io/nvidia-container-runtime/gpgkey'
-
name
:
set distribution string
set_fact
:
container_runtime_distribution_string
:
'
{{
ansible_distribution
|
lower
}}{{
ansible_distribution_version
}}'
when
:
ansible_distribution_major_version|int <
20
-
name
:
set distribution string for Ubuntu
20
set_fact
:
container_runtime_distribution_string
:
'
ubuntu18.04'
when
:
ansible_distribution_major_version|int >=
20
-
name
:
container runtime apt repo
become
:
true
copy
:
content
:
|
deb https://nvidia.github.io/nvidia-container-runtime/stable/{{container_runtime_distribution_string}}/$(ARCH) /
deb https://nvidia.github.io/libnvidia-container/stable/{{container_runtime_distribution_string}}/$(ARCH) /
dest
:
/etc/apt/sources.list.d/nvidia-container-runtime.list
-
name
:
install nvidia and related packages
-
name
:
install nvidia and related packages
become
:
true
become
:
true
apt
:
apt
:
...
...
tasks/utility.yml
View file @
ea5e2ea3
...
@@ -96,10 +96,16 @@
...
@@ -96,10 +96,16 @@
file
:
file
:
name
:
/etc/apt/sources.list.d/pve-enterprise.list
name
:
/etc/apt/sources.list.d/pve-enterprise.list
state
:
absent
state
:
absent
-
name
:
docker source
include_tasks
:
docker-source.yml
when
:
install_docker
-
name
:
nvidia source
include_tasks
:
nvidia-source.yml
when
:
nvidia_driver_version and ansible_os_family == 'Debian'
-
name
:
clean some Debian packages
-
name
:
clean some Debian packages
become
:
true
become
:
true
apt
:
apt
:
name
:
ufw,iptables-persistent,needrestart
name
:
ufw,iptables-persistent,needrestart
,docker,docker-engine,docker.io,docker-io,docker-ee
state
:
absent
state
:
absent
autoremove
:
yes
autoremove
:
yes
purge
:
yes
purge
:
yes
...
...
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