DeltaBG / ansible-role-bareos

Role for installing and managing BareOS director, storages and client
MIT License
3 stars 0 forks source link

please help #2

Open awsmaythem opened 11 months ago

awsmaythem commented 11 months ago

hello i used your ansible role for bareos in my gitlab project but what is the inventory_file.ini lines have? i have an error in pipeline at the step adding a client: TASK [bareos : Configure client pools in /etc/bareos/bareos-dir.d/pool/*.conf (Director)] *** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'bareos_client_remote_storage'. 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'bareos_client_remote_storage' failed: [ITIP_2556_ZOUP3 -> ITIP_2561_KAUP3(10.88.2.88)] (item=ITIP_2556_ZOUP3) => {"ansible_loop_var": "item", "changed": false, "item": "ITIP_2556_ZOUP3", "msg": "AnsibleUndefinedVariable: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'bareos_client_remote_storage'. 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'bareos_client_remote_storage'"}

inventory_file.ini


[bareos_clients]
ITIP_2556_ZOUP3 ansible_hostname=ITIP_2556_ZOUP3 ansible_host=10.88.2.85 ansible_port=22 ansible_user=root 

[bareos_director]
ITIP_2561_KAUP3 ansible_hostname=ITIP_2561_KAUP3 ansible_host=10.88.2.88 ansible_port=22 ansible_user=root
vdzhorov commented 11 months ago

Hey there,

The ansible role expects you to have a configured host_vars for each of your BareOS clients. Here is an example of a client host_vars:

---
bareos_client_hostname: "{{ inventory_hostname }}"
bareos_client_tls_enable: "No"
bareos_client_address: "{{ ansible_host }}"
bareos_client_schedule: "<SCHEDULE>"
bareos_client_fileset: "<FILESET>"
bareos_client_pool_volume_retention: "7d"
bareos_client_pool_file_retention: "14d"
bareos_client_pool_job_retention: "14d"
bareos_client_pool_max_volumes: "2"
bareos_client_pool_use_duration: "7d"
bareos_client_pool_action_on_purge: "truncate"
bareos_client_pool_type: Backup
bareos_client_pool_recycle: "yes"
bareos_client_pool_auto_prune: "yes"
bareos_client_pool_recycle_oldest_volume: "yes"
bareos_client_remote_storage: "<REMOTE_STORAGE>"
bareos_bareos_bareos_client_maximum_concurrent_jobs: "Yes"
bareos_client_maximum_concurrent_jobs: 10
bareos_client_maximum_bandwidth_per_job: "90 m/s"
bareos_client_acl_allow_hosts:
  - "{{ inventory_hostname }}"

Here is an example of a remote storage, configured via group_vars/all/vars.yml:

...
bareos_remote_storages:
  - name: local_storage
    address: "127.0.0.1"
    device: "/var/lib/bareos/storage"
    bareos_max_bandwidth_per_job: "90 m/s"
    bareos_max_concurrent_jobs: 10
    bareos_media_type: File
    bareos_tls_enable: "no"
...