mirror of
https://github.com/CPunch/openpunk-ansible.git
synced 2024-11-22 07:20:05 +00:00
Compare commits
No commits in common. "e8fe024b770f554ec37522f1136f08255a66f71e" and "5cdc63e35a6e9b1f3f405c6670401ff6e89d919b" have entirely different histories.
e8fe024b77
...
5cdc63e35a
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,17 @@
|
||||
---
|
||||
# TODO: make idempotent
|
||||
- name: Add Gitea repo key
|
||||
shell: curl -s https://packaging.gitlab.io/gitea/gpg.key | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/morph027-gitea.gpg --import
|
||||
|
||||
# TODO: make idempotent
|
||||
- name: Set key perms
|
||||
shell: sudo chmod 644 /etc/apt/trusted.gpg.d/morph027-gitea.gpg
|
||||
|
||||
- name: Add Gitea repo
|
||||
apt_repository:
|
||||
filename: morph027-gitea
|
||||
repo: deb https://packaging.gitlab.io/gitea gitea main
|
||||
|
||||
- name: Upgrade Packages
|
||||
apt:
|
||||
update_cache: yes
|
||||
@ -8,6 +21,7 @@
|
||||
package:
|
||||
name:
|
||||
- hugo
|
||||
- gitea
|
||||
- git
|
||||
- nginx
|
||||
- tor
|
||||
@ -18,10 +32,9 @@
|
||||
- zsh # :D
|
||||
- python3-certbot-nginx
|
||||
|
||||
- name: Setup zsh
|
||||
user:
|
||||
name: "{{ ansible_user }}"
|
||||
shell: /usr/bin/zsh
|
||||
# TODO: make idempotent
|
||||
- name: Setup default shell (zsh)
|
||||
shell: chsh -s /usr/bin/zsh
|
||||
|
||||
- name: Clone Powerlevel10k theme
|
||||
git:
|
||||
|
@ -9,22 +9,21 @@
|
||||
# make sure our vps trusts the github.com key signature. we pipe the output
|
||||
# of ssh-keyscan into .ssh/known_hosts
|
||||
|
||||
# TODO: make idempotent
|
||||
- name: Scan for SSH host keys
|
||||
command: ssh-keyscan github.com 2>/dev/null
|
||||
register: ssh_scan
|
||||
changed_when: false
|
||||
|
||||
- name: Update .ssh/known_hosts
|
||||
blockinfile:
|
||||
path: /root/.ssh/known_hosts
|
||||
block: "{{ ssh_scan.stdout_lines|join('\n') }}"
|
||||
insertbefore: BOF
|
||||
create: yes
|
||||
- name: Update known_hosts
|
||||
copy:
|
||||
content: "{{ ssh_scan.stdout_lines|join('\n') }}"
|
||||
dest: /root/.ssh/known_hosts
|
||||
owner: root
|
||||
mode: u=rw,g=,o=
|
||||
force: no # if we already have a known_hosts file, ignore!
|
||||
|
||||
# this keypair is trusted under my github account, so it allows my vps to make pushes
|
||||
# to the main branch of my openpunk repository. (see roles/deadswitchfiles/imdead.sh)
|
||||
# to the main branch of my openpunk repository. (for my deadswitch: see static/blog/imdead.sh)
|
||||
|
||||
- name: Install ssh priv key
|
||||
copy:
|
||||
|
@ -1,34 +1,7 @@
|
||||
---
|
||||
- name: Check if Gitea is installed
|
||||
shell: gitea --version
|
||||
register: validate_gitea
|
||||
changed_when: no
|
||||
|
||||
- name: Add Gitea key && repository
|
||||
block:
|
||||
- name: Check for Gitea gpg key
|
||||
stat:
|
||||
path: /etc/apt/trusted.gpg.d/morph027-gitea.gpg
|
||||
register: gitea_key
|
||||
|
||||
- name: Import Gitea key
|
||||
shell: curl -s https://packaging.gitlab.io/gitea/gpg.key | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/morph027-gitea.gpg --import && sudo chmod 644 /etc/apt/trusted.gpg.d/morph027-gitea.gpg
|
||||
when: gitea_key.stat.exists == false or gitea_key.stat.mode != "0644"
|
||||
|
||||
- name: Add Gitea repository
|
||||
apt_repository:
|
||||
filename: morph027-gitea
|
||||
repo: deb https://packaging.gitlab.io/gitea gitea main
|
||||
when: '"not found" in validate_gitea.stdout'
|
||||
|
||||
- name: Install Gitea
|
||||
package:
|
||||
name:
|
||||
- gitea
|
||||
|
||||
- name: Configure Gitea
|
||||
template:
|
||||
src: templates/app.ini
|
||||
src: app.ini
|
||||
dest: /etc/gitea/app.ini
|
||||
owner: gitea
|
||||
force: no # we don't want to kill our existing config D:
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
- name: Install torrc
|
||||
template:
|
||||
src: templates/torrc
|
||||
src: torrc
|
||||
dest: /etc/tor/torrc
|
||||
owner: root
|
||||
group: root
|
||||
|
Loading…
Reference in New Issue
Block a user