-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinitServiceRsync.yml
More file actions
35 lines (28 loc) · 917 Bytes
/
Copy pathinitServiceRsync.yml
File metadata and controls
35 lines (28 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Run this playbook to set up your Rsync machine
# ansible-playbook initServiceRsync.yml
- hosts:
- rsync
become: yes
become_user: root
pre_tasks:
- name: Install common software and configuration
include_role:
name: install_common_software
- name: Gather facts for service hosts
setup:
gather_subset:
- default_ipv4
delegate_to: "{{ item }}"
delegate_facts: true
loop: "{{ groups['service'] }}"
- name: Setup /etc/hosts entries for private IPs for service hosts
lineinfile:
path: /etc/hosts
regexp: '.*{{ item }}-ams\..*$'
line: "{{ hostvars[item].ansible_facts[hostvars[item].private_interface | default('eth1')].ipv4.address }}\t{{ item }}-ams.{{ domain }}"
state: present
loop: "{{ groups['service'] }}"
vars:
domain: internal.php.net
roles:
- role: properties/rsync