Commit 9cdc3e03 authored by nanahira's avatar nanahira

changes for Ubuntu 20

parent e9b4ec94
......@@ -2,17 +2,30 @@
become: true
apt:
update_cache: true
name: curl,wget,git,vim,sudo,byobu,iftop,iotop,build-essential,p7zip-full,p7zip-rar,xclip,astyle,python-setuptools,python-dev,python-pip,tcpdump,rsync,htop,locales,mtr,dnsutils,net-tools,traceroute,tar,unzip,iperf,iperf3,nmap,mosh,subversion,nfs-common,fish,haveged
- name: Ubuntu packages
name: curl,wget,git,vim,sudo,byobu,iftop,iotop,build-essential,p7zip-full,p7zip-rar,xclip,astyle,python3-setuptools,python3-dev,python3-pip,tcpdump,rsync,htop,locales,mtr,dnsutils,net-tools,traceroute,tar,unzip,iperf,iperf3,nmap,mosh,subversion,nfs-common,fish,haveged
- name: ctags in old Ubuntu
become: true
apt:
name: ctags
when: "ansible_distribution == 'Ubuntu'"
- name: Debian packages
name: exuberant-ctags
when: "ansible_distribution == 'Ubuntu' and ansible_distribution_release|lower != 'focal'"
- name: remove old ctags
become: true
apt:
name: exuberant-ctags
state: absent
purge: true
autoremove: true
when: "ansible_distribution == 'Debian' or ansible_distribution_release|lower == 'focal'"
- name: ctags in new Ubuntu and Debian
become: true
apt:
name: universal-ctags
when: "ansible_distribution == 'Debian'"
when: "ansible_distribution == 'Debian' or ansible_distribution_release|lower == 'focal'"
- name: Focal packages
become: true
apt:
name: python-is-python3,wireguard
when: ansible_distribution_release|lower == 'focal'
- name: open vm tools
become: true
apt:
......
......@@ -13,25 +13,41 @@
state: absent
autoremove: yes
purge: no
when: ansible_os_family == 'Debian'
when: ansible_os_family == 'Debian' and ansible_distribution_release|lower != 'focal'
- name: clean apt Docker for Focal
become: true
apt:
name: docker-ce,docker-ee
state: absent
autoremove: yes
purge: no
when: ansible_os_family == 'Debian' and ansible_distribution_release|lower == 'focal'
- name: Docker apt 源公钥
become: true
apt_key:
url: '{{mirror_docker}}/linux/{{ ansible_distribution|lower }}/gpg'
when: ansible_os_family == 'Debian'
when: ansible_os_family == 'Debian' and ansible_distribution_release|lower != 'focal'
- name: Docker apt 源
become: true
apt_repository:
repo: 'deb [arch=amd64] {{mirror_docker}}/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} stable'
filename: docker
when: ansible_os_family == 'Debian'
when: ansible_os_family == 'Debian' and ansible_distribution_release|lower != 'focal'
- name: 安装 Docker (apt)
become: true
apt:
name: docker-ce,python-backports-shutil-get-terminal-size,python-backports.ssl-match-hostname,python-pip
update_cache: yes
state: latest
when: ansible_os_family == 'Debian'
when: ansible_os_family == 'Debian' and ansible_distribution_release|lower != 'focal'
notify: restart_docker
- name: 安装 Docker (focal)
become: true
apt:
name: docker.io,python3-pip
update_cache: yes
state: latest
when: ansible_os_family == 'Debian' and ansible_distribution_release|lower == 'focal'
notify: restart_docker
- name: clean yum Docker
become: true
......@@ -92,10 +108,11 @@
- 3.5
- 3.6
- 3.7
- name: 'pip3 for RedHat'
- 3.8
- name: 'use pip3'
set_fact:
pip_executable: pip3
when: ansible_os_family == 'RedHat'
when: ansible_os_family == 'RedHat' or ansible_distribution_release|lower == 'focal'
- name: docker-compose pip
become: true
pip:
......
......@@ -24,4 +24,4 @@
src: /usr/share/fish/vendor_completions.d/docker.fish
dest: '~/.config/fish/completions/docker.fish'
remote_src: yes
when: "install_docker"
when: install_docker and ansible_distribution_release|lower != 'focal'
......@@ -14,6 +14,8 @@
- name: upgrade
include_tasks: 'upgrade.yml'
when: "upgrade"
- name: sshd_config again
include_tasks: 'sshd_config.yml'
- name: hypervisor
include_tasks: 'hypervisor.yml'
when: "ansible_virtualization_role == 'host'"
......
......@@ -90,3 +90,25 @@
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_release != 'focal'
- 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_release != 'focal'
- name: remove not proper installed wireguard repo
become: true
apt_repository:
repo: ppa:wireguard/wireguard
state: absent
when: ansible_distribution == 'Ubuntu' and upgrade and ansible_distribution_release != 'focal'
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