ansible-role-borgbackup/molecule/default/converge.yml
Stefan Morgenthaler 981d4f9072
Allow to installation via OS package manager or pip (#106)
* allow to installation via os package manager or pip

* Run a second time to install via package manager

* Check for EPEL if distro package requested.

* Split dep lists to avoid installing build deps when using distro pkg

Co-authored-by: Stefan Morgenthaler <dev@morgenthaler.at>
Co-authored-by: Manu <manu@snapdragon.cc>
2022-12-15 17:40:53 +01:00

48 lines
1.2 KiB
YAML

---
- name: Converge
hosts: all
pre_tasks:
- name: Set ssh server package name for non-Archlinux ansible_os_family
set_fact:
openssh_package: "openssh-server"
when: ansible_os_family != "Archlinux"
- name: Set ssh server package name for Archlinux ansible_os_family
set_fact:
openssh_package: "openssh"
when: ansible_os_family == "Archlinux"
- name: Install openssh
package:
name: "{{ openssh_package }}"
state: present
roles:
- role: m3nu.ansible_role_borgbackup
borg_encryption_passphrase: CHANGEME
borg_repository: m5vz9gp4@m5vz9gp4.repo.borgbase.com:repo
borg_source_directories:
- /srv/www
- /var/lib/automysqlbackup
borg_exclude_patterns:
- /srv/www/old-sites
borg_retention_policy:
keep_hourly: 3
keep_daily: 7
keep_weekly: 4
keep_monthly: 6
borgmatic_hooks:
before_backup:
- echo "`date` - Starting backup."
postgresql_databases:
- name: users
hostname: database1.example.org
port: 5433
borg_install_method: pip
post_tasks:
- name: Install yamllint for checking config file
pip:
name: yamllint
executable: pip3