Closed rubencabrera closed 6 years ago
From a role where I used the core modules for postgres to install and create users and db's, I included ansible-postgresql to make automated backups.
- name: Copias de seguridad include_role: name: postgresql become: True vars: postgresql_backup_dir: /backups tags: - a_tag - another_tag
Then, calling the playbook with: $ ansible-playbook main-playbook.yml --tags another_tag -K
$ ansible-playbook main-playbook.yml --tags another_tag -K
I get an error when installing the backup scripts:
TASK [postgresql : Install backup scripts] *************************************************************** ok: [my_server] => (item=backup_working_wal.sh) failed: [my_server] (item=archive_wal.sh) => {"failed": true, "item": "archive_wal.sh", "msg": "AnsibleUndefinedVariable: 'postgresql_backup_remote_rsync_path' is undefined"} failed: [my_server] (item=scheduled_backup.sh) => {"failed": true, "item": "scheduled_backup.sh", "msg": "AnsibleUndefinedVariable: 'postgresql_backup_remote_rsync_path' is undefined"}
I guess it's just a matter of specifying that variable, but as the readme says all vars are optional, maybe it should be clarified or given a default value.
Thanks for the role, anyway, gonna save me a lot of time!
I added an if variable_name is defined on the template and the role works, but I suspect the backup script is going to fail.
From a role where I used the core modules for postgres to install and create users and db's, I included ansible-postgresql to make automated backups.
Then, calling the playbook with:
$ ansible-playbook main-playbook.yml --tags another_tag -K
I get an error when installing the backup scripts:
I guess it's just a matter of specifying that variable, but as the readme says all vars are optional, maybe it should be clarified or given a default value.
Thanks for the role, anyway, gonna save me a lot of time!