Commit 33ac6463 authored by nanahira's avatar nanahira

format

parent 3ce57190
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
become: true become: true
apt: apt:
name: exuberant-ctags name: exuberant-ctags
when: "ansible_distribution == 'Ubuntu' and ansible_distribution_release != 'focal'" when: ansible_distribution == 'Ubuntu' and ansible_distribution_release != 'focal'
- name: remove old ctags - name: remove old ctags
become: true become: true
apt: apt:
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
state: absent state: absent
purge: true purge: true
autoremove: true autoremove: true
when: "ansible_distribution == 'Debian' or ansible_distribution_release == 'focal'" when: ansible_distribution == 'Debian' or ansible_distribution_release == 'focal'
- name: ctags in new Ubuntu and Debian - name: ctags in new Ubuntu and Debian
become: true become: true
apt: apt:
name: universal-ctags name: universal-ctags
when: "ansible_distribution == 'Debian' or ansible_distribution_release == 'focal'" when: ansible_distribution == 'Debian' or ansible_distribution_release == 'focal'
- name: focal packages - name: focal packages
become: true become: true
apt: apt:
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
shell: byobu-enable shell: byobu-enable
args: args:
creates: '~/.hushlogin' creates: '~/.hushlogin'
when: "ansible_os_family != 'RedHat' or ansible_distribution_major_version|int != 7" when: ansible_os_family != 'RedHat' or ansible_distribution_major_version|int != 7
- name: 终端环境 byobu ctrl-a - name: 终端环境 byobu ctrl-a
command: byobu-ctrl-a emacs command: byobu-ctrl-a emacs
args: args:
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
- name: China mirror for Docker - name: China mirror for Docker
set_fact: set_fact:
mirror_docker: https://mirrors.tuna.tsinghua.edu.cn/docker-ce mirror_docker: https://mirrors.tuna.tsinghua.edu.cn/docker-ce
when: "china_mirror_docker" when: china_mirror_docker
- name: clean apt Docker - name: clean apt Docker
become: true become: true
apt: apt:
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
name: '{{ansible_user_id}}' name: '{{ansible_user_id}}'
append: true append: true
groups: docker groups: docker
when: "ansible_user_id != 'root'" when: ansible_user_id != 'root'
- name: docker-compose 清理 pip - name: docker-compose 清理 pip
file: file:
path: ~/.pip path: ~/.pip
...@@ -137,14 +137,14 @@ ...@@ -137,14 +137,14 @@
name: pip name: pip
executable: '{{pip_executable}}' executable: '{{pip_executable}}'
state: latest state: latest
when: "not china_mirror_docker" when: not china_mirror_docker
- name: docker-compose - name: docker-compose
become: true become: true
pip: pip:
name: docker-compose name: docker-compose
executable: '{{pip_executable}}' executable: '{{pip_executable}}'
state: latest state: latest
when: "not china_mirror_docker" when: not china_mirror_docker
- name: docker-compose 国内 - name: docker-compose 国内
become: true become: true
pip: pip:
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
executable: '{{pip_executable}}' executable: '{{pip_executable}}'
state: latest state: latest
extra_args: -i https://mirrors.aliyun.com/pypi/simple/ extra_args: -i https://mirrors.aliyun.com/pypi/simple/
when: "china_mirror_docker" when: china_mirror_docker
- name: docker-compose 国内 - name: docker-compose 国内
become: true become: true
pip: pip:
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
executable: '{{pip_executable}}' executable: '{{pip_executable}}'
state: latest state: latest
extra_args: -i https://mirrors.aliyun.com/pypi/simple/ extra_args: -i https://mirrors.aliyun.com/pypi/simple/
when: "china_mirror_docker" when: china_mirror_docker
- name: docker 配置 创建目录 - name: docker 配置 创建目录
become: true become: true
file: file:
......
...@@ -13,29 +13,29 @@ ...@@ -13,29 +13,29 @@
when: 'ansible_memtotal_mb < 1024 and not swap_result.stdout' when: 'ansible_memtotal_mb < 1024 and not swap_result.stdout'
- name: upgrade - name: upgrade
include_tasks: 'upgrade.yml' include_tasks: 'upgrade.yml'
when: "upgrade" when: upgrade
- name: sshd_config again - name: sshd_config again
include_tasks: 'sshd_config.yml' include_tasks: 'sshd_config.yml'
- name: hypervisor - name: hypervisor
include_tasks: 'hypervisor.yml' include_tasks: 'hypervisor.yml'
when: "ansible_virtualization_role == 'host'" when: ansible_virtualization_role == 'host'
- name: sysctl - name: sysctl
include_tasks: 'sysctl.yml' include_tasks: 'sysctl.yml'
- name: apt - name: apt
include_tasks: apt.yml include_tasks: apt.yml
when: "ansible_os_family == 'Debian'" when: ansible_os_family == 'Debian'
- name: yum - name: yum
include_tasks: yum.yml include_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: dnf.yml include_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: redhat_configures.yml include_tasks: redhat_configures.yml
when: "ansible_os_family == 'RedHat'" when: ansible_os_family == 'RedHat'
- name: docker - name: docker
include_tasks: docker.yml include_tasks: docker.yml
when: "install_docker" when: install_docker
- name: fish - name: fish
include_tasks: fish.yml include_tasks: fish.yml
when: ansible_os_family == 'Debian' or ansible_distribution == 'Fedora' # RedHat has too many problems on fish, so aborted when: ansible_os_family == 'Debian' or ansible_distribution == 'Fedora' # RedHat has too many problems on fish, so aborted
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
regexp: '^#?PermitRootLogin (no|false|prohibit-password).*$' regexp: '^#?PermitRootLogin (no|false|prohibit-password).*$'
line: 'PermitRootLogin yes' line: 'PermitRootLogin yes'
backrefs: true backrefs: true
when: "ansible_user_id == 'root' and allow_password" when: ansible_user_id == 'root' and allow_password
- name: sshd config GSSAPIAuthentication - name: sshd config GSSAPIAuthentication
become: true become: true
lineinfile: lineinfile:
......
...@@ -34,14 +34,14 @@ ...@@ -34,14 +34,14 @@
name: net.core.default_qdisc name: net.core.default_qdisc
value: fq value: fq
sysctl_set: true sysctl_set: true
when: "ansible_os_family == 'Debian' or ansible_distribution_major_version|int > 7" when: ansible_os_family == 'Debian' or ansible_distribution_major_version|int > 7
- name: TCP BBR - name: TCP BBR
become: true become: true
sysctl: sysctl:
name: net.ipv4.tcp_congestion_control name: net.ipv4.tcp_congestion_control
value: bbr value: bbr
sysctl_set: true sysctl_set: true
when: "ansible_os_family == 'Debian' or ansible_distribution_major_version|int > 7" when: ansible_os_family == 'Debian' or ansible_distribution_major_version|int > 7
- name: limit - name: limit
become: true become: true
pam_limits: pam_limits:
......
...@@ -3,26 +3,26 @@ ...@@ -3,26 +3,26 @@
apt: apt:
update_cache: true update_cache: true
upgrade: dist upgrade: dist
when: "ansible_os_family == 'Debian'" when: ansible_os_family == 'Debian'
- name: yum update - name: yum update
become: true become: true
yum: yum:
name: '*' name: '*'
update_cache: true update_cache: true
state: latest state: latest
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 update - name: dnf update
become: true become: true
dnf: dnf:
name: '*' name: '*'
state: latest state: latest
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: fixup iptables with qemu - name: fixup iptables with qemu
become: true become: true
iptables: iptables:
chain: FORWARD chain: FORWARD
flush: true flush: true
when: "ansible_virtualization_role == 'host'" when: ansible_virtualization_role == 'host'
- name: install a python alternate to prevent ansible problems - name: install a python alternate to prevent ansible problems
become: true become: true
apt: apt:
......
...@@ -10,19 +10,19 @@ ...@@ -10,19 +10,19 @@
insertafter: 'EOF' insertafter: 'EOF'
line: '{{ ansible_user_id }} ALL=(ALL:ALL) NOPASSWD: ALL' line: '{{ ansible_user_id }} ALL=(ALL:ALL) NOPASSWD: ALL'
validate: /usr/sbin/visudo -cf %s validate: /usr/sbin/visudo -cf %s
when: "ansible_user_id != 'root'" when: ansible_user_id != 'root'
- name: hostname - name: hostname
become: true become: true
hostname: hostname:
name: "{{ inventory_hostname_short }}" name: "{{ inventory_hostname_short }}"
when: "inventory_hostname_short != '10' and inventory_hostname_short != '172' and inventory_hostname_short != '192'" when: inventory_hostname_short != '10' and inventory_hostname_short != '172' and inventory_hostname_short != '192'
- name: hostname hosts - name: hostname hosts
become: true become: true
lineinfile: lineinfile:
dest: /etc/hosts dest: /etc/hosts
regexp: "^{{ ansible_default_ipv4.address }}" regexp: "^{{ ansible_default_ipv4.address }}"
line: "{{ ansible_default_ipv4.address }} {{ inventory_hostname }} {{ inventory_hostname_short }}" line: "{{ ansible_default_ipv4.address }} {{ inventory_hostname }} {{ inventory_hostname_short }}"
when: "inventory_hostname_short != '10' and inventory_hostname_short != '172' and inventory_hostname_short != '192'" when: inventory_hostname_short != '10' and inventory_hostname_short != '172' and inventory_hostname_short != '192'
- name: clean aliyun - name: clean aliyun
become: true become: true
shell: | shell: |
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
mirror_debian_security: http://mirrors.tuna.tsinghua.edu.cn mirror_debian_security: http://mirrors.tuna.tsinghua.edu.cn
mirror_ubuntu: http://mirrors.tuna.tsinghua.edu.cn mirror_ubuntu: http://mirrors.tuna.tsinghua.edu.cn
mirror_ubuntu_security: http://mirrors.tuna.tsinghua.edu.cn mirror_ubuntu_security: http://mirrors.tuna.tsinghua.edu.cn
when: "china_mirror" when: china_mirror
- name: set facts for not upgrade - name: set facts for not upgrade
set_fact: set_fact:
target_distribution: '{{ ansible_distribution_release }}' target_distribution: '{{ ansible_distribution_release }}'
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
state: absent state: absent
autoremove: yes autoremove: yes
purge: yes purge: yes
when: "ansible_os_family == 'Debian'" when: ansible_os_family == 'Debian'
- name: remove not proper installed wireguard - name: remove not proper installed wireguard
become: true become: true
apt: apt:
......
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