Commit bf4db12b authored by nanahira's avatar nanahira

format

parent 34315d2a
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
with_items: '{{freq_list.files}}' with_items: '{{freq_list.files}}'
- name: apt - name: apt
become: true become: true
when: "ansible_os_family == 'Debian'" when: ansible_os_family == 'Debian'
apt: apt:
state: latest state: latest
update_cache: true update_cache: true
...@@ -41,10 +41,10 @@ ...@@ -41,10 +41,10 @@
yum: yum:
state: latest state: latest
name: epel-release name: epel-release
when: "ansible_os_family == 'RedHat' 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_os_family == 'RedHat' 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
...@@ -54,10 +54,10 @@ ...@@ -54,10 +54,10 @@
dnf: dnf:
state: latest state: latest
name: epel-release name: epel-release
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: dnf - name: dnf
become: true become: true
when: "ansible_os_family == 'RedHat' 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
...@@ -73,14 +73,14 @@ ...@@ -73,14 +73,14 @@
name: ksmtuned name: ksmtuned
state: started state: started
enabled: true enabled: true
when: "ansible_os_family == 'Debian'" when: ansible_os_family == 'Debian'
- name: stop firewalld - name: stop firewalld
become: true become: true
systemd: systemd:
name: firewalld name: firewalld
state: stopped state: stopped
enabled: false enabled: false
when: "ansible_os_family == 'RedHat'" when: ansible_os_family == 'RedHat'
- name: flush forward table - name: flush forward table
become: true become: true
iptables: iptables:
......
...@@ -18,33 +18,33 @@ ...@@ -18,33 +18,33 @@
update_cache: true update_cache: true
state: latest state: latest
name: wget,git,build-essential,libreadline-dev,libsqlite3-dev,libevent-dev,redis-server,p7zip-full,liblua5.3-dev name: wget,git,build-essential,libreadline-dev,libsqlite3-dev,libevent-dev,redis-server,p7zip-full,liblua5.3-dev
when: "ansible_os_family == 'Debian'" when: ansible_os_family == 'Debian'
- name: epel 7 - name: epel 7
become: true become: true
yum: yum:
state: latest state: latest
update_cache: true update_cache: true
name: epel-release,curl name: epel-release,curl
when: "ansible_os_family == 'RedHat' 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_os_family == 'RedHat' 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_os_family == 'RedHat' 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_os_family == 'RedHat' and ansible_distribution_major_version|int >= 8" when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int >= 8
- name: ygopro - name: ygopro
git: git:
repo: 'https://github.com/{{fork}}/ygopro' repo: 'https://github.com/{{fork}}/ygopro'
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
owner: '{{ansible_user_id}}' owner: '{{ansible_user_id}}'
group: '{{ansible_user_id}}' group: '{{ansible_user_id}}'
recurse: true recurse: true
when: "ansible_user_id != 'root'" when: ansible_user_id != 'root'
- name: srvpro npm - name: srvpro npm
npm: npm:
path: '{{home_path}}/ygopro-server' path: '{{home_path}}/ygopro-server'
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
name: firewalld name: firewalld
state: stopped state: stopped
enabled: false enabled: false
when: "ansible_os_family == 'RedHat'" when: ansible_os_family == 'RedHat'
- name: redis - name: redis
become: true become: true
systemd: systemd:
......
...@@ -13,13 +13,13 @@ ...@@ -13,13 +13,13 @@
update_cache: true update_cache: true
state: latest state: latest
name: curl,wget,build-essential,tar,unzip,python,rsync name: curl,wget,build-essential,tar,unzip,python,rsync
when: "ansible_os_family == 'Debian'" when: ansible_os_family == 'Debian'
- name: yum - name: yum
yum: yum:
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_os_family == 'RedHat'" when: ansible_os_family == 'RedHat'
- name: directories - name: directories
file: file:
path: '/srv/{{item}}' path: '/srv/{{item}}'
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
update_cache: true update_cache: true
state: latest state: latest
name: mono-complete name: mono-complete
when: "ansible_os_family == 'Debian'" when: ansible_os_family == 'Debian'
- name: mono yum key - name: mono yum key
become: true become: true
rpm_key: rpm_key:
...@@ -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_os_family == 'RedHat'" 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_os_family == 'RedHat' 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_os_family == 'RedHat' and ansible_distribution_major_version|int >= 8" when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int >= 8
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
update_cache: true update_cache: true
state: latest state: latest
name: curl,apt-transport-https,lsb-release,gnupg name: curl,apt-transport-https,lsb-release,gnupg
when: "ansible_os_family == 'Debian'" when: ansible_os_family == 'Debian'
- name: node apt key - name: node apt key
become: true become: true
apt_key: apt_key:
url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key
when: "(ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int < 18) or (ansible_distribution == 'Debian' and ansible_distribution_major_version|int < 9)" when: (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int < 18) or (ansible_distribution == 'Debian' and ansible_distribution_major_version|int < 9)
- name: nodesource - name: nodesource
become: true become: true
with_items: with_items:
...@@ -19,45 +19,45 @@ ...@@ -19,45 +19,45 @@
apt_repository: apt_repository:
filename: nodesource filename: nodesource
repo: '{{item}} https://deb.nodesource.com/node_{{nodejs_version}}.x {{ansible_distribution_release}} main' repo: '{{item}} https://deb.nodesource.com/node_{{nodejs_version}}.x {{ansible_distribution_release}} main'
when: "(ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int < 18) or (ansible_distribution == 'Debian' and ansible_distribution_major_version|int < 9)" when: (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int < 18) or (ansible_distribution == 'Debian' and ansible_distribution_major_version|int < 9)
- name: nodejs from nodesource - name: nodejs from nodesource
become: true become: true
apt: apt:
state: latest state: latest
name: nodejs name: nodejs
when: "(ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int < 18) or (ansible_distribution == 'Debian' and ansible_distribution_major_version|int < 9)" when: (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int < 18) or (ansible_distribution == 'Debian' and ansible_distribution_major_version|int < 9)
- name: nodejs from apt - name: nodejs from apt
become: true become: true
apt: apt:
state: latest state: latest
name: npm name: npm
when: "(ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int >= 18) or (ansible_distribution == 'Debian' and ansible_distribution_major_version|int >= 9)" when: (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int >= 18) or (ansible_distribution == 'Debian' and ansible_distribution_major_version|int >= 9)
- name: epel 7 - name: epel 7
become: true become: true
yum: yum:
state: latest state: latest
update_cache: true update_cache: true
name: epel-release name: epel-release
when: "ansible_os_family == 'RedHat' 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_os_family == 'RedHat' 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_os_family == 'RedHat' 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_os_family == 'RedHat' 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:
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
become: true become: true
with_items: ['/usr/bin/node', '/usr/local/bin/node'] with_items: ['/usr/bin/node', '/usr/local/bin/node']
shell: 'setcap cap_net_bind_service=+eip {{item}}' shell: 'setcap cap_net_bind_service=+eip {{item}}'
when: "ansible_user_id != 'root'" when: ansible_user_id != 'root'
- name: npm - name: npm
become: true become: true
with_items: with_items:
......
...@@ -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_os_family == 'RedHat'" 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_os_family == 'RedHat' 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_os_family == 'RedHat' 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_os_family == 'RedHat' 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_os_family == 'RedHat' and ansible_distribution_major_version|int >= 8" when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int >= 8
...@@ -22,27 +22,27 @@ ...@@ -22,27 +22,27 @@
- sysctl - sysctl
- name: apt - name: apt
include_tasks: ./roles/init/tasks/apt.yml include_tasks: ./roles/init/tasks/apt.yml
when: "ansible_os_family == 'Debian'" when: ansible_os_family == 'Debian'
- name: yum - name: yum
include_tasks: ./roles/init/tasks/yum.yml include_tasks: ./roles/init/tasks/yum.yml
when: "ansible_os_family == 'RedHat' and ansible_distribution_major_version|int == 7" when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int == 7
- name: dnf - name: dnf
include_tasks: ./roles/init/tasks/dnf.yml include_tasks: ./roles/init/tasks/dnf.yml
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: redhat configures - name: redhat configures
include_tasks: ./roles/init/tasks/redhat_configures.yml include_tasks: ./roles/init/tasks/redhat_configures.yml
when: "ansible_os_family == 'RedHat'" 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_os_family == 'RedHat'" 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_os_family == 'RedHat'" 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