Commit 33ac6463 authored by nanahira's avatar nanahira

format

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