Skip to content

Instantly share code, notes, and snippets.

@humiaozuzu
humiaozuzu / convention.md
Last active May 29, 2019 05:13
Ansible best practice

Ansible best practice

通用规则

  • YAML 使用 2 空格+.yml后缀
  • Jinja 变量前后需要使用空格 {{ var }}
  • YAML 中引用变量时需要用双引号
  • 环境变量全大写,其他变量全小写
  • 所有变量前需要加上 role name 作为前缀,比如 nginx_xxx
  • role 命名使用短横线
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import requests
import Foundation
import objc
import logging
from time import sleep
[General]
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
dns-server = 119.29.29.29, 223.5.5.5, 114.114.114.114
loglevel = info
[Proxy]
Proxy = http, 192.168.1.76, 8888
[Rule]
#!/usr/bin/env sh
if [ -f $HOME/.vimrc ]; then
echo "Backup .vimrc"
mv $HOME/.vimrc $HOME/.vimrc.backup
fi
curl -s https://raw.github.com/gist/4162331/.vimrc -L > $HOME/.vimrc
if [ -f $HOME/.bashrc ]; then
echo "Backup .vimrc"
@humiaozuzu
humiaozuzu / .vimrc
Last active October 13, 2015 07:47
vimrc for servers
syntax enable
filetype plugin indent on
set bg=dark
" Stop backup files
set nobackup
set nowritebackup
set noswapfile
" better search