start nginx service 失败

来源:3-7 Ansible playbooks常用模块案例操作

Pey沛

2020-01-07

安装nginx成功,并且查看nginx.conf也成功根据模板创建,但是start nginx service的任务失败,main.yml中的相关部分和输出日志如下:

另外,我想问下老师,ansible的执行日志去哪个路径查呢?

main.yml:

  • name: start nginx service
    service: name=nginx state=started

log:
TASK [testbox : run the script] *******************************************************
changed: [test.example.com]

TASK [testbox : write the nginx config file] ******************************************
ok: [test.example.com]

TASK [testbox : ensure nginx is at the latest version] ********************************
ok: [test.example.com]

TASK [testbox : start nginx service] **************************************************
fatal: [test.example.com]: FAILED! => {“changed”: false, “msg”: “Unable to start service nginx: Job for nginx.service failed because the control process exited with error code. See “systemctl status nginx.service” and “journalctl -xe” for details.
”}
to retry, use: --limit @/home/deploy/test_playbooks/deploy.retry

PLAY RECAP ****************************************************************************
test.example.com : ok=9 changed=3 unreachable=0 failed=1

写回答

1回答

一路向北

2020-01-11

感谢这位同学的关注,通过报错提示可以看一下目标机器 systemctl 日志 journalctl-xe
ansible自己的日志可以通过配置它的配置文件来获取,详细可以群里提问。

0
0

Jenkins+Ansible+Gitlab-三剑合璧掌握自动化部署

整合三大工具解决自动化部署&持续交付问题

1290 学习 · 319 问题

查看课程