Difference between revisions of "Blockinfile:"

From wikieduonline
Jump to navigation Jump to search
Line 5: Line 5:
 
  - blockinfile:
 
  - blockinfile:
 
       path: /path/to/your_file
 
       path: /path/to/your_file
       state: present
+
       [[state:]] present
 
       [[insertafter:]] [[EOF]]
 
       [[insertafter:]] [[EOF]]
 
       [[content:]] |  
 
       [[content:]] |  

Revision as of 18:31, 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: