mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 10:25:28 +00:00
tasks: name "vars" file by the matching "{{ ansible_distribution }}"
This fixes the role to run on Fedora and CentOS.
This commit is contained in:
parent
9ae0bde868
commit
52318732bb
7 changed files with 16 additions and 12 deletions
|
|
@ -1,9 +1,3 @@
|
|||
network_provider: "{{ network_providers[ansible_os_family][ansible_distribution_major_version] }}"
|
||||
|
||||
network_provider: "{{ network_provider_default }}"
|
||||
network:
|
||||
connections: []
|
||||
|
||||
network_providers:
|
||||
RedHat:
|
||||
"6": "initscripts"
|
||||
"7": "nm"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,15 @@
|
|||
- name: Set version specific variables
|
||||
include_vars: "{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml"
|
||||
include_vars: "{{ item }}"
|
||||
with_first_found:
|
||||
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
|
||||
- "{{ ansible_distribution }}.yml"
|
||||
- "{{ ansible_os_family }}.yml"
|
||||
- "default.yml"
|
||||
|
||||
- name: Install packages
|
||||
yum:
|
||||
name: "{{ network_packages | default([]) }}"
|
||||
state: present
|
||||
package:
|
||||
name: "{{ network_packages | default([]) }}"
|
||||
state: present
|
||||
|
||||
- name: Enable network service
|
||||
service:
|
||||
|
|
|
|||
1
vars/CentOS-6.yml
Symbolic link
1
vars/CentOS-6.yml
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
default-initscripts.yml
|
||||
|
|
@ -1 +0,0 @@
|
|||
network_service_name: network
|
||||
1
vars/RedHat-6.yml
Symbolic link
1
vars/RedHat-6.yml
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
default-initscripts.yml
|
||||
2
vars/default-initscripts.yml
Normal file
2
vars/default-initscripts.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
network_service_name: network
|
||||
network_provider_default: initscripts
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
network_service_name: NetworkManager
|
||||
network_packages:
|
||||
- NetworkManager
|
||||
network_provider_default: nm
|
||||
1
vars/default.yml
Symbolic link
1
vars/default.yml
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
default-nm.yml
|
||||
Loading…
Add table
Add a link
Reference in a new issue