ADD import roles
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
---
|
||||
- name: Set OS dependent variables
|
||||
include_vars: "{{ lookup('first_found', params) }}"
|
||||
vars:
|
||||
params:
|
||||
files:
|
||||
- "{{ ansible_distribution | lower }}_{{ ansible_distribution_version | lower }}.yml"
|
||||
- "{{ ansible_distribution | lower }}_{{ ansible_distribution_major_version | lower }}.yml"
|
||||
- "{{ ansible_distribution | lower }}.yml"
|
||||
- "{{ ansible_os_family | lower }}.yml"
|
||||
- "{{ ansible_system | lower }}.yml"
|
||||
paths:
|
||||
- "{{ role_path }}/vars"
|
||||
ignore_errors: True
|
||||
tags:
|
||||
- always
|
||||
|
||||
- name: OS is supported
|
||||
assert:
|
||||
that: __os_supported
|
||||
quiet: True
|
||||
vars:
|
||||
__os_supported: "{{ lookup('vars', '{}_os_supported'.format(role_name)) | bool }}"
|
||||
tags:
|
||||
- always
|
||||
|
||||
- name: Install required packages
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
with_items: "{{ lookup('vars', '{}_packages'.format(role_name)) | list }}"
|
||||
when: radvd_enabled
|
||||
tags:
|
||||
- install
|
||||
|
||||
- name: Install dhcpd configuration
|
||||
template:
|
||||
src: dhcpd.conf.j2
|
||||
dest: "/etc/dhcp/dhcpd.conf"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
tags:
|
||||
- configure
|
||||
no_log: false
|
||||
notify: Restart isc_dhcp
|
||||
|
||||
- name: Install dhcpd configuration
|
||||
template:
|
||||
src: isc-dhcp-server.j2
|
||||
dest: "/etc/default/isc-dhcp-server"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
tags:
|
||||
- configure
|
||||
no_log: false
|
||||
notify: Restart isc_dhcp
|
||||
|
||||
- name: Enable dhcpd service
|
||||
ansible.builtin.systemd_service:
|
||||
name: isc-dhcp-server.service
|
||||
state: started
|
||||
enabled: true
|
||||
Reference in New Issue
Block a user