ansible-role-blockinfile icon indicating copy to clipboard operation
ansible-role-blockinfile copied to clipboard

Please add install instructions to README.md

Open nmarley opened this issue 9 years ago • 3 comments

I want to use this module, but don't know how to install this at all.

I get an (expected) error when using homebrew'd ansible, b/c I didn't install this yet (and don't know how).

ERROR: blockinfile is not a legal parameter in an Ansible task or handler

nmarley avatar Oct 24 '15 17:10 nmarley

Install the module with ansible galaxy with this command :

ansible-galaxy install yaegashi.blockinfile

and then add something like this in your playbook :

roles:
  - yaegashi.blockinfile
  - apache
  - munin

and then something like this in your tasks:

- name: add server as client
  blockinfile: 
    dest: /etc/munin/munin.conf
    state: present
    marker: "#{mark} ANSIBLE MANAGED BLOCK"
    block: |
      [{{ ansible_hostname }}] 
        address {{ ['ansible_eth1']['ipv4']['address'] }}
        use_node_name yes 

pgdagenais avatar Oct 27 '15 17:10 pgdagenais

I did it, and my playbook doesnt work..

- hosts: local user: root

roles: - yaegashi.blockinfile tasks: - name: prueba blockinfile: dest: /etc/hosts block: | pruebaaaa

And the output is:

ERROR: is not a legal parameter in an Ansible task or handler

The role is installed, but i dont know whats happen :S

ectorr avatar Feb 22 '16 13:02 ectorr

ectorr see #15

iliv avatar Mar 29 '16 15:03 iliv