Skip to content
Snippets Groups Projects
Select Git revision
  • 22448f7bc76db9096e2d5a22284f22df61da1c8f
  • master default protected
  • th/etcd-patroni
  • th/pgbackrest
4 results

main.yml

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    main.yml 1.06 KiB
    ---
    
    - name: ensure postgres packages are installed
      apt:
        name:
          - postgresql
          - python-psycopg2
          - python3-psycopg2
          - libpq-dev
        state: present
      tags:
        - postgres
    
    - name: ensure postgres is started
      service:
        name: postgresql
        state: started
        enabled: true
      tags:
        - postgres
    
    - name: ensure we have rsnapshot
      apt:
        name: rsnapshot
        state: present
      tags:
        - postgres
        - rsnapshot
        - backup
    
    - name: ensure we have our postgres backup script
      copy:
        src: pgbackup.sh
        dest: /usr/local/bin/
        owner: root
        group: root
        mode: '0755'
      tags:
        - postgres
        - rsnapshot
        - backup
    
    - name: ensure we have our rsnapshot config
      template:
        src: rsnapshot.conf.j2
        dest: /etc/
        owner: root
        group: root
        mode: '0644'
      tags:
        - postgres
        - rsnapshot
        - backup
    
    - name: ensure rsnapshot is running regularly
      template:
        src: crontab.j2
        dest: /etc/cron.d/postgres-snapshot
        owner: root
        group: root
        mode: '0644'
      tags:
        - postgres
        - rsnapshot
        - backup