改了nginx.conf
include /etc/nginx/conf.d/*.conf;
server {
listen {{ nginxport }};
listen [::]:{{ nginxport }};
server_name _;
root /usr/share/nginx/html;
ansible-playbook role.yml -t startnginx
PLAY [web] *********************************************************************
TASK [Gathering Facts] *********************************************************
ok: [host1]
ok: [host2]
TASK [nginx : start service] ***************************************************
fatal: [host1]: 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.\n"}
fatal: [host2]: 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.\n"}
PLAY RECAP *********************************************************************
host1 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
host2 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0