This repository contains Ansible playbooks and scripts for automating various system administration tasks. Our goal is to simplify the process of setting up and maintaining consistent environments across multiple machines.
Before using these playbooks, ensure you have:
- Basic understanding of Ansible and YAML
- SSH access to target machines (for remote execution)
- Sudo privileges on target machines
To quickly set up Nix and Ansible on your system, use this one-liner:
curl -sSL https://raw.githubusercontent.com/reloadlife/ansible/main/nix_ansible.sh | bash
This command downloads and executes our setup script, which installs Nix and Ansible. Always review the script content before running it on your system.
Here's a list of available playbooks and their purposes:
- Purpose: Installs and configures WireGuard VPN
- Supported OS: Ubuntu, Debian, CentOS, RHEL, Fedora
- Usage:
ansible-playbook wg.yml
- One-liner:
ansible-playbook -b https://raw.githubusercontent.com/reloadlife/ansible/main/wg.yml
- Purpose: Installs Docker and sets up basic configurations
- Supported OS: Ubuntu, Debian, CentOS, RHEL, Fedora, macOS
- Usage:
ansible-playbook docker.yml
- One-liner:
ansible-playbook -b https://raw.githubusercontent.com/reloadlife/ansible/main/docker.yml
- REQUIREMENT: Download the template file:
curl https://raw.githubusercontent.com/reloadlife/ansible/main/wg-dashboard.ini.j2 -o ~/.ansible/templates/wg-dashboard.ini.j2
- Purpose: Installs WireGuard Dashboard
- Supported OS: Ubuntu, Debian, CentOS, RHEL, Fedora, macOS
- Usage:
ansible-playbook wg_dashboard.yml
- One-liner:
ansible-playbook -b https://raw.githubusercontent.com/reloadlife/ansible/main/wg_dashboard.yml
- REQUIREMENT: Download the template file:
curl https://raw.githubusercontent.com/reloadlife/ansible/main/wg-dashboard.ini.j2 -o ~/.ansible/templates/wg-dashboard.ini.j2
- Purpose: Installs WireGuard Dashboard bundled with WireGuard
- Supported OS: Ubuntu, Debian, CentOS, RHEL, Fedora, macOS
- Usage:
ansible-playbook wg_dashboard_with_wg.yml
- One-liner:
ansible-playbook -b https://raw.githubusercontent.com/reloadlife/ansible/main/wg_dashboard_with_wg.yml
- Example with custom port:
ansible-playbook -b -e "{'dashboard_port':9090}" https://raw.githubusercontent.com/reloadlife/ansible/main/wg_dashboard_with_wg.yml
- Purpose: Sets up a UDP2RAW ICMP tunnel over a 4to6 tunnel between two servers
- Supported OS: Ubuntu, Debian (may work on other Linux distributions with minimal modifications)
- Usage:
ansible-playbook udp2raw_tunnel.yml
- One-liner:
ansible-playbook -i inventory.ini udp2raw_tunnel.yml
- Example with custom IPs:
ansible-playbook -i inventory.ini udp2raw_tunnel.yml -e "server1_ipv4=3.3.3.3 server2_ipv4=4.4.4.4"
- Purpose: Installs Xray using Docker
- Supported OS: Ubuntu, Debian (may work on other Linux distributions with minimal modifications)
- Usage:
ansible-playbook xray.yml
- One-liner:
ansible-playbook -b https://raw.githubusercontent.com/reloadlife/ansible/main/xray.yml
- Requirements:
- Docker installation (the playbook will install Docker if not present)
xray_config.json.j2
template file in thetemplates
directory
- Customization: You can modify the following variables in the playbook:
xray_config_path
: Path to store Xray configuration (default: "/etc/xray")xray_port
: Port on which Xray will listen (default: 10808)xray_image
: Docker image for Xray (default: "teddysun/xray:latest")
- Create an inventory file named
inventory.ini
in the project root. - Add your target hosts:
[servers] server1 ansible_host=192.168.1.10 server2 ansible_host=192.168.1.11
- If you're only managing your local machine, you can skip this step.
To run a playbook on your inventory:
ansible-playbook -i inventory.ini <playbook_name>.yml
For example, to install Docker:
ansible-playbook -i inventory.ini docker.yml
You can also run these playbooks directly without cloning the repository:
# Install WireGuard
ansible-playbook -i "localhost," -c local -b https://raw.githubusercontent.com/reloadlife/ansible/main/wg.yml
# Install Docker
ansible-playbook -i "localhost," -c local -b https://raw.githubusercontent.com/reloadlife/ansible/main/docker.yml
# Set up UDP2RAW tunnel
ansible-playbook -i inventory.ini https://raw.githubusercontent.com/reloadlife/ansible/main/udp2raw_tunnel.yml
# Install Xray using Docker
ansible-playbook -i "localhost," -c local -b https://raw.githubusercontent.com/reloadlife/ansible/main/install_xray_docker.yml
We welcome contributions! Here's how you can contribute:
- Fork the repository
- Create a new branch for your feature
- Commit your changes
- Push to the branch
- Create a new Pull Request
When adding a new playbook:
- Create your playbook (e.g.,
new_feature.yml
) - Update this README following the template in the Available Playbooks section
- Test your playbook thoroughly
- Submit a pull request with your changes
If you encounter any issues or have questions:
- Check the existing issues in the repository
- If your issue isn't already listed, create a new issue with a detailed description
Remember to always review playbooks and scripts before running them, especially from public repositories. Test in a safe environment before applying to production systems.