zl程序教程

您现在的位置是:首页 >  系统

当前栏目

ansible service模块使用示例

模块 示例 Service Ansible 使用
2023-09-14 09:01:52 时间
示例一、启动httpd服务
# ansible 192.168.85.251 -m service -a "name=httpd state=started" -i hosts
示例二、重载httpd服务
# ansible 192.168.85.251 -m service -a "name=httpd state=reloaded" -i hosts
示例三、重启Httpd服务
ansible 192.168.85.251 -m service -a "name=httpd state=restarted" -i hosts
示例四、停止httpd服务
ansible 192.168.85.251 -m service -a "name=httpd state=stopped" -i hosts
示例五、 启动httpd服务,并加入开机自启
ansible 192.168.85.251 -m service -a "name=httpd state=started enabled=yes" -i hosts