From 621aed00db59da08af006ae82b7f6438a04946ee Mon Sep 17 00:00:00 2001 From: Simon Heath Date: Thu, 21 Apr 2016 15:10:25 -0400 Subject: [PATCH 1/2] Contributed Salt example to docs --- docs/deployment.rst | 53 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/docs/deployment.rst b/docs/deployment.rst index 1620aace9..a437dc9f9 100644 --- a/docs/deployment.rst +++ b/docs/deployment.rst @@ -147,6 +147,58 @@ package manager to install and keep borg up-to-date. - file: path="{{ pool }}/{{ item.host }}" owner="{{ user }}" group="{{ group }}" mode=0700 state=directory with_items: auth_users +Salt +---- + +This is a configuration similar to the one above, configured to be deployed with +Salt running on a Debian system. + +:: + Install borg backup from pip: + pkg.installed: + - pkgs: + - python3 + - python3-dev + - python3-pip + - python-virtualenv + - libssl-dev + - openssl + - libacl1-dev + - libacl1 + - liblz4-dev + - liblz4-1 + - build-essential + - libfuse-dev + - fuse + - pkg-config + pip.installed: + - pkgs: ["borgbackup"] + - bin_env: /usr/bin/pip3 + + Setup backup user: + user.present: + - name: backup + - fullname: Backup User + - home: /home/backup + - shell: /bin/bash + # CAUTION! + # If you change the ssh command= option below, it won't necessarily get pushed to the backup + # server correctly unless you delete the ~/.ssh/authorized_keys file and re-create it! + {% for host in backupclients %} + Give backup access to {{host}}: + ssh_auth.present: + - user: backup + - source: salt://conf/ssh-pubkeys/{{host}}-backup.id_ecdsa.pub + - options: + - command="cd /home/backup/repos/{{host}}; borg serve --restrict-to-path /home/backup/repos/{{host}}" + - no-port-forwarding + - no-X11-forwarding + - no-pty + - no-agent-forwarding + - no-user-rc + {% endfor %} + + Enhancements ------------ @@ -164,3 +216,4 @@ See also * `SSH Daemon manpage `_ * `Ansible `_ +* `Salt `_ From 43fc7a267f8d972b557e0e94682bfe822ad696b5 Mon Sep 17 00:00:00 2001 From: Simon Heath Date: Thu, 21 Apr 2016 15:11:43 -0400 Subject: [PATCH 2/2] Fixed formatting --- docs/deployment.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/deployment.rst b/docs/deployment.rst index a437dc9f9..c31f048f2 100644 --- a/docs/deployment.rst +++ b/docs/deployment.rst @@ -154,6 +154,7 @@ This is a configuration similar to the one above, configured to be deployed with Salt running on a Debian system. :: + Install borg backup from pip: pkg.installed: - pkgs: