Add update action for hosts_file resource
This commit is contained in:
parent
4be37bd16a
commit
3ba878727f
11
resources/hosts_file/actions/update.yaml
Normal file
11
resources/hosts_file/actions/update.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
- hosts: [{{host}}]
|
||||
sudo: yes
|
||||
tasks:
|
||||
{% for val in hosts %}
|
||||
- name: Create hosts entries for {{val['name']}} => {{val['ip']}}
|
||||
lineinfile:
|
||||
dest: /etc/hosts
|
||||
regexp: ".*{{val['name']}}$"
|
||||
line: "{{val['ip']}} {{val['name']}}"
|
||||
state: present
|
||||
{% endfor %}
|
Loading…
Reference in New Issue
Block a user