role hosts
This commit is contained in:
parent
01b7e2ba94
commit
43f2f82066
|
@ -5,6 +5,8 @@ hostname: 'test-playbook'
|
||||||
hosts:
|
hosts:
|
||||||
- ip: 127.0.0.1
|
- ip: 127.0.0.1
|
||||||
name: localhost
|
name: localhost
|
||||||
|
- ip: 127.0.1.1
|
||||||
|
name: test-playbook.lab.dc.verdnatura.es test-playbook
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
### FAIL2BAN ####################################################################
|
### FAIL2BAN ####################################################################
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
- name: Replace old /etc/hosts with new /etc/hosts
|
||||||
|
template:
|
||||||
|
src: hosts.j2
|
||||||
|
dest: "{{ path_hosts }}"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0644'
|
||||||
|
backup: true
|
||||||
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
@ -0,0 +1,5 @@
|
||||||
|
{% if hosts is defined %}
|
||||||
|
{% for host in hosts %}
|
||||||
|
{{host.ip}} {{host.name}}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
# vars file
|
||||||
|
path_hosts: /etc/hosts
|
Loading…
Reference in New Issue