-
Notifications
You must be signed in to change notification settings - Fork 61
/
main.yml
41 lines (36 loc) · 1.21 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
- name: Gather variables for each operating system
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- "{{ ansible_distribution | lower }}.yml"
- "{{ ansible_os_family | lower }}.yml"
tags:
- always
- name: ensure basic networking tools are installed
apt:
pkg: "{{ item }}"
state: present
update_cache: yes
cache_valid_time: 86400
when: network_interfaces
with_items: "{{ network_interface_required_packages }}"
- include: all_interfaces.yml
when: network_interfaces
- name: configurations
template:
src: device.j2
dest: "{{ network_interface_path }}/device-{{ item.0 }}"
mode: "{{ network_interface_permissions }}"
with_items:
- "{{ network_interfaces | default([]) | groupby('device') }}"
register: network_configuration_result
notify:
- network restart interface service
- network restart interface command
- include: manage_devices.yml
when:
- network_manage_devices
- network_interfaces