Commit 9cdc3e03 authored by nanahira's avatar nanahira

changes for Ubuntu 20

parent e9b4ec94
...@@ -2,17 +2,30 @@ ...@@ -2,17 +2,30 @@
become: true become: true
apt: apt:
update_cache: true 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: 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: Ubuntu packages - name: ctags in old Ubuntu
become: true become: true
apt: apt:
name: ctags name: exuberant-ctags
when: "ansible_distribution == 'Ubuntu'" when: "ansible_distribution == 'Ubuntu' and ansible_distribution_release|lower != 'focal'"
- name: Debian packages - 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 become: true
apt: apt:
name: universal-ctags 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 - name: open vm tools
become: true become: true
apt: apt:
......
...@@ -13,25 +13,41 @@ ...@@ -13,25 +13,41 @@
state: absent state: absent
autoremove: yes autoremove: yes
purge: no 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 源公钥 - name: Docker apt 源公钥
become: true become: true
apt_key: apt_key:
url: '{{mirror_docker}}/linux/{{ ansible_distribution|lower }}/gpg' 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 源 - name: Docker apt 源
become: true become: true
apt_repository: apt_repository:
repo: 'deb [arch=amd64] {{mirror_docker}}/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} stable' repo: 'deb [arch=amd64] {{mirror_docker}}/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} stable'
filename: docker filename: docker
when: ansible_os_family == 'Debian' when: ansible_os_family == 'Debian' and ansible_distribution_release|lower != 'focal'
- name: 安装 Docker (apt) - name: 安装 Docker (apt)
become: true become: true
apt: apt:
name: docker-ce,python-backports-shutil-get-terminal-size,python-backports.ssl-match-hostname,python-pip name: docker-ce,python-backports-shutil-get-terminal-size,python-backports.ssl-match-hostname,python-pip
update_cache: yes update_cache: yes
state: latest 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 notify: restart_docker
- name: clean yum Docker - name: clean yum Docker
become: true become: true
...@@ -92,10 +108,11 @@ ...@@ -92,10 +108,11 @@
- 3.5 - 3.5
- 3.6 - 3.6
- 3.7 - 3.7
- name: 'pip3 for RedHat' - 3.8
- name: 'use pip3'
set_fact: set_fact:
pip_executable: pip3 pip_executable: pip3
when: ansible_os_family == 'RedHat' when: ansible_os_family == 'RedHat' or ansible_distribution_release|lower == 'focal'
- name: docker-compose pip - name: docker-compose pip
become: true become: true
pip: pip:
......
...@@ -24,4 +24,4 @@ ...@@ -24,4 +24,4 @@
src: /usr/share/fish/vendor_completions.d/docker.fish src: /usr/share/fish/vendor_completions.d/docker.fish
dest: '~/.config/fish/completions/docker.fish' dest: '~/.config/fish/completions/docker.fish'
remote_src: yes remote_src: yes
when: "install_docker" when: install_docker and ansible_distribution_release|lower != 'focal'
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
- name: upgrade - name: upgrade
include_tasks: 'upgrade.yml' include_tasks: 'upgrade.yml'
when: "upgrade" when: "upgrade"
- name: sshd_config again
include_tasks: 'sshd_config.yml'
- name: hypervisor - name: hypervisor
include_tasks: 'hypervisor.yml' include_tasks: 'hypervisor.yml'
when: "ansible_virtualization_role == 'host'" when: "ansible_virtualization_role == 'host'"
......
...@@ -90,3 +90,25 @@ ...@@ -90,3 +90,25 @@
autoremove: yes autoremove: yes
purge: yes purge: yes
when: "ansible_os_family == 'Debian'" 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