xoxys.network/tasks/config.yml
Robert Kaussow d78e3aa0f0
All checks were successful
the build was successful
fix indentation
2019-01-09 21:51:48 +01:00

45 lines
1.1 KiB
YAML

---
- block:
- name: Set hostname
template:
src: etc/hostname.j2
dest: /etc/hostname
owner: root
group: root
mode: 0644
register: hostname_result
notify: __host_reboot
- name: Set hosts file
template:
src: etc/hosts.j2
dest: /etc/hosts
owner: root
group: root
mode: 0644
register: hosts_result
notify: __host_reboot
- name: Add network interface configuration
template:
src: etc/sysconfig/network-scrips/ifcfg.j2
dest: "/etc/sysconfig/network-scripts/ifcfg-{{ item.key }}"
owner: root
group: root
mode: 0644
with_dict: "{{ network_interfaces }}"
loop_control:
label: "{{ item.key }}"
when: item.key in ansible_interfaces or item.key.split(":")[0] in ansible_interfaces
notify: __network_restart
- name: Set dns server
template:
src: etc/resolv.conf.j2
dest: /etc/resolv.conf
owner: root
group: root
mode: 0644
become: True
become_user: root