89 lines
1.9 KiB
YAML
89 lines
1.9 KiB
YAML
---
|
|
- name: Install bacula
|
|
ansible.builtin.apt:
|
|
name:
|
|
- bacula-director
|
|
- bacula-director-sqlite3
|
|
- bacula-fd
|
|
- bacula-sd
|
|
- bacula-console
|
|
state: latest
|
|
|
|
- name: Configure database
|
|
ansible.builtin.copy:
|
|
src: files/bacula/bacula-director-sqlite3.conf
|
|
dest: /etc/dbconfig-common/bacula-director-sqlite3.conf
|
|
mode: '0600'
|
|
owner: root
|
|
group: root
|
|
|
|
- name: Configure catalog backup script
|
|
ansible.builtin.copy:
|
|
src: files/bacula/make_catalog_backup.pl
|
|
dest: /etc/bacula/scripts/make_catalog_backup.pl
|
|
mode: '0755'
|
|
owner: root
|
|
group: bacula
|
|
|
|
- name: Configure director
|
|
ansible.builtin.template:
|
|
src: bacula/bacula-dir.conf.j2
|
|
dest: /etc/bacula/bacula-dir.conf
|
|
mode: '0640'
|
|
owner: root
|
|
group: bacula
|
|
|
|
- name: Configure bconsole
|
|
ansible.builtin.template:
|
|
src: bacula/bconsole.conf.j2
|
|
dest: /etc/bacula/bconsole.conf
|
|
mode: '0640'
|
|
owner: root
|
|
group: nagios
|
|
|
|
- name: Configure bacula fd
|
|
ansible.builtin.template:
|
|
src: bacula/bacula-fd.conf.j2
|
|
dest: /etc/bacula/bacula-fd.conf
|
|
mode: '0640'
|
|
owner: root
|
|
group: bacula
|
|
|
|
- name: Configure bacula sd
|
|
ansible.builtin.template:
|
|
src: bacula/bacula-sd.conf.j2
|
|
dest: /etc/bacula/bacula-sd.conf
|
|
mode: '0640'
|
|
owner: root
|
|
group: bacula
|
|
|
|
- name: Copy configuration files
|
|
ansible.builtin.template:
|
|
src: "bacula/conf.d/{{ item }}.conf.j2"
|
|
dest: "/etc/bacula/conf.d/{{ item }}.conf"
|
|
loop:
|
|
- clients
|
|
- filesets
|
|
- jobs
|
|
- messages
|
|
- pools
|
|
- schedules
|
|
- storages
|
|
|
|
- name: Allow bacula from vpn
|
|
ansible.builtin.iptables:
|
|
chain: INPUT
|
|
protocol: tcp
|
|
source: "{{ openvpn_subnet }}"
|
|
destination_port: "9102"
|
|
jump: ACCEPT
|
|
comment: allow bacula from vpn
|
|
|
|
- name: Restart bacula services
|
|
ansible.builtin.service:
|
|
name: "{{ item }}"
|
|
state: restarted
|
|
loop:
|
|
- bacula-director
|
|
- bacula-sd
|
|
- bacula-fd
|