Difference between revisions of "Blockinfile:"

From wikieduonline
Jump to navigation Jump to search
Line 25: Line 25:
  
 
== See also ==
 
== See also ==
 +
* {{lineinfile}}
 
* {{Ansible modules}}
 
* {{Ansible modules}}
  
 
[[Category:Ansible]]
 
[[Category:Ansible]]

Revision as of 18:30, 7 September 2023


- blockinfile:
     path: /path/to/your_file
     state: present
     insertafter: EOF
     content: | 
          your first line
          your second line 
          your third line


- blockinfile: |
    dest=/etc/network/interfaces backup=yes
    content="iface eth0 inet static
        address 192.168.0.1
        netmask 255.255.255.0"


Related

See also

Advertising: