Added dead switch

This commit is contained in:
2022-05-30 23:36:55 -05:00
parent e795959672
commit 201d17efaa
12 changed files with 88 additions and 18 deletions

View File

@@ -1,15 +1,9 @@
---
- name: Clone blog repository
git:
repo: "https://github.com/CPunch/openpunk.git"
dest: "/var/www/{{ domain }}"
- name: Setup git config
copy:
src: templates/.gitconfig
dest: /root/.gitconfig
owner: root
mode: u=rw,g=,o=
- name: Build blog
command:
cmd: hugo

View File

@@ -0,0 +1,34 @@
---
- name: Create deadman directory
file:
name: /root/deadman
state: directory
- name: Install deadswitch script
copy:
src: templates/blog/deadswitch
dest: /usr/local/bin/deadswitch
mode: u+rwx
- name: Install imdead.sh
copy:
src: templates/blog/imdead.sh
dest: /root/deadman/imdead.sh
mode: u+rwx
- name: Copy dead message
template:
src: secrets/dead.md
dest: /root/deadman/dead.md
- name: Install deadlock, disabling the deadswitch
file:
name: /root/.deadlock
state: touch
- name: Install deadlock cronjob
cron:
name: Run deadswitch
minute: 0
hour: 1
job: /usr/local/bin/deadswitch

View File

@@ -32,7 +32,12 @@
shell: chsh -s /usr/bin/zsh
- name: Clone Powerlevel10k theme
shell: git clone --depth=1 https://github.com/romkatv/powerlevel10k.git /root/powerlevel10k
git:
repo: "https://github.com/romkatv/powerlevel10k.git"
dest: "/root/powerlevel10k"
depth: 1
- name: Install Powerlevel10k theme
shell: echo 'source /root/powerlevel10k/powerlevel10k.zsh-theme' > /root/.zshrc
- name: Install .zshrc
copy:
src: templates/.zshrc
dest: /root/.zshrc

26
tasks/git.yml Normal file
View File

@@ -0,0 +1,26 @@
---
- name: Setup git config
copy:
src: templates/.gitconfig
dest: /root/.gitconfig
owner: root
mode: u=rw,g=,o=
- name: Scan for SSH host keys.
local_action:
module: shell
cmd: ssh-keyscan git.{{ domain }} 2>/dev/null
changed_when: False
register: ssh_scan
- name: Update known_hosts.
local_action:
module: known_hosts
key: "{{ item }}"
name: git.{{ domain }}
with_items: "{{ ssh_scan.stdout_lines }}"
- name: Install ssh keys
clone:
src: secrets/id_ed25519
dest: /root/.ssh/id_ed25519

View File

@@ -1,3 +1,4 @@
---
- name: Configure Gitea
template:
src: templates/gitea/app.ini

View File

@@ -1,3 +1,4 @@
---
- name: Remove default nginx config
file:
name: /etc/nginx/sites-enabled

View File

@@ -1,3 +1,4 @@
---
- name: Install torrc
template:
src: templates/tor/torrc