xoxys.network/tasks/config.yml
2017-05-18 23:10:07 +02:00

36 lines
695 B
YAML

---
- 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: 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.config }}'
when: item.key in ansible_interfaces
notify:
- network_restart