mirror of
https://pagure.io/fedora-infra/ansible.git
synced 2026-04-30 21:41:53 +08:00
Replaces many references to 'copy' with ansible.builtin.copy Signed-off-by: Ryan Lerch <rlerch@redhat.com>
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
---
|
|
#
|
|
# This task sets up /etc/hosts on a machine.
|
|
#
|
|
# This should only be used in rare cases
|
|
#
|
|
|
|
#
|
|
# This will move a /etc/hosts in place if it's setup in files for that host/domain
|
|
# Note that if it's not set it will just skip this play and do nothing.
|
|
#
|
|
- name: Setup /etc/hosts for some clients that are not on the vpn or are and in iad2
|
|
ansible.builtin.copy: src={{ item }} dest=/etc/hosts
|
|
with_first_found:
|
|
- "{{ inventory_hostname }}-hosts"
|
|
- "{{ ansible_hostname }}-hosts"
|
|
- "{{ host_group }}-hosts"
|
|
- "{{ ansible_domain }}-hosts"
|
|
- "{{ datacenter }}-hosts"
|
|
- "{{ hosts_base | default('base') }}"
|
|
when: not vpn or ( vpn and datacenter == 'iad2' )
|
|
tags:
|
|
- config
|
|
- hosts
|
|
|
|
- name: Setup /etc/hosts for some clients on the vpn, that are not in iad2
|
|
ansible.builtin.copy: src={{ item }} dest=/etc/hosts
|
|
with_first_found:
|
|
- "{{ inventory_hostname }}-hosts"
|
|
- "{{ ansible_hostname }}-hosts"
|
|
- "{{ host_group }}-hosts"
|
|
- "{{ ansible_domain }}-hosts"
|
|
- "{{ datacenter }}-hosts"
|
|
- "{{ hosts_base | default('vpn') }}"
|
|
when: vpn and datacenter != 'iad2'
|
|
tags:
|
|
- config
|
|
- hosts
|