From 9471773d0454883e7115d240aeeb99aea60ce2d4 Mon Sep 17 00:00:00 2001 From: Andrey Sokolovskiy Date: Sun, 11 Feb 2024 22:26:47 +0700 Subject: [PATCH] fix repo --- defaults/main.yml | 6 ++---- meta/main.yml | 9 +++++++-- tasks/repo.yml | 11 +++++++++++ tasks/storage.yml | 7 +++++++ vars/Debian.yml | 1 + vars/Ubuntu.yml | 1 + vars/main.yml | 1 + 7 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 vars/Debian.yml create mode 100644 vars/Ubuntu.yml create mode 100644 vars/main.yml diff --git a/defaults/main.yml b/defaults/main.yml index 68d241f..a3db893 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,8 +1,5 @@ --- -bareos_version: 19.2 -bareos_distribution_major_version: '{{ ansible_distribution_major_version }}' -bareos_repo: http://download.bareos.org/bareos/release -bareos_url: '{{ bareos_repo }}/{{ bareos_version }}/Debian_{{ bareos_distribution_major_version }}' +bareos_repo: http://download.bareos.org/current bareos_client: true bareos_client_name: '{{ inventory_hostname_short }}' bareos_client_max_concurrent_jobs: 2 @@ -23,4 +20,5 @@ bareos_storage: false bareos_storage_name: '{{ inventory_hostname_short }}' bareos_storage_max_concurrent_jobs: 10 bareos_storage_devices: {} +bareos_storage_droplet: false bareos_web: false diff --git a/meta/main.yml b/meta/main.yml index 2f4c021..854aacf 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -12,9 +12,14 @@ galaxy_info: - name: Debian versions: - buster + - name: Ubuntu + versions: + - focal + - jammy galaxy_tags: - - bacula + - bareos - backup -dependencies: [] +dependencies: + - postgresql diff --git a/tasks/repo.yml b/tasks/repo.yml index b915ca4..24e17cc 100644 --- a/tasks/repo.yml +++ b/tasks/repo.yml @@ -5,6 +5,17 @@ - gnupg tags: bareos +- name: "Set bareos url based on the OS type" + ansible.builtin.include_vars: "{{ lookup('ansible.builtin.first_found', params) }}" + vars: + params: + files: + - '{{ansible_distribution}}.yaml' + - '{{ansible_os_family}}.yaml' + - default.yaml + paths: + - 'vars' + - name: import repo key ansible.builtin.apt_key: url: '{{ bareos_url }}/Release.key' diff --git a/tasks/storage.yml b/tasks/storage.yml index d45d3ff..2c191ca 100644 --- a/tasks/storage.yml +++ b/tasks/storage.yml @@ -5,6 +5,13 @@ - bareos-storage tags: bareos +- name: install droplet storage plugin + ansible.builtin.package: + name: + - bareos-storage-droplet + when: bareos_storage_droplet + tags: bareos + - name: copy storage configuration 1/3 ansible.builtin.template: src: storage-bareos-sd.conf.j2 diff --git a/vars/Debian.yml b/vars/Debian.yml new file mode 100644 index 0000000..5417590 --- /dev/null +++ b/vars/Debian.yml @@ -0,0 +1 @@ +bareos_url: '{{ bareos_repo }}/Debian_{{ ansible_distribution_major_version }}' \ No newline at end of file diff --git a/vars/Ubuntu.yml b/vars/Ubuntu.yml new file mode 100644 index 0000000..0e26c5d --- /dev/null +++ b/vars/Ubuntu.yml @@ -0,0 +1 @@ +bareos_url: '{{ bareos_repo }}/xUbuntu_{{ ansible_distribution_version }}' \ No newline at end of file diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..73b314f --- /dev/null +++ b/vars/main.yml @@ -0,0 +1 @@ +--- \ No newline at end of file