Repository files navigation
Project Structure & Module Organization
playbooks/setup-openvpn.yml: Main Ansible playbook to provision OpenVPN, firewall, and client configs.
inventory.yml: Hosts and SSH user; uses env var SERVER_IP.
playbooks/tasks/: Ancillary task files (e.g., build_client.yml).
playbooks/templates/: Jinja2 templates (server.conf.j2, client.ovpn.j2, etc.).
init.sh: Helper to copy your SSH key to the target.
.env: Optional place to store IPs (not committed).
Build, Test, and Development Commands
Set target and copy SSH key:
export SERVER_IP=203.0.113.10 && ./init.sh
Dry-run (no changes) with diff:
ansible-playbook -i inventory.yml playbooks/setup-openvpn.yml --check --diff
Apply changes:
ansible-playbook -i inventory.yml playbooks/setup-openvpn.yml
Or set inline for one run: SERVER_IP=203.0.113.10 ansible-playbook -i inventory.yml playbooks/setup-openvpn.yml
Typical edits: update openvpn_users in the playbook; adjust templates in *.j2.
Coding Style & Naming Conventions
YAML: 2-space indentation, lowercase keys, descriptive task names.
Jinja2: {{ variable }} with clear variable names; templates end with .j2.
Files: tasks in playbooks/tasks/*.yml; templates in playbooks/templates/*.j2; generated clients as clients/<user>.ovpn.
Use --check and --diff for safe previews.
Prefer testing on a disposable VPS first.
Validate connectivity before runs: ansible all -i inventory.yml -m ping.
Optional: run ansible-lint if available in your environment.
Commit & Pull Request Guidelines
Commits: imperative mood, concise scope, e.g., playbook: add multi-user client build.
PRs: include purpose, notable changes, how to validate (commands/run output), and any risk/rollback notes.
Link related issues and include sample ansible-playbook output when relevant.
Security & Configuration Tips
Do not commit secrets or client files (clients/ is already gitignored).
Restrict SSH access; use ./init.sh to install keys.
Keep ansible_user least-privileged where possible; become: yes is used for tasks.
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
You can’t perform that action at this time.