Compare commits

...

5 Commits

Author SHA1 Message Date
CPunch d435ab80ac fix: wrong paths in imdead.sh (oops) 2022-10-04 13:13:46 -05:00
CPunch bf5763a42f updated to latest secrets 2022-10-04 13:09:36 -05:00
CPunch 6325e393b3 updated readme 2022-10-04 12:51:54 -05:00
CPunch ec89c70336 Deploy ansible playbook automagically 2022-10-04 12:21:22 -05:00
CPunch 281e98f030 better file permissions 2022-10-04 11:29:40 -05:00
6 changed files with 39 additions and 9 deletions

27
.github/workflows/deploy.yaml vendored Normal file
View File

@ -0,0 +1,27 @@
name: Run Playbook
on:
push:
tags:
- "v*.*.*"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
submodules: recursive
- name: Run Ansible-Playbook
uses: dawidd6/action-ansible-playbook@v2
with:
playbook: run.yml
key: ${{ secrets.SSH_PRIVATE_KEY }}
inventory: |
[hosts]
openpunk-vps ansible_host=96.30.199.68 ansible_user=root ansible_connection=ssh
vault_password: ${{ secrets.VAULT_PASSWORD }}
options: |
--extra-vars domain=openpunk.com

View File

@ -1,4 +1,7 @@
# OpenPunk's Ansible playbook
<p align="center">
<a href="https://github.com/CPunch/openpunk-ansible/actions/workflows/deploy.yaml"><img src="https://github.com/CPunch/openpunk-ansible/actions/workflows/deploy.yaml/badge.svg?branch=main" alt="Workflow"></a>
</p>
This is my failsafe (and also my helpful migration tool) for restoring the OpenPunk server. This handles setting everything back up, including:
@ -11,19 +14,19 @@ This is my failsafe (and also my helpful migration tool) for restoring the OpenP
This playbook assumes the target VPS is running the latest debian stable release.
## Notes to my future self
## Automatic deployment
On new release tags the playbook is automatically ran on the production openpunk vps. For more info checkout the `.github/workflows/deploy.yaml` workflow
## Notes to my future self
The deadswitch has the deadtrigger setup every run, so you have a 14-day timer to add a one-liner to your crontab to keep that deadtrigger set.
## Usage
```sh
ansible-playbook -i hosts --ask-vault-pass run.yml
```
> NOTE: The 'secrets' directory has been omitted from this repo (so it's not going to run without the provided files)
## Example hosts file
```
[hosts]
openpunk-vps ansible_host=104.238.138.76 ansible_user=root ansible_connection=ssh

@ -1 +1 @@
Subproject commit d71665b85e4dda3a0323d6fc293a5296fb8c75ee
Subproject commit 585d0fd7dda8b515fc7c78cd1491c0ec7d79b05c

View File

@ -2,7 +2,7 @@
cd $HOME/deadman
postPatch='../dead.patch'
postPatch='dead.patch'
pageName='content/pages/dead.md'
currDate=$(date '+%Y-%m-%d')

View File

@ -13,7 +13,7 @@
template:
src: templates/blog/updateBlog
dest: /usr/local/bin/updateBlog
mode: u+rwx
mode: u+rx
# Rebuild blog every hour
- name: Setup blog cron job

View File

@ -8,19 +8,19 @@
copy:
src: static/blog/deadswitch
dest: /usr/local/bin/deadswitch
mode: u+rwx
mode: u+rx
- name: Install imdead.sh
copy:
src: static/blog/imdead.sh
dest: /root/deadman/imdead.sh
mode: u+rwx
mode: u+rx
- name: Copy dead patch
copy:
src: secrets/dead.patch
dest: /root/deadman/dead.patch
mode: u+rwx
mode: u+rw
- name: Install deadtrigger
file: