Is this expected behaviour? I am trying to change a line in a file if it is 
already present, or create the file if it isn't:

- name: set ypserver to localhost
  lineinfile:
    dest: /etc/yp.conf
    create: yes
    state: present
    backup: yes
    backrefs: yes
    regexp: "^ypserver .*"
    line: "ypserver 127.0.0.1"
  notify: restart ypservices

 
But I keep getting this error:
TASK [nismaster : set ypserver to localhost] 
***********************************
fatal: [octans]: FAILED! => {"changed": false, "failed": true, "msg": "path 
/etc/yp.conf does not exist", "path": "/etc/yp.conf", "state": "absent"}



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/58d812f1-7420-4f82-bb89-de15ba5a554a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to