ansible snippets (need testing)
The snippet can be accessed without any authentication.
Authored by
Luca Cristaldi
Edited
test.yml 896 B
- name: install trytond
pip:
name: trytond{{ "==" + version | default("") }}
- name: install module
pip:
name: "{{ module }}"
command: trytond-admin -c {{ config_path }}{{ database | join(' -d ')}}{{ module_name | join(' -u ') }} --activate-dependencies
systemd:
name: "{{ service | default('trytond')}}"
state: restarted
- name: backup tryton db
postgresql_db:
name: "{{ tryton_db }}"
state: dump
target: "{{ path | default('.')}}/{{ tryton_db }}_{{ ansible_date_time.date }}{{ '_' + desciption | deafult('') }}.sql"
target_opts: "-c"
- name: find backup
find:
paths: "{{ path }}"
- name: restore from backup
vars:
full_target_path: "{{ path | default('.')}}/{{ target }}"
debug: msg="{{ lookup('file', full_target_path, errors='strict') }}"
postgresql_db:
name: "{{ tryton_db }}"
state: restore
target: full_target_path
Please register or sign in to comment