16.5.1 创建及使用角色
ansible角色功能类似于编程中的封装技术——将具体的功能封装起来
使用角色之前先安装软件包
yum install rhel-system-roles
查看内置角色
ansible-galaxy list
以rhel-system-roles.timesync (配置网络时间协议)为例
可以拷贝下面的模版文件用来修改使用
/usr/share/doc/rhel-system-roles-1.21.2/timesync/example-single-pool-playbook.yml
--- - hosts: all vars: timesync_ntp_servers: - hostname: pool.ntp.org iburst: yes roles: - rhel-system-roles.timesync
                    
                
                
            
        
浙公网安备 33010602011771号