Commit bad3ed62 authored by nanahira's avatar nanahira

improve upgrade

parent 004e5062
Pipeline #4708 failed with stage
in 9 seconds
- name: remove not proper installed wireguard-tools
become: true
apt:
name: wireguard-tools,wireguard
state: absent
autoremove: yes
purge: yes
when: ansible_distribution == 'Ubuntu'
- 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'
- 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
......@@ -29,9 +29,9 @@
when: ansible_os_family == 'Debian'
- name: Docker apt 源
become: true
apt_repository:
repo: 'deb {{mirror_docker}}/linux/{{ ansible_distribution|lower }} {{ docker_distribution }} stable'
filename: docker
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)
become: true
......
......@@ -12,12 +12,11 @@
when: ansible_distribution_major_version|int >= 20
- name: container runtime apt repo
become: true
apt_repository:
repo: 'deb https://nvidia.github.io/{{item}}/stable/{{container_runtime_distribution_string}}/$(ARCH) /'
filename: nvidia-container-runtime
with_items:
- nvidia-container-runtime
- libnvidia-container
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
become: true
apt:
......
- name: debian-pre-upgrade
include_tasks: 'debian-pre-upgrade.yml'
when: ansible_os_family == 'Debian' and target_distribution != ansible_distribution_release
- name: apt upgrade
become: true
apt:
......@@ -22,7 +25,7 @@
become: true
apt:
name: python-is-python3
when: ansible_distribution == 'Ubuntu' and upgrade
when: ansible_distribution == 'Ubuntu'
- name: install nvidia driver before reboot
become: true
apt:
......
......@@ -93,28 +93,6 @@
autoremove: yes
purge: yes
when: ansible_os_family == 'Debian'
- name: remove not proper installed wireguard
become: true
apt:
name: wireguard,wireguard-tools,wireguard-dkms
state: absent
autoremove: yes
purge: yes
when: ansible_distribution == 'Ubuntu' and upgrade and ansible_distribution_major_version|int < 20
- name: remove not proper installed wireguard
become: true
apt:
name: wireguard,wireguard-tools,wireguard-dkms
state: absent
autoremove: yes
purge: yes
when: ansible_distribution == 'Ubuntu' and upgrade and ansible_distribution_major_version|int < 20
- 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' and (upgrade or ansible_distribution_major_version|int >= 20)
- name: Debian laptop disable lid
become: true
blockinfile:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment