Commit 7ddb2aee authored by nanahira's avatar nanahira

update

parent c9ae031c
This diff is collapsed.
- name: apt - name: apt
become: true
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,mosh 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,iperf3,nmap,mosh,subversion,nfs-common,fish,haveged
- name: Ubuntu packages - name: Ubuntu packages
become: true
apt: apt:
update_cache: true
state: latest state: latest
name: ctags name: ctags
when: "ansible_distribution == 'Ubuntu'" when: "ansible_distribution == 'Ubuntu'"
- name: Debian packages - name: Debian packages
become: true
apt: apt:
update_cache: true
state: latest state: latest
name: universal-ctags name: universal-ctags
when: "ansible_distribution == 'Debian'" when: "ansible_distribution == 'Debian'"
- name: open vm tools
become: true
apt:
state: latest
name: open-vm-tools
when: ansible_virtualization_type == "VMware"
- name: apt autoremove - name: apt autoremove
become: true
apt: apt:
autoremove: true autoremove: true
- name: 终端环境 byobu status
become: true
lineinfile:
name: /usr/share/byobu/status/status
line: 'tmux_right="#network #disk_io #custom #entropy raid reboot_required updates_available #apport #services #mail #users uptime #ec2_cost #rcs_cost #fan_speed #cpu_temp #battery #wifi_quality #processes load_average cpu_count cpu_freq memory #swap disk #whoami hostname #ip_address #time_utc #date #time"'
regexp: ^tmux_right=
- name: 终端环境 byobu enable
shell: byobu-enable
args:
creates: ~/.hushlogin
when: "ansible_os_family != 'RedHat' or ansible_distribution_major_version|int != 8"
- name: 终端环境 byobu ctrl-a
command: byobu-ctrl-a emacs
args:
creates: ~/.byobu/keybindings.tmux
- name: dnf update - name: dnf update
become: true
dnf: dnf:
name: '*' name: '*'
#update_cache: true #update_cache: true
state: latest state: latest
- name: epel 8 - name: epel 8
become: true
dnf: dnf:
state: latest state: latest
name: epel-release name: epel-release
- name: dnf - name: dnf
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,xclip,traceroute,tar,unzip,nmap,python3-libselinux,mosh 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,xclip,traceroute,tar,unzip,nmap,python3-libselinux,mosh,subversion,haveged # nfs-common,fish
- name: open vm tools
become: true
dnf:
state: latest
name: open-vm-tools
when: ansible_virtualization_type == "VMware"
- name: dnf autoremove - name: dnf autoremove
become: true
dnf: dnf:
autoremove: true autoremove: true
- name: 终端环境 fish
become: true
user:
name: '{{ansible_user_id}}'
shell: /usr/bin/fish
- name: 终端环境 fish omf
shell: curl -L http://get.oh-my.fish | fish
environment:
NONINTERACTIVE: true
ASSUME_YES: true
args:
creates: ~/.local/share/omf
- name: 终端环境 fish robbyrussell
shell: omf install robbyrussell
args:
executable: /usr/bin/fish
creates: ~/.local/share/omf/themes/robbyrussell
- name: 终端环境 fish 自动填充
file:
name: ~/.config/fish/completions
state: directory
#- name: 终端环境 fish 自动填充 docker
# copy:
# src: /usr/share/fish/vendor_completions.d/docker.fish
# dest: ~/.config/fish/completions/docker.fish
# remote_src: yes
...@@ -13,6 +13,44 @@ ...@@ -13,6 +13,44 @@
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
become: true
hostname:
name: "{{ inventory_hostname_short }}"
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'"
- name: clean aliyun
become: true
shell: |
curl -L http://update.aegis.aliyun.com/download/uninstall.sh | bash
systemctl stop aliyun.service
systemctl disable aliyun.service
rm -rf /usr/local/aegis /etc/init.d/agentwatch /etc/systemd/system/aliyun.service /usr/sbin/aliyun-service /usr/sbin/aliyun-service.backup /usr/sbin/aliyun_installer
systemctl daemon-reload
args:
removes: /usr/local/aegis
- name: clean aliyun 2
become: true
shell: |
/usr/local/cloudmonitor/CmsGoAgent.linux-amd64 stop
/usr/local/cloudmonitor/CmsGoAgent.linux-amd64 uninstall
rm -rf /usr/local/cloudmonitor
args:
removes: /usr/local/cloudmonitor
- name: clean qemu
become: true
apt:
name: qemu-guest-agent
state: absent
autoremove: yes
purge: yes
when: "ansible_os_family == 'Debian'"
- name: timezone - name: timezone
become: true become: true
timezone: timezone:
...@@ -117,17 +155,14 @@ ...@@ -117,17 +155,14 @@
iptables: iptables:
chain: FORWARD chain: FORWARD
flush: true flush: true
when: 'hypervisor is defined' when: 'hypervisor'
- name: apt - name: apt
become: true
include_tasks: apt.yml include_tasks: apt.yml
when: "ansible_os_family == 'Debian'" when: "ansible_os_family == 'Debian'"
- name: yum - name: yum
become: true
include_tasks: yum.yml include_tasks: yum.yml
when: "ansible_os_family == 'RedHat' and ansible_distribution_major_version|int == 8" when: "ansible_os_family == 'RedHat' and ansible_distribution_major_version|int == 7"
- name: dnf - name: dnf
become: true
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: disable selinux - name: disable selinux
...@@ -142,6 +177,11 @@ ...@@ -142,6 +177,11 @@
line: 'SELINUX=disabled' line: 'SELINUX=disabled'
backrefs: true backrefs: true
when: "ansible_os_family == 'RedHat'" when: "ansible_os_family == 'RedHat'"
- name: fish
include_tasks: fish.yml
when: "ansible_os_family == 'Debian'"
- name: byobu
include_tasks: byobu.yml
- name: vim - name: vim
unarchive: unarchive:
src: https://minio.mycard.moe:9000/nanahira/nanahira-vim.tar.gz src: https://minio.mycard.moe:9000/nanahira/nanahira-vim.tar.gz
......
# vim
- name: vim-editorconfig
git:
repo: https://github.com/editorconfig/editorconfig-vim.git
dest: ~/.vim/pack/editorconfig/start/editorconfig
depth: 1
- name: vim-xterm-bracketed-paste-directory
file:
path: ~/.vim/pack/xterm-bracketed-paste/start/xterm-bracketed-paste/plugin
state: directory
- name: vim-xterm-bracketed-paste
copy:
content: |
" bracketed paste mode support for tmux
if &term =~ '^screen\|^tmux' && exists('&t_BE')
let &t_BE = "\033[?2004h"
let &t_BD = "\033[?2004l"
" t_PS and t_PE are key code options and they are special
exec "set t_PS=" . "\033[200~"
exec "set t_PE=" . "\033[201~"
endif
dest: ~/.vim/pack/xterm-bracketed-paste/start/xterm-bracketed-paste/plugin/xterm-bracketed-paste.vim
- name: vim-modeline-directory
file:
path: ~/.vim/pack/modeline/start/modeline/plugin
state: directory
- name: vim-modeline
copy:
content: set modeline
dest: ~/.vim/pack/modeline/start/modeline/plugin/modeline.vim
- name: vim-nginx
subversion:
repo: https://github.com/nginx/nginx/trunk/contrib/vim
dest: ~/.vim/pack/nginx/start/nginx
- name: yum update - name: yum update
become: true
yum: yum:
name: '*' name: '*'
update_cache: true update_cache: true
state: latest state: latest
- name: epel 7 - name: epel 7
become: true
yum: yum:
state: latest state: latest
name: epel-release name: epel-release
- name: yum - name: yum
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,mosh # 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,iperf3,nmap,libselinux-python,mosh,subversion,fish,haveged,mtr,rsync # astyle # nfs-common
- name: open vm tools
become: true
dnf:
state: latest
name: open-vm-tools
when: ansible_virtualization_type == "VMware"
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