can't start httpd service on RedHat Linux using ansible: Complaining about syntax errror

32 views
Skip to first unread message

Stephan Hradek

unread,
Sep 10, 2015, 5:18:55 AM9/10/15
to Ansible Project
When I start the httpd servicefrom commandline, it works without an issue.

When I use this in a playbook:

  - name: Start HTTPD
    become
: root
    service
:
      name
: httpd
      state
: started



I get this error message

fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Syntax error on line 292 of /etc/httpd/conf/httpd.conf:\nDocumentRoot '/var/www/html' is not a directory, or is not readable\n"}

I have to say that my /var/www is a symbolic link to /var/apacecontent/www.

But why would ansible complain when I can easily start from command line :(

Is there a way to avoid this?

Stephan Hradek

unread,
Sep 10, 2015, 6:13:23 AM9/10/15
to Ansible Project
I think I spotted the error:

become_user: root

it should have been :(
Reply all
Reply to author
Forward
0 new messages