Commit 99a9abd4 authored by nanahira's avatar nanahira

fedora

parent c6fe3193
...@@ -6,7 +6,13 @@ ...@@ -6,7 +6,13 @@
- name: dnf - name: dnf
become: true become: true
dnf: dnf:
name: curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,python3-pip,tcpdump,rsync,htop,mtr,net-tools,ctags,astyle,xclip,traceroute,tar,unzip,nmap,python3-libselinux,mosh,subversion,haveged # nfs-common,fish name: curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,python3-pip,tcpdump,rsync,htop,mtr,net-tools,ctags,astyle,xclip,traceroute,tar,unzip,nmap,python3-libselinux,mosh,subversion,haveged,nfs-utils # nfs-common,fish
update_cache: yes
- name: Fish for Fedora
become: true
dnf:
name: fish
when: ansible_distribution == 'Fedora'
- name: open vm tools - name: open vm tools
become: true become: true
dnf: dnf:
......
...@@ -45,7 +45,6 @@ ...@@ -45,7 +45,6 @@
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
when: ansible_os_family == 'Debian' and ansible_distribution_release|lower != 'focal' when: ansible_os_family == 'Debian' and ansible_distribution_release|lower != 'focal'
notify: restart_docker notify: restart_docker
- name: 安装 Docker (focal) - name: 安装 Docker (focal)
...@@ -53,7 +52,6 @@ ...@@ -53,7 +52,6 @@
apt: apt:
name: docker.io,python3-pip name: docker.io,python3-pip
update_cache: yes update_cache: yes
state: latest
when: ansible_os_family == 'Debian' and ansible_distribution_release|lower == 'focal' 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
...@@ -71,7 +69,7 @@ ...@@ -71,7 +69,7 @@
baseurl: '{{mirror_docker}}/linux/{{ ansible_distribution|lower }}/{{ansible_distribution_major_version}}/$basearch/stable' baseurl: '{{mirror_docker}}/linux/{{ ansible_distribution|lower }}/{{ansible_distribution_major_version}}/$basearch/stable'
ip_resolve: 4 ip_resolve: 4
gpgkey: '{{mirror_docker}}/linux/{{ ansible_distribution|lower }}/gpg' gpgkey: '{{mirror_docker}}/linux/{{ ansible_distribution|lower }}/gpg'
when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int != 8 when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int < 8
- name: docker yum 源 (CentOS 8) - name: docker yum 源 (CentOS 8)
become: true become: true
yum_repository: yum_repository:
...@@ -80,19 +78,32 @@ ...@@ -80,19 +78,32 @@
baseurl: '{{mirror_docker}}/linux/centos/7/$basearch/stable' baseurl: '{{mirror_docker}}/linux/centos/7/$basearch/stable'
ip_resolve: 4 ip_resolve: 4
gpgkey: '{{mirror_docker}}/linux/7/gpg' gpgkey: '{{mirror_docker}}/linux/7/gpg'
when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 8 when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8
- name: containerd.io - name: containerd.io
become: true become: true
dnf: dnf:
name: '{{mirror_docker}}/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm' name: '{{mirror_docker}}/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm'
when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int >= 8 when: ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8
- name: 安装 Docker (yum) - name: 安装 Docker (yum)
become: true become: true
yum: yum:
name: python3-pip,docker-ce,docker-ce-cli,containerd.io name: python3-pip,docker-ce,docker-ce-cli,containerd.io
update_cache: yes update_cache: yes
state: latest when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int < 8
when: ansible_os_family == 'RedHat' notify: restart_docker
- name: 安装 Docker (CentOS 8)
become: true
dnf:
name: python3-pip,docker-ce,docker-ce-cli,containerd.io
update_cache: yes
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int == 8
notify: restart_docker
- name: 安装 Docker (Fedora)
become: true
dnf:
name: python3-pip,moby-engine
update_cache: yes
when: ansible_distribution == 'Fedora'
notify: restart_docker notify: restart_docker
- name: docker user group - name: docker user group
become: true become: true
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
when: "install_docker" when: "install_docker"
- name: fish - name: fish
include_tasks: fish.yml include_tasks: fish.yml
when: "ansible_os_family == 'Debian'" # RedHat has too many problems on fish, so aborted when: ansible_os_family == 'Debian' or ansible_distribution == 'Fedora' # RedHat has too many problems on fish, so aborted
- name: customize - name: customize
include_tasks: '{{item}}.yml' include_tasks: '{{item}}.yml'
with_items: with_items:
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
selinux: selinux:
state: disabled state: disabled
- name: disable selinux - name: disable selinux
become: true
lineinfile: lineinfile:
path: /etc/selinux/config path: /etc/selinux/config
regexp: '^SELINUX=' regexp: '^SELINUX='
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
- name: yum - name: yum
become: true become: true
yum: yum:
name: curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,python-pip,tcpdump,rsync,htop,mtr,net-tools,ctags,xclip,traceroute,tar,unzip,iperf,iperf3,nmap,libselinux-python,mosh,subversion,fish,haveged,mtr,rsync # astyle # nfs-common name: curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,python-pip,tcpdump,rsync,htop,mtr,net-tools,ctags,xclip,traceroute,tar,unzip,iperf,iperf3,nmap,libselinux-python,mosh,subversion,fish,haveged,mtr,rsync,nfs-utils # astyle
update_cache: yes
- name: open vm tools - name: open vm tools
become: true become: true
yum: yum:
......
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