Skip to content
Snippets Groups Projects

ansible snippets (need testing)

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    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
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment