forked from lastsky/ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook-hosts.yml
22 lines (21 loc) · 1 KB
/
playbook-hosts.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
- hosts: all
become: true
vars:
internal_domain: example.org
tasks:
- name: setting hostname from inventory
hostname: name="{{ inventory_hostname }}.{{ internal_domain }}"
# better idea to manage /etc/hosts from inventory.ini
- name: set changes to /etc/hosts to resolve dns dependency
blockinfile:
dest: /etc/hosts
block: |
10.64.32.1 database-master database-master.{{ internal_domain }}
10.64.64.1 database-backup database-backup.{{ internal_domain }}
10.64.128.10 monitor-server-1 monitor-server-1.{{ internal_domain }}
10.64.228.10 monitor-server-2 monitor-server-2.{{ internal_domain }}
10.64.128.20 rsyslog-server-1 rsyslog-server-1.{{ internal_domain }}
10.64.228.20 rsyslog-server-2 rsyslog-server-2.{{ internal_domain }}
10.64.128.20 ssh-proxy-host-1 ssh-proxy-host-1.{{ internal_domain }}
10.64.228.20 ssh-proxy-host-2 ssh-proxy-host-2.{{ internal_domain }}