From 74f35940f3859334156e6f1c8a6353f482121a2e Mon Sep 17 00:00:00 2001 From: staticsafe Date: Sun, 20 Oct 2019 21:02:36 -0400 Subject: [PATCH] Add pgbackrest-install role --- .../roles/pgbackrest-install/tasks/main.yml | 34 +++++++++++++++++++ ubuntu/site.yml | 7 ++++ 2 files changed, 41 insertions(+) create mode 100644 ubuntu/roles/pgbackrest-install/tasks/main.yml diff --git a/ubuntu/roles/pgbackrest-install/tasks/main.yml b/ubuntu/roles/pgbackrest-install/tasks/main.yml new file mode 100644 index 0000000..be00421 --- /dev/null +++ b/ubuntu/roles/pgbackrest-install/tasks/main.yml @@ -0,0 +1,34 @@ +--- +# This task installs pgbackrest on a host + +- name: Copy pgbackrest binary to host + copy: + src: /builds/pgbackrest-release-2.18/src/pgbackrest + dest: /usr/bin/pgbackrest + mode: '0744' + +- name: Make sure Perl is installed + apt: + name: perl + state: latest + +- name: Make pgbackrest log directory with the correct permissions + file: + path: /var/log/pgbackrest + state: directory + owner: postgres + group: postgres + mode: '0770' + +- name: Make pgbackrest config directory + file: + path: /etc/pgbackrest/conf.d + state: directory + +- name: Touch pgbackrest.conf + file: + path: /etc/pgbackrest/pgbackrest.conf + state: touch + owner: postgres + group: postgres + mode: '0640' diff --git a/ubuntu/site.yml b/ubuntu/site.yml index 471f82b..afcea44 100644 --- a/ubuntu/site.yml +++ b/ubuntu/site.yml @@ -59,3 +59,10 @@ roles: - firewall-ruleset-deploy + +- name: Install pgbackrest + host: pgbackrest + user: root + + roles: + - pgbackrest-install