create network role and include it into base (only openbsd does something)

This commit is contained in:
Timo Makinen 2019-05-28 00:25:06 +03:00
parent ba0c70532f
commit dd19c94511
9 changed files with 101 additions and 0 deletions

View file

@ -0,0 +1,37 @@
---
- name: create ethernet interface configurations
template:
src: hostname.if.j2
dest: "/etc/hostname.{{ item.device }}"
mode: 0600
owner: root
group: "{{ ansible_wheel }}"
with_items: "{{ network_ether_interfaces }}"
notify: restart network
- block:
- name: create carp interface configurations
template:
src: hostname.carp.j2
dest: "/etc/hostname.carp{{ item.vhid }}"
mode: 0600
owner: root
group: "{{ ansible_wheel }}"
with_items: "{{ network_carp_interfaces }}"
notify: restart network
- name: enable carp preempt
sysctl:
name: net.inet.carp.preempt
value: 1
when: network_carp_interfaces != []
- name: set default gateway
copy:
content: "{{ network_default_gateway }}\n"
dest: /etc/mygate
mode: 0600
owner: root
group: "{{ ansible_wheel }}"
notify: restart network
when: network_default_gateway is defined

View file

@ -0,0 +1 @@
---

View file

@ -0,0 +1,12 @@
---
- name: include os spcific tasks
include_tasks: "{{ ansible_os_family }}.yml"
- name: create resolv.conf
template:
src: resolv.conf.j2
dest: /etc/resolv.conf
mode: 0644
owner: root
group: "{{ ansible_wheel }}"
when: network_dns_servers is defined