additional course material RH294
Olaf Bohlen
2020-08-20 1de6236f80a879ca110981fe0e5c0c05c521225b
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$"