Commit 02fc4d2f authored by nanahira's avatar nanahira

use red hat

parent 46e9e640
......@@ -31,10 +31,10 @@
yum:
state: latest
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
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:
state: latest
update_cache: true
......@@ -44,10 +44,10 @@
dnf:
state: latest
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
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:
state: latest
name: sudo,python3,qemu-kvm,qemu-img,libvirt,python3-libvirt,libguestfs-tools,virt-install,python3-lxml
......@@ -70,7 +70,7 @@
name: firewalld
state: stopped
enabled: false
when: "ansible_distribution == 'CentOS'"
when: "ansible_os_family == "RedHat""
- name: flush forward table
become: true
iptables:
......
......@@ -107,14 +107,14 @@
name: '*'
update_cache: true
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
become: true
dnf:
name: '*'
#update_cache: true
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
become: true
iptables:
......@@ -152,42 +152,42 @@
yum:
state: latest
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
become: true
yum:
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
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
become: true
dnf:
state: latest
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
become: true
dnf:
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
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
become: true
dnf:
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
become: true
selinux:
state: disabled
when: "ansible_distribution == 'CentOS'"
when: "ansible_os_family == "RedHat""
- name: disable selinux
lineinfile:
path: /etc/selinux/config
regexp: '^SELINUX='
line: 'SELINUX=disabled'
backrefs: true
when: "ansible_distribution == 'CentOS'"
when: "ansible_os_family == "RedHat""
- name: vim
unarchive:
src: https://minio.mycard.moe:9000/nanahira/nanahira-vim.tar.gz
......
......@@ -25,26 +25,26 @@
state: latest
update_cache: true
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
become: true
yum:
state: latest
update_cache: true
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
become: true
dnf:
state: latest
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
become: true
dnf:
state: latest
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
git:
repo: 'https://git.dev.tencent.com/mercury233/ygopro-pre-data.git'
......@@ -191,7 +191,7 @@
name: firewalld
state: stopped
enabled: false
when: "ansible_distribution == 'CentOS'"
when: "ansible_os_family == "RedHat""
- name: redis
become: true
systemd:
......
......@@ -20,7 +20,7 @@
state: latest
update_cache: true
name: curl,wget,gcc,gcc-c++,make,tar,unzip,python,rsync
when: "ansible_distribution == 'CentOS'"
when: "ansible_os_family == "RedHat""
- name: directories
file:
path: '/srv/{{item}}'
......
......@@ -43,13 +43,13 @@
state: latest
update_cache: true
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
yum:
state: latest
update_cache: true
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
become: true
systemd:
......
......@@ -10,7 +10,7 @@
become: true
rpm_key:
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
become: true
yum_repository:
......@@ -19,17 +19,17 @@
baseurl: 'https://download.mono-project.com/repo/centos{{ansible_distribution_major_version}}-stable/'
ip_resolve: 4
gpgkey: "https://download.mono-project.com/repo/xamarin.gpg"
when: "ansible_distribution == 'CentOS'"
when: "ansible_os_family == "RedHat""
- name: mono from yum
become: true
yum:
state: latest
update_cache: true
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
become: true
dnf:
state: latest
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 @@
state: latest
update_cache: true
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
become: true
yum:
state: latest
update_cache: true
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
become: true
dnf:
state: latest
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
become: true
dnf:
state: latest
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
become: true
npm:
......
......@@ -41,29 +41,29 @@
baseurl: 'https://copr-be.cloud.fedoraproject.org/results/jdoss/wireguard/epel-{{ansible_distribution_major_version}}-$basearch/'
ip_resolve: 4
gpgkey: "https://copr-be.cloud.fedoraproject.org/results/jdoss/wireguard/pubkey.gpg"
when: "ansible_distribution == 'CentOS'"
when: "ansible_os_family == "RedHat""
- name: epel 7
become: true
yum:
state: latest
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)
become: true
yum:
state: latest
update_cache: true
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
become: true
dnf:
state: latest
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)
become: true
dnf:
state: latest
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 @@
name: '*'
update_cache: true
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
become: true
dnf:
name: '*'
#update_cache: true
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
become: true
iptables:
......@@ -129,35 +129,35 @@
yum:
state: latest
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
become: true
yum:
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
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
become: true
dnf:
state: latest
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
become: true
dnf:
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
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
become: true
dnf:
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
become: true
selinux:
state: disabled
when: "ansible_distribution == 'CentOS'"
when: "ansible_os_family == "RedHat""
- name: disable selinux
become: true
lineinfile:
......@@ -165,18 +165,18 @@
regexp: '^SELINUX='
line: 'SELINUX=disabled'
backrefs: true
when: "ansible_distribution == 'CentOS'"
when: "ansible_os_family == "RedHat""
- name: remove hwaddr in ifcfg
become: true
shell: 'sed -i "/HWADDR/d" /etc/sysconfig/network-scripts/ifcfg-*'
when: "ansible_distribution == 'CentOS'"
when: "ansible_os_family == "RedHat""
- name: set hostname to localhost
become: true
lineinfile:
path: /etc/sysconfig/network
line: 'HOSTNAME=localhost.localdomain'
insertafter: 'EOF'
when: "ansible_distribution == 'CentOS'"
when: "ansible_os_family == "RedHat""
- name: ssh-keygen service
become: true
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