mirror of
https://gitea.0xace.cc/ansible-galaxy/bird.git
synced 2024-11-25 16:06:41 +00:00
50 lines
1.1 KiB
YAML
50 lines
1.1 KiB
YAML
|
---
|
||
|
- name: Mask bird before install for Debian OS family
|
||
|
ansible.builtin.systemd:
|
||
|
name: "{{ bird_unit_name }}"
|
||
|
masked: yes
|
||
|
when: ansible_facts['os_family'] == 'Debian'
|
||
|
changed_when: false
|
||
|
|
||
|
- name: Install bird
|
||
|
package:
|
||
|
name: "{{ bird_package }}"
|
||
|
state: present
|
||
|
register: bird_setup
|
||
|
|
||
|
- name: Template default bird.conf config
|
||
|
when: bird_config_override is not defined
|
||
|
block:
|
||
|
- name: Add default bird.conf
|
||
|
template:
|
||
|
src: "bird.conf.j2"
|
||
|
dest: "/etc/bird/bird.conf"
|
||
|
notify:
|
||
|
- Reload bird
|
||
|
|
||
|
- name: Template bird.conf override
|
||
|
when: bird_config_override is defined
|
||
|
block:
|
||
|
- name: Override bird.conf
|
||
|
copy:
|
||
|
content: "{{ bird_config_override }}"
|
||
|
dest: "/etc/bird/bird.conf"
|
||
|
notify:
|
||
|
- Reload bird
|
||
|
|
||
|
- name: Unmask bird after install for Debian OS family
|
||
|
ansible.builtin.systemd:
|
||
|
name: "{{ bird_unit_name }}"
|
||
|
masked: no
|
||
|
when: ansible_facts['os_family'] == 'Debian'
|
||
|
changed_when: false
|
||
|
|
||
|
- name: Enable and start bird service
|
||
|
systemd:
|
||
|
name: "{{ bird_unit_name }}"
|
||
|
state: started
|
||
|
enabled: yes
|
||
|
masked: no
|
||
|
daemon_reload: yes
|
||
|
register: bird_enable_and_start
|