Commit 02fc4d2f authored by nanahira's avatar nanahira

use red hat

parent 46e9e640
...@@ -31,10 +31,10 @@ ...@@ -31,10 +31,10 @@
yum: yum:
state: latest state: latest
name: epel-release name: epel-release
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int <= 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int <= 7"
- name: yum - name: yum
become: true become: true
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int <= 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int <= 7"
yum: yum:
state: latest state: latest
update_cache: true update_cache: true
...@@ -44,10 +44,10 @@ ...@@ -44,10 +44,10 @@
dnf: dnf:
state: latest state: latest
name: epel-release name: epel-release
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
- name: dnf - name: dnf
become: true become: true
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
dnf: dnf:
state: latest state: latest
name: sudo,python3,qemu-kvm,qemu-img,libvirt,python3-libvirt,libguestfs-tools,virt-install,python3-lxml name: sudo,python3,qemu-kvm,qemu-img,libvirt,python3-libvirt,libguestfs-tools,virt-install,python3-lxml
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
name: firewalld name: firewalld
state: stopped state: stopped
enabled: false enabled: false
when: "ansible_distribution == 'CentOS'" when: "ansible_os_family == "RedHat""
- name: flush forward table - name: flush forward table
become: true become: true
iptables: iptables:
......
...@@ -107,14 +107,14 @@ ...@@ -107,14 +107,14 @@
name: '*' name: '*'
update_cache: true update_cache: true
state: latest state: latest
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 7"
- name: dnf update - name: dnf update
become: true become: true
dnf: dnf:
name: '*' name: '*'
#update_cache: true #update_cache: true
state: latest state: latest
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
- name: fixup iptables with qemu - name: fixup iptables with qemu
become: true become: true
iptables: iptables:
...@@ -152,42 +152,42 @@ ...@@ -152,42 +152,42 @@
yum: yum:
state: latest state: latest
name: epel-release name: epel-release
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 7"
- name: yum - name: yum
become: true become: true
yum: yum:
state: latest state: latest
name: curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,tcpdump,rsync,htop,mtr,net-tools,ctags,xclip,traceroute,tar,unzip,iperf,nmap,libselinux-python,mosh # astyle name: curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,tcpdump,rsync,htop,mtr,net-tools,ctags,xclip,traceroute,tar,unzip,iperf,nmap,libselinux-python,mosh # astyle
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 7"
- name: epel 8 - name: epel 8
become: true become: true
dnf: dnf:
state: latest state: latest
name: epel-release name: epel-release
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
- name: dnf - name: dnf
become: true become: true
dnf: dnf:
state: latest state: latest
name: curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,tcpdump,rsync,htop,mtr,net-tools,ctags,astyle,traceroute,tar,unzip,nmap,python3-libselinux,mosh # xclip name: curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,tcpdump,rsync,htop,mtr,net-tools,ctags,astyle,traceroute,tar,unzip,nmap,python3-libselinux,mosh # xclip
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
- name: dnf autoremove - name: dnf autoremove
become: true become: true
dnf: dnf:
autoremove: true autoremove: true
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
- name: disable selinux - name: disable selinux
become: true become: true
selinux: selinux:
state: disabled state: disabled
when: "ansible_distribution == 'CentOS'" when: "ansible_os_family == "RedHat""
- name: disable selinux - name: disable selinux
lineinfile: lineinfile:
path: /etc/selinux/config path: /etc/selinux/config
regexp: '^SELINUX=' regexp: '^SELINUX='
line: 'SELINUX=disabled' line: 'SELINUX=disabled'
backrefs: true backrefs: true
when: "ansible_distribution == 'CentOS'" when: "ansible_os_family == "RedHat""
- name: vim - name: vim
unarchive: unarchive:
src: https://minio.mycard.moe:9000/nanahira/nanahira-vim.tar.gz src: https://minio.mycard.moe:9000/nanahira/nanahira-vim.tar.gz
......
...@@ -25,26 +25,26 @@ ...@@ -25,26 +25,26 @@
state: latest state: latest
update_cache: true update_cache: true
name: epel-release,curl name: epel-release,curl
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int <= 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int <= 7"
- name: yum - name: yum
become: true become: true
yum: yum:
state: latest state: latest
update_cache: true update_cache: true
name: wget,git,gcc,gcc-c++,make,sqlite-devel,readline-devel,openssl-devel,libevent-devel,redis,p7zip,p7zip-plugins,tar,unzip name: wget,git,gcc,gcc-c++,make,sqlite-devel,readline-devel,openssl-devel,libevent-devel,redis,p7zip,p7zip-plugins,tar,unzip
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int <= 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int <= 7"
- name: epel 8 - name: epel 8
become: true become: true
dnf: dnf:
state: latest state: latest
name: epel-release name: epel-release
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
- name: dnf - name: dnf
become: true become: true
dnf: dnf:
state: latest state: latest
name: curl,wget,gcc,gcc-c++,make,sqlite-devel,readline-devel,openssl-devel,libevent-devel,redis,p7zip,p7zip-plugins,tar,unzip name: curl,wget,gcc,gcc-c++,make,sqlite-devel,readline-devel,openssl-devel,libevent-devel,redis,p7zip,p7zip-plugins,tar,unzip
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
- name: pre data - name: pre data
git: git:
repo: 'https://git.dev.tencent.com/mercury233/ygopro-pre-data.git' repo: 'https://git.dev.tencent.com/mercury233/ygopro-pre-data.git'
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
name: firewalld name: firewalld
state: stopped state: stopped
enabled: false enabled: false
when: "ansible_distribution == 'CentOS'" when: "ansible_os_family == "RedHat""
- name: redis - name: redis
become: true become: true
systemd: systemd:
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
state: latest state: latest
update_cache: true update_cache: true
name: curl,wget,gcc,gcc-c++,make,tar,unzip,python,rsync name: curl,wget,gcc,gcc-c++,make,tar,unzip,python,rsync
when: "ansible_distribution == 'CentOS'" when: "ansible_os_family == "RedHat""
- name: directories - name: directories
file: file:
path: '/srv/{{item}}' path: '/srv/{{item}}'
......
...@@ -43,13 +43,13 @@ ...@@ -43,13 +43,13 @@
state: latest state: latest
update_cache: true update_cache: true
name: epel-release name: epel-release
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int <= 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int <= 7"
- name: docker from yum - name: docker from yum
yum: yum:
state: latest state: latest
update_cache: true update_cache: true
name: rsync,tar,unzip,docker,python-pip name: rsync,tar,unzip,docker,python-pip
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int <= 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int <= 7"
- name: systemd - name: systemd
become: true become: true
systemd: systemd:
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
become: true become: true
rpm_key: rpm_key:
key: 'http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef' key: 'http://pool.sks-keyservers.net/pks/lookup?op=get&search=0x3fa7e0328081bff6a14da29aa6a19b38d3d831ef'
when: "ansible_distribution == 'CentOS'" when: "ansible_os_family == "RedHat""
- name: mono yum source - name: mono yum source
become: true become: true
yum_repository: yum_repository:
...@@ -19,17 +19,17 @@ ...@@ -19,17 +19,17 @@
baseurl: 'https://download.mono-project.com/repo/centos{{ansible_distribution_major_version}}-stable/' baseurl: 'https://download.mono-project.com/repo/centos{{ansible_distribution_major_version}}-stable/'
ip_resolve: 4 ip_resolve: 4
gpgkey: "https://download.mono-project.com/repo/xamarin.gpg" gpgkey: "https://download.mono-project.com/repo/xamarin.gpg"
when: "ansible_distribution == 'CentOS'" when: "ansible_os_family == "RedHat""
- name: mono from yum - name: mono from yum
become: true become: true
yum: yum:
state: latest state: latest
update_cache: true update_cache: true
name: mono-complete name: mono-complete
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int <= 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int <= 7"
- name: mono from dnf - name: mono from dnf
become: true become: true
dnf: dnf:
state: latest state: latest
name: mono-complete name: mono-complete
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
...@@ -38,26 +38,26 @@ ...@@ -38,26 +38,26 @@
state: latest state: latest
update_cache: true update_cache: true
name: epel-release name: epel-release
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int <= 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int <= 7"
- name: nodejs from yum - name: nodejs from yum
become: true become: true
yum: yum:
state: latest state: latest
update_cache: true update_cache: true
name: npm name: npm
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int <= 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int <= 7"
- name: epel 8 - name: epel 8
become: true become: true
dnf: dnf:
state: latest state: latest
name: epel-release name: epel-release
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
- name: nodejs from dnf - name: nodejs from dnf
become: true become: true
dnf: dnf:
state: latest state: latest
name: nodejs,npm name: nodejs,npm
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
- name: npm - name: npm
become: true become: true
npm: npm:
......
...@@ -41,29 +41,29 @@ ...@@ -41,29 +41,29 @@
baseurl: 'https://copr-be.cloud.fedoraproject.org/results/jdoss/wireguard/epel-{{ansible_distribution_major_version}}-$basearch/' baseurl: 'https://copr-be.cloud.fedoraproject.org/results/jdoss/wireguard/epel-{{ansible_distribution_major_version}}-$basearch/'
ip_resolve: 4 ip_resolve: 4
gpgkey: "https://copr-be.cloud.fedoraproject.org/results/jdoss/wireguard/pubkey.gpg" gpgkey: "https://copr-be.cloud.fedoraproject.org/results/jdoss/wireguard/pubkey.gpg"
when: "ansible_distribution == 'CentOS'" when: "ansible_os_family == "RedHat""
- name: epel 7 - name: epel 7
become: true become: true
yum: yum:
state: latest state: latest
name: epel-release name: epel-release
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int <= 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int <= 7"
- name: 安装软件包 (yum) - name: 安装软件包 (yum)
become: true become: true
yum: yum:
state: latest state: latest
update_cache: true update_cache: true
name: wireguard-tools,wireguard-dkms name: wireguard-tools,wireguard-dkms
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int <= 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int <= 7"
- name: epel 8 - name: epel 8
become: true become: true
dnf: dnf:
state: latest state: latest
name: epel-release name: epel-release
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
- name: 安装软件包 (dnf) - name: 安装软件包 (dnf)
become: true become: true
dnf: dnf:
state: latest state: latest
name: wireguard-tools,wireguard-dkms name: wireguard-tools,wireguard-dkms
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
...@@ -98,14 +98,14 @@ ...@@ -98,14 +98,14 @@
name: '*' name: '*'
update_cache: true update_cache: true
state: latest state: latest
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 7"
- name: dnf update - name: dnf update
become: true become: true
dnf: dnf:
name: '*' name: '*'
#update_cache: true #update_cache: true
state: latest state: latest
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
- name: fixup iptables with qemu - name: fixup iptables with qemu
become: true become: true
iptables: iptables:
...@@ -129,35 +129,35 @@ ...@@ -129,35 +129,35 @@
yum: yum:
state: latest state: latest
name: epel-release name: epel-release
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 7"
- name: yum - name: yum
become: true become: true
yum: yum:
state: latest state: latest
name: curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,tcpdump,rsync,htop,mtr,net-tools,traceroute,tar,unzip,iperf,nmap,libselinux-python,open-vm-tools name: curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,tcpdump,rsync,htop,mtr,net-tools,traceroute,tar,unzip,iperf,nmap,libselinux-python,open-vm-tools
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 7" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 7"
- name: epel 8 - name: epel 8
become: true become: true
dnf: dnf:
state: latest state: latest
name: epel-release name: epel-release
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
- name: dnf - name: dnf
become: true become: true
dnf: dnf:
state: latest state: latest
name: curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,tcpdump,rsync,htop,mtr,net-tools,traceroute,tar,unzip,nmap,python3-libselinux,open-vm-tools name: curl,wget,git,vim,sudo,byobu,iftop,iotop,gcc,gcc-c++,make,autoconf,p7zip,p7zip-plugins,tcpdump,rsync,htop,mtr,net-tools,traceroute,tar,unzip,nmap,python3-libselinux,open-vm-tools
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
- name: dnf autoremove - name: dnf autoremove
become: true become: true
dnf: dnf:
autoremove: true autoremove: true
when: "ansible_distribution == 'CentOS' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == "RedHat" and ansible_distribution_major_version|int == 8"
- name: disable selinux - name: disable selinux
become: true become: true
selinux: selinux:
state: disabled state: disabled
when: "ansible_distribution == 'CentOS'" when: "ansible_os_family == "RedHat""
- name: disable selinux - name: disable selinux
become: true become: true
lineinfile: lineinfile:
...@@ -165,18 +165,18 @@ ...@@ -165,18 +165,18 @@
regexp: '^SELINUX=' regexp: '^SELINUX='
line: 'SELINUX=disabled' line: 'SELINUX=disabled'
backrefs: true backrefs: true
when: "ansible_distribution == 'CentOS'" when: "ansible_os_family == "RedHat""
- name: remove hwaddr in ifcfg - name: remove hwaddr in ifcfg
become: true become: true
shell: 'sed -i "/HWADDR/d" /etc/sysconfig/network-scripts/ifcfg-*' shell: 'sed -i "/HWADDR/d" /etc/sysconfig/network-scripts/ifcfg-*'
when: "ansible_distribution == 'CentOS'" when: "ansible_os_family == "RedHat""
- name: set hostname to localhost - name: set hostname to localhost
become: true become: true
lineinfile: lineinfile:
path: /etc/sysconfig/network path: /etc/sysconfig/network
line: 'HOSTNAME=localhost.localdomain' line: 'HOSTNAME=localhost.localdomain'
insertafter: 'EOF' insertafter: 'EOF'
when: "ansible_distribution == 'CentOS'" when: "ansible_os_family == "RedHat""
- name: ssh-keygen service - name: ssh-keygen service
become: true become: true
copy: copy:
......
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