Commit bf4db12b authored by nanahira's avatar nanahira

format

parent 34315d2a
......@@ -21,7 +21,7 @@
with_items: '{{freq_list.files}}'
- name: apt
become: true
when: "ansible_os_family == 'Debian'"
when: ansible_os_family == 'Debian'
apt:
state: latest
update_cache: true
......@@ -41,10 +41,10 @@
yum:
state: latest
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
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:
state: latest
update_cache: true
......@@ -54,10 +54,10 @@
dnf:
state: latest
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
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:
state: latest
name: sudo,python3,qemu-kvm,qemu-img,libvirt,python3-libvirt,libguestfs-tools,virt-install,python3-lxml
......@@ -73,14 +73,14 @@
name: ksmtuned
state: started
enabled: true
when: "ansible_os_family == 'Debian'"
when: ansible_os_family == 'Debian'
- name: stop firewalld
become: true
systemd:
name: firewalld
state: stopped
enabled: false
when: "ansible_os_family == 'RedHat'"
when: ansible_os_family == 'RedHat'
- name: flush forward table
become: true
iptables:
......
......@@ -18,33 +18,33 @@
update_cache: true
state: latest
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
become: true
yum:
state: latest
update_cache: true
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
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_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
become: true
dnf:
state: latest
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
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_os_family == 'RedHat' and ansible_distribution_major_version|int >= 8"
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int >= 8
- name: ygopro
git:
repo: 'https://github.com/{{fork}}/ygopro'
......@@ -134,7 +134,7 @@
owner: '{{ansible_user_id}}'
group: '{{ansible_user_id}}'
recurse: true
when: "ansible_user_id != 'root'"
when: ansible_user_id != 'root'
- name: srvpro npm
npm:
path: '{{home_path}}/ygopro-server'
......@@ -167,7 +167,7 @@
name: firewalld
state: stopped
enabled: false
when: "ansible_os_family == 'RedHat'"
when: ansible_os_family == 'RedHat'
- name: redis
become: true
systemd:
......
......@@ -13,13 +13,13 @@
update_cache: true
state: latest
name: curl,wget,build-essential,tar,unzip,python,rsync
when: "ansible_os_family == 'Debian'"
when: ansible_os_family == 'Debian'
- name: yum
yum:
state: latest
update_cache: true
name: curl,wget,gcc,gcc-c++,make,tar,unzip,python,rsync
when: "ansible_os_family == 'RedHat'"
when: ansible_os_family == 'RedHat'
- name: directories
file:
path: '/srv/{{item}}'
......
......@@ -5,7 +5,7 @@
update_cache: true
state: latest
name: mono-complete
when: "ansible_os_family == 'Debian'"
when: ansible_os_family == 'Debian'
- name: mono yum key
become: true
rpm_key:
......@@ -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_os_family == 'RedHat'"
when: ansible_os_family == 'RedHat'
- name: mono from yum
become: true
yum:
state: latest
update_cache: true
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
become: true
dnf:
state: latest
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 @@
update_cache: true
state: latest
name: curl,apt-transport-https,lsb-release,gnupg
when: "ansible_os_family == 'Debian'"
when: ansible_os_family == 'Debian'
- name: node apt key
become: true
apt_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
become: true
with_items:
......@@ -19,45 +19,45 @@
apt_repository:
filename: nodesource
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
become: true
apt:
state: latest
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
become: true
apt:
state: latest
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
become: true
yum:
state: latest
update_cache: true
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
become: true
yum:
state: latest
update_cache: true
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
become: true
dnf:
state: latest
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
become: true
dnf:
state: latest
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
become: true
npm:
......@@ -72,7 +72,7 @@
become: true
with_items: ['/usr/bin/node', '/usr/local/bin/node']
shell: 'setcap cap_net_bind_service=+eip {{item}}'
when: "ansible_user_id != 'root'"
when: ansible_user_id != 'root'
- name: npm
become: true
with_items:
......
......@@ -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_os_family == 'RedHat'"
when: ansible_os_family == 'RedHat'
- name: epel 7
become: true
yum:
state: latest
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)
become: true
yum:
state: latest
update_cache: true
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
become: true
dnf:
state: latest
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)
become: true
dnf:
state: latest
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 @@
- sysctl
- name: apt
include_tasks: ./roles/init/tasks/apt.yml
when: "ansible_os_family == 'Debian'"
when: ansible_os_family == 'Debian'
- name: yum
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
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
include_tasks: ./roles/init/tasks/redhat_configures.yml
when: "ansible_os_family == 'RedHat'"
when: ansible_os_family == 'RedHat'
- name: remove hwaddr in ifcfg
become: true
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
become: true
lineinfile:
path: /etc/sysconfig/network
line: 'HOSTNAME=localhost.localdomain'
insertafter: 'EOF'
when: "ansible_os_family == 'RedHat'"
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