diff --git a/tasks/RedHat/7.yaml b/tasks/RedHat/7.yaml new file mode 100644 index 0000000..5ef9cb1 --- /dev/null +++ b/tasks/RedHat/7.yaml @@ -0,0 +1,26 @@ +--- +- name: install bird + package: + name: bird2 + state: present + +- name: add bird config + template: + src: bird.conf.j2 + dest: /etc/bird.conf + notify: + - restart bird + +- name: update ifcfg-lo config + template: + src: ifcfg-lo.j2 + dest: /etc/sysconfig/network-scripts/ifcfg-lo + notify: + - restart loopback + +- name: start bird service + systemd: + name: bird + state: started + enabled: yes + daemon_reload: yes diff --git a/tasks/RedHat/8.yaml b/tasks/RedHat/8.yaml new file mode 100644 index 0000000..e24c6f6 --- /dev/null +++ b/tasks/RedHat/8.yaml @@ -0,0 +1,26 @@ +--- +- name: install bird + package: + name: bird + state: present + +- name: add bird config + template: + src: bird.conf.j2 + dest: /etc/bird.conf + notify: + - restart bird + +- name: update ifcfg-lo config + template: + src: ifcfg-lo.j2 + dest: /etc/sysconfig/network-scripts/ifcfg-lo + notify: + - restart loopback + +- name: start bird service + systemd: + name: bird + state: started + enabled: yes + daemon_reload: yes diff --git a/tasks/main.yml b/tasks/main.yml index 5ef9cb1..d1a9278 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,26 +1,3 @@ --- -- name: install bird - package: - name: bird2 - state: present - -- name: add bird config - template: - src: bird.conf.j2 - dest: /etc/bird.conf - notify: - - restart bird - -- name: update ifcfg-lo config - template: - src: ifcfg-lo.j2 - dest: /etc/sysconfig/network-scripts/ifcfg-lo - notify: - - restart loopback - -- name: start bird service - systemd: - name: bird - state: started - enabled: yes - daemon_reload: yes +- name: Include BIRD installation tasks + include: "{{ ansible_os_family }}/{{ ansible_distribution_version }}.yaml"