- name: Install bacula-director apt: pkg={{ packages }} vars: packages: - bacula-console - bacula-director - bacula-director-mysql - name: Create a 'bacula' SQL user mysql_user: name=bacula password= plugin=unix_socket state=present notify: - Restart bacula-director # Populate with: # echo bconsole $(pwgen -sn 64 1) | sudo tee -a /etc/bacula/passwords-dir # echo $sd-sd $(pwgen -sn 64 1) | sudo tee -a /etc/bacula/passwords-dir # echo $fd-fd $(pwgen -sn 64 1) | sudo tee -a /etc/bacula/passwords-dir # # then add the password for each FD / SD: # echo $director-dir $password | sudo tee /etc/bacula/passwords-sd # echo $director-dir $password | sudo tee /etc/bacula/passwords-fd - name: Ensure /etc/bacula/passwords-dir exists file: path=/etc/bacula/passwords-dir state=file owner=bacula group=bacula mode=0600 - name: Configure bconsole template: src=etc/bacula/bconsole.conf.j2 dest=/etc/bacula/bconsole.conf owner=root group=root mode=0644 - name: Configure bacula template: src=etc/bacula/bacula-dir.conf.j2 dest=/etc/bacula/bacula-dir.conf owner=root group=root mode=0644 register: r notify: - Restart bacula-director - name: Create /etc/systemd/system/bacula-director.service.d file: path=/etc/systemd/system/bacula-director.service.d state=directory owner=root group=root mode=0755 - name: Copy bacula-director.service override copy: src=etc/systemd/system/bacula-director.service.d/override.conf dest=/etc/systemd/system/bacula-director.service.d/override.conf owner=root group=root mode=0644 notify: - systemctl daemon-reload - Restart bacula-director - meta: flush_handlers - name: Enable bacula-director service: name=bacula-director enabled=yes - name: Start bacula-director service: name=bacula-director state=started