mirror of
https://github.com/CPunch/openpunk-ansible.git
synced 2024-11-25 00:11:05 +00:00
Compare commits
5 Commits
cad90e7c89
...
d435ab80ac
Author | SHA1 | Date | |
---|---|---|---|
d435ab80ac | |||
bf5763a42f | |||
6325e393b3 | |||
ec89c70336 | |||
281e98f030 |
27
.github/workflows/deploy.yaml
vendored
Normal file
27
.github/workflows/deploy.yaml
vendored
Normal 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
|
@ -1,4 +1,7 @@
|
|||||||
# OpenPunk's Ansible playbook
|
# 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:
|
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.
|
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.
|
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
|
## Usage
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
ansible-playbook -i hosts --ask-vault-pass run.yml
|
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)
|
> NOTE: The 'secrets' directory has been omitted from this repo (so it's not going to run without the provided files)
|
||||||
|
|
||||||
## Example hosts file
|
## Example hosts file
|
||||||
|
|
||||||
```
|
```
|
||||||
[hosts]
|
[hosts]
|
||||||
openpunk-vps ansible_host=104.238.138.76 ansible_user=root ansible_connection=ssh
|
openpunk-vps ansible_host=104.238.138.76 ansible_user=root ansible_connection=ssh
|
||||||
|
2
secrets
2
secrets
@ -1 +1 @@
|
|||||||
Subproject commit d71665b85e4dda3a0323d6fc293a5296fb8c75ee
|
Subproject commit 585d0fd7dda8b515fc7c78cd1491c0ec7d79b05c
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
cd $HOME/deadman
|
cd $HOME/deadman
|
||||||
|
|
||||||
postPatch='../dead.patch'
|
postPatch='dead.patch'
|
||||||
pageName='content/pages/dead.md'
|
pageName='content/pages/dead.md'
|
||||||
currDate=$(date '+%Y-%m-%d')
|
currDate=$(date '+%Y-%m-%d')
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
template:
|
template:
|
||||||
src: templates/blog/updateBlog
|
src: templates/blog/updateBlog
|
||||||
dest: /usr/local/bin/updateBlog
|
dest: /usr/local/bin/updateBlog
|
||||||
mode: u+rwx
|
mode: u+rx
|
||||||
|
|
||||||
# Rebuild blog every hour
|
# Rebuild blog every hour
|
||||||
- name: Setup blog cron job
|
- name: Setup blog cron job
|
||||||
|
@ -8,19 +8,19 @@
|
|||||||
copy:
|
copy:
|
||||||
src: static/blog/deadswitch
|
src: static/blog/deadswitch
|
||||||
dest: /usr/local/bin/deadswitch
|
dest: /usr/local/bin/deadswitch
|
||||||
mode: u+rwx
|
mode: u+rx
|
||||||
|
|
||||||
- name: Install imdead.sh
|
- name: Install imdead.sh
|
||||||
copy:
|
copy:
|
||||||
src: static/blog/imdead.sh
|
src: static/blog/imdead.sh
|
||||||
dest: /root/deadman/imdead.sh
|
dest: /root/deadman/imdead.sh
|
||||||
mode: u+rwx
|
mode: u+rx
|
||||||
|
|
||||||
- name: Copy dead patch
|
- name: Copy dead patch
|
||||||
copy:
|
copy:
|
||||||
src: secrets/dead.patch
|
src: secrets/dead.patch
|
||||||
dest: /root/deadman/dead.patch
|
dest: /root/deadman/dead.patch
|
||||||
mode: u+rwx
|
mode: u+rw
|
||||||
|
|
||||||
- name: Install deadtrigger
|
- name: Install deadtrigger
|
||||||
file:
|
file:
|
||||||
|
Loading…
Reference in New Issue
Block a user