1、安装redis

yum  -y install redis

2、修改redis配置

vim /etc/redis.conf

找到redis.conf 并修改 daemonize no 为 daemonize yes

3、启动redis

redis-server /etc/redis.conf

4、安装插件

pip install redis

5、修改ansible.cfg文件

   gathering = smart
    
    fact_caching = redis
    
    fact_caching_timeout = 86400
    
    fact_caching_connection = localhost:6379

    #fact_caching_connection = localhost:6379:0:admin(设置了redis用户密码)

 

posted on 2020-06-29 12:00  听雨长风  阅读(567)  评论(0编辑  收藏  举报