1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| ---
| - name: demo blockinfile
| hosts: server
| become: true
| vars:
| installstate: present
| tasks:
| - name: "copy some lines into /etc/profile"
| blockinfile:
| path: /etc/profile
| block: |
| #This is a
| #phantastic
| #block using
| #ansible
| #blockinfile
| marker: "# {mark} OLAFS SUPER BLOCK"
| state: '{{ installstate }}'
| insertbefore: "^unset i$"
|
|