Hi,
I'm creating a script in Ansible to build a file from scratch and I'm not
sure why I'm running into the following 'path' module error message on my
blockinfile invocation:
fatal: [192.168.1.1]: FAILED! => {"changed": false, "failed": true,
> "invocation": {"module_args": {"block":
> "testline1\ntestline2\ntestline3\n", "marker": null, "path":
> "/var/www/html/testfile.cfg"}, "module_name": "blockinfile"}, "msg":
> "unsupported parameter for module: path"}
Script:
---
- hosts: all
# gather_facts: False
remote_user: local__admin
become: yes
become_user: root
become_method: sudo
vars_prompt:
- name: "set_filename"
prompt: "What is the name of the file to create in /var/www/html?"
tasks:
- name: Create new file
file:
state: touch
path: "/var/www/html/{{ set_filename }}.cfg"
owner: www-data
group: www-data
mode: 0644
- name: Add default parameters
blockinfile:
path: "/var/www/html/{{ set_filename }}.cfg"
marker: # {mark} ANSIBLE DEFAULT BLOCK
block: |
testline1
testline2
testline3
Any suggestions?
--
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/383fbcd4-7611-48c6-a2fa-d8d8177e8010%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.