63 lines
1.5 KiB
YAML
63 lines
1.5 KiB
YAML
---
|
|
- 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 }}"
|
|
tags:
|
|
- install
|
|
|
|
- name: Enable routing in sysctl
|
|
template:
|
|
src: sysctl.conf.j2
|
|
dest: /etc/sysctl.d/90-routing.conf
|
|
owner: root
|
|
group: root
|
|
mode: "0644"
|
|
notify: Reload sysctl
|
|
|
|
- name: Install bird configuration
|
|
template:
|
|
src: bird.conf.j2
|
|
dest: "/etc/bird/bird.conf"
|
|
owner: root
|
|
group: root
|
|
mode: 0755
|
|
tags:
|
|
- configure
|
|
no_log: false
|
|
when: bird_enabled
|
|
notify: Reconfigure bird
|
|
|
|
- name: Enable bird service
|
|
ansible.builtin.systemd_service:
|
|
name: bird.service
|
|
state: "{{ 'started' if bird_enabled else 'stopped' }}"
|
|
enabled: "{{ bird_enabled }}"
|
|
when: not ansible_check_mode
|