安装nginx
指令如下:
|
|
playbook中运行nginx的实验
如下playbook,在运行的时候始终无法正常的执行restart nginx
,报错内容如下。
|
|
报错内容:
TASK: [restart nginx] *********************************************************
failed: [192.168.23.60] => {"failed": true}
msg: Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
FATAL: all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/home/junjie/web-notls.retry
192.168.23.60 : ok=6 changed=0 unreachable=0 failed=1
之所以发生这个问题是因为我在安装nginx后,启动了该nginx,且在杀死nginx时由于nginx会自动重启,一直没有真正的杀死nginx进程,最后导致ansible无法正常启动nginx服务,杀死nginx后,该问题解决了。