Ansible playbook to deploy NGINX conf (redirects and/or reverse proxy) with a Let's Encrypt Cert
Currently tested on Linode with Linode DNS
This provides a repeatable way to create a NGINX server with certs and conf, quickly.
This is only tested on Ubuntu 24.04.
ssh into server as root
apt update
apt upgrade -y
apt autoremove -y
apt autoclean -y
apt clean -y
snap refresh
rebootIn the podverse-ansible dir
python3 -m venv venv-ansible
source venv-ansible/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install ansible
python3 -m pip install ansible-lintIn the podverse-ansible dir
source venv-ansible/bin/activateThen run ansible commands.
nix developbash ./setup-ansible.shansible-galaxy collection install community.cryptoThe file sets up the inventory of the various servers
Should look similar to the example of hosts
Create strong password file at ~/.ansible/pv-vault-pass
EDITOR=vim ansible-vault create group_vars/all/vault.yml
Add Linode Secret
linode_api_key: your_actual_api_key_here
or
Add Digital Ocean secret
digitalocean_api_key: your_actual_api_key_here
EDITOR=vim ansible-vault edit group_vars/all/vault.yml
pyansible-playbook playbook-CUR3direct.yaml