- add Retic repo
- yum install restic
add a Restic credential file to root
vim /root/.restic
| #!py | |
| import yaml | |
| import salt | |
| import logging | |
| log = logging.getLogger(__name__) | |
| def configure_user(host_users, all_users, config, host): | |
| ''' configure a User - add Group, Home Dir, SSH keys, etc ''' |
| --- | |
| pvespa: | |
| uid: 5037 | |
| fullname: Princess Vespa | |
| groups: ['users'] | |
| ssh_keys: | |
| - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDWuwV75hyhECKpIXeu2w7hb6FpfiP2Nwap46i6ohPPj9Uqx6efCUE0xTS/7AtIYRaCL97k9mUEGvqsx6ZoLfa/QzV8LcxtVmvYa9IMyVKddiSEys7Ngh5hS+J5ZHJegQC4fD6DdUG+6XYT7Vfh6XblSQ8Tjg25nuvDrv/ObwYS8vgef9EnO3nooqiVYq0PuLb+ZLM15TE1bXVBh5P5lhr8aJDpsjBuB0FFGjCFN7fPSTmw8/oyp4lRPQ/vYNheyqBEZmyJceMT15SvVgyCLkTJCy2cpXxALjh56WCfKadx0JfwRwFUvERMQ+ZUKEMTqW3cAPkn6vX2xYMXa5WuN6G1mB vespa@imac | |
| - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABACCdTgFK5fB4mkuIRcLAGfPPn6WDWZBH3Ew8hCCL26KCkuiitjdZbLospuBk6BAAZfWCaGzZN04bveLP48cTd5JZ/PMcaPytJ23oEpvobl99tHG6L/Q/XQs6jDIB3ex0YByh70Cic7oBSMFaidDmm4VPl5DVKBeLrcuaIE1PgDvFlb/bk+sHCb+93CZDbOxU3WNKYubDKQEIOZcuYPsW1vyVSFnBb9O8F1x2g3YtOWxI42qq/4LbqiJbRwRlzrKAId73azgX/0o97CffKYr8DPBqykTA5FBABQSY376zcgkfQbJD8wnAxyssTPiOEiWRYJ8hDg3P5ZUUBfd0S5PnvE9z pvespa@mac2 | |
| lstar: |
| { | |
| "name": "devsaltmaster", | |
| "host": "devsaltmaster", | |
| "protocol": "sftp", | |
| "port": 22, | |
| "username": "root", | |
| "password": "xxx", | |
| // or use "privateKeyPath": "/home/user/.ssh/id_rsa", | |
| "remotePath": "/srv/saltstack", | |
| "uploadOnSave": true, |
| #!/usr/bin/env python | |
| import json | |
| import salt.client | |
| import salt.config | |
| import salt.loader | |
| import salt.modules.smtp | |
| notify = '[email protected]' | |
| smtp = 'localhost' |
| #!/bin/bash | |
| # Runs Restic backup on a schedule via cron, emails with status | |
| # 1. add a cred file with your repo logins to /etc/restic/cred | |
| # 2. | |
| FROM="restic@$(hostname)" | |
| EMAIL="[email protected]" | |
| LOG="/var/log/restic.log" | |
| RDIR="/etc/restic" |
| #!/bin/bash | |
| # this script creates an IPIP Tunnel | |
| # tested for CENTOS 6 & 7 | |
| #---------------------------- | |
| # CONFIGURATION | |
| #---------------------------- | |
| # name of tunnel | |
| name='tun_test' |
| # Custom Execution Module - SUDO ACCESS | |
| # tested for Centos 7 | |
| import salt | |
| import time | |
| import os | |
| import logging | |
| import re | |
| from datetime import datetime, timedelta | |
| import subprocess |
| #!/bin/bash | |
| # Installs Python 3.7 on Centos 7 | |
| yum -y install libffi-devel gcc openssl-devel bzip2-devel | |
| cd /usr/src | |
| wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz | |
| tar xzf Python-3.7.0.tgz | |
| cd Python-3.7.0/ |
| #!/bin/bash | |
| # Secure OpenVPN server installer for Debian, Ubuntu, CentOS and Arch Linux | |
| # https://github.com/Angristan/OpenVPN-install | |
| # Verify root | |
| if [[ "$EUID" -ne 0 ]]; then | |
| echo "Sorry, you need to run this as root" | |
| exit 1 |