Commit 7f9d30b1 authored by nanahira's avatar nanahira

update

parent 115c2d67
#!/bin/bash
sudo iptables "$@"
echo "# use iptables-restore --noflush" > ~/iptables-gateways
echo "*nat" >> ~/iptables-gateways
echo ":PREROUTING -" >> ~/iptables-gateways
sudo iptables -t nat -S PREROUTING | grep -- "-j DNAT" >> ~/iptables-gateways
echo "COMMIT" >> ~/iptables-gateways
sudo iptables-save > ~/ipt
...@@ -6,6 +6,19 @@ ...@@ -6,6 +6,19 @@
authorized_key: authorized_key:
user: "{{ ansible_user_id }}" user: "{{ ansible_user_id }}"
key: "{{ webvirt_ssh_key }}" key: "{{ webvirt_ssh_key }}"
- name: get cpufreq policy path
find:
paths:
- /sys/devices/system/cpu/cpufreq/
file_type: directory
register: freq_list
- name: cpufreq performance
become: true
copy:
content: performance
dest: '{{item.path}}/scaling_governor'
unsafe_writes: true
with_items: '{{freq_list.files}}'
- name: apt - name: apt
become: true become: true
when: "ansible_distribution != 'CentOS'" when: "ansible_distribution != 'CentOS'"
...@@ -56,6 +69,7 @@ ...@@ -56,6 +69,7 @@
systemd: systemd:
name: firewalld name: firewalld
state: stopped state: stopped
enabled: false
when: "ansible_distribution == 'CentOS'" when: "ansible_distribution == 'CentOS'"
- name: flush forward table - name: flush forward table
become: true become: true
......
...@@ -126,7 +126,7 @@ ...@@ -126,7 +126,7 @@
apt: apt:
update_cache: true update_cache: true
state: latest state: latest
name: curl,wget,git,vim,sudo,byobu,iftop,iotop,build-essential,p7zip-full,xclip,astyle,python-setuptools,python-dev,tcpdump,rsync,htop,locales,mtr,dnsutils,net-tools,traceroute,tar,unzip,iperf,nmap,dnsutils name: curl,wget,git,vim,sudo,byobu,iftop,iotop,build-essential,p7zip-full,xclip,astyle,python-setuptools,python-dev,tcpdump,rsync,htop,locales,mtr,dnsutils,net-tools,traceroute,tar,unzip,iperf,nmap,mosh
when: "ansible_distribution != 'CentOS'" when: "ansible_distribution != 'CentOS'"
- name: Ubuntu packages - name: Ubuntu packages
become: true become: true
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
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 # 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_distribution == 'CentOS' and ansible_distribution_major_version|int == 7"
- name: epel 8 - name: epel 8
become: true become: true
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
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 # 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_distribution == 'CentOS' and ansible_distribution_major_version|int == 8"
- name: dnf autoremove - name: dnf autoremove
become: true become: true
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
- name: build - name: build
make: make:
chdir: '{{home_path}}/ygopro/build' chdir: '{{home_path}}/ygopro/build'
target: "config=release -j{{ lookup('pipe', 'nproc') }}" target: "config=release -j{{ ansible_processor_vcpus }}"
- name: strip ygopro - name: strip ygopro
shell: strip bin/release/ygopro shell: strip bin/release/ygopro
ignore_errors: true ignore_errors: true
...@@ -182,6 +182,7 @@ ...@@ -182,6 +182,7 @@
systemd: systemd:
name: firewalld name: firewalld
state: stopped state: stopped
enabled: false
when: "ansible_distribution == 'CentOS'" when: "ansible_distribution == 'CentOS'"
- name: redis - name: redis
become: true become: true
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
- name: build - name: build
make: make:
chdir: '{{home_path}}/ygopro-new/build' chdir: '{{home_path}}/ygopro-new/build'
target: 'config=release -j{{ lookup("pipe", "nproc") }}' target: 'config=release -j{{ ansible_processor_vcpus }}'
- name: strip ygopro - name: strip ygopro
shell: strip bin/release/ygopro shell: strip bin/release/ygopro
args: args:
......
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