xoxys.network/tasks/config.yml

35 lines
692 B
YAML
Raw Normal View History

2017-05-18 23:10:07 +02:00
---
- name: set hostname
2017-07-03 20:18:24 +02:00
template:
2017-05-18 23:10:07 +02:00
src: 'etc/hostname.j2'
dest: '/etc/hostname'
owner: root
group: root
mode: 0644
register: hostname_result
2017-07-03 20:18:24 +02:00
notify:
2017-05-18 23:10:07 +02:00
- host_reboot
- name: set hosts file
2017-07-03 20:18:24 +02:00
template:
2017-05-18 23:10:07 +02:00
src: 'etc/hosts.j2'
dest: '/etc/hosts'
owner: root
group: root
2017-07-03 20:18:24 +02:00
mode: 0644
2017-05-18 23:10:07 +02:00
register: hosts_result
2017-07-03 20:18:24 +02:00
notify:
2017-05-18 23:10:07 +02:00
- host_reboot
- name: interface configuration
2017-07-03 20:18:24 +02:00
template:
2017-05-18 23:10:07 +02:00
src: 'etc/sysconfig/network-scrips/ifcfg.j2'
dest: '/etc/sysconfig/network-scripts/ifcfg-{{ item.key }}'
owner: root
group: root
mode: 0644
2017-07-03 20:18:24 +02:00
with_dict: '{{ network_interfaces }}'
2017-05-18 23:10:07 +02:00
when: item.key in ansible_interfaces
notify:
- network_restart