Hi
I am trying to add multiple lines to the host file on some Windows servers.
If I use the following playbook I can add one line:
---
- name: Add host file entries
hosts: all
tasks:
- name: Check if line is present in config
win_lineinfile:
dest: C:\Windows\System32\drivers\etc\hosts
I have tried the following, but keep getting errors:
---
- name: Add host file entries
hosts: all
tasks:
- name: Add host file entries
blockinfile:
dest: C:\Windows\System32\drivers\etc\hosts
block:
Does anyone know of way that this can be done?