26 lines
453 B
YAML
26 lines
453 B
YAML
---
|
|
- name: Copy /etc/hosts
|
|
template:
|
|
src: ../templates/etc_hosts
|
|
dest: /etc/hosts
|
|
owner: root
|
|
group: root
|
|
mode: '0664'
|
|
|
|
|
|
- name: Set host name in /etc/hosts
|
|
ansible.builtin.blockinfile:
|
|
state: present
|
|
insertafter: EOF
|
|
path: /etc/hosts
|
|
mode: '0664'
|
|
owner: root
|
|
group: root
|
|
create: true
|
|
block: |
|
|
{{ ip }} {{ host }}
|
|
|
|
|
|
- name: Set a hostname
|
|
ansible.builtin.hostname:
|
|
name: "{{ host }}" |