1.lookups file
支持從外部數據拉取信息,例如從數據庫里拉取信息,而後定義給一個變量的形式python
TASK [Gathering Facts] ****
ok: [192.168.1.1]redis
TASK [debug lookups] **
**ok: [192.168.1.1] => {
"msg": "The contents is # Created by anaconda NETWORKING_IPV6=no PEERNTP=no "
}數據庫
PLAY RECAP *
192.168.1.1 : ok=2 changed=0 unreachable=0 failed=0 **ide
2.lookups password對傳入的內容進行加密處理加密
3.lookups pipe
pipe lookups控制機上調用subprocess.Popen執行命令,而後將命令的結果傳遞給變量debug
4.lookups redis_kv
redis_kv就是從redis數據庫中get數據,須要安裝redis python庫:yum install python-redis
3d
5.lookups template
讀取文件template.j2,裏面定義的變量是每臺主機的fatcs信息
worker_processes {{ ansible_processor_cores }};
IPaddress {{ ansible_eth0.ipv4.address }}
blog