initial setup

This commit is contained in:
Expand 2023-12-30 13:09:37 +11:00
parent 3f521b541c
commit dfb6ed5f44
4 changed files with 75 additions and 0 deletions

31
README.md Normal file
View file

@ -0,0 +1,31 @@
# cpanel-reconfigure
install ansible on a linux machine(literally any with an internet connection)
your package manager will probably have a version
apt install ansible
yum install ansible
dnf install ansible
pacman -Syy ansible
zypper in ansible
if not follow this guide to install with pip
https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html
```git clone https://github.com/Expand-sys/cpanel-reconfigure```
```cd cpanel-reconfigure```
Edit `inventory` to be the ipaddress of your cpanel server or 127.0.0.1 iof running locally
Edit `vars/default.yml` to have your chosen domain name and your email for ssl certs
```ansible-playbook -i inventory main.ansible.yml -k```
The requested password is the root password of the machine you are connecting to.

6
inventory Normal file
View file

@ -0,0 +1,6 @@
pihole:
hosts:
127.0.0.1: #change me to your caddy servers ip address or hostname
vars:
ansible_ssh_user: root #changing this will require changes to the playbook, currently the playbook must be run as root.
ansible_ssh_common_args: '-o StrictHostKeyChecking=no' #This stops hostkey checking useful if like me you destroy vms and build new ones all the time

20
main.ansible.yml Normal file
View file

@ -0,0 +1,20 @@
---
- name: install and configure pihole and dns over tls
hosts: pihole
vars:
become: false
pre_tasks:
- name: Load variables
ansible.builtin.include_vars: '{{ item }}'
with_first_found:
- "vars/default.yml"
tasks:
- name: install required dependencies
ansible.builtin.apt:
pkg:
- python3
- python3-pip
- libaugeas0
- nginx
- libnginx-mod-stream
state: present

18
vars/default.yml Normal file
View file

@ -0,0 +1,18 @@
---
ADDR: 192.0.2.0 #Required
ADDR6:
TTL: 14400
CONTACTPAGER: user@examplesms.com
CONTACTEMAIL: user@example.com
HOMEMATCH: home
HOMEDIR: /home #Required
LOGSTYLE: combined #required
NSTTL: 86400
NS: ns1.domain.tld #Required
NS2: ns2.domain.tld #Required
NS3:
NS4:
ETHDEV: eth0
HOST:
DEFMOD: jupiter #Required
SCRIPTALIAS: y #Required