mirror of
https://github.com/Expand-sys/cpanel-reconfigure
synced 2026-03-22 04:27:13 +11:00
initial setup
This commit is contained in:
parent
3f521b541c
commit
dfb6ed5f44
4 changed files with 75 additions and 0 deletions
31
README.md
Normal file
31
README.md
Normal 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
6
inventory
Normal 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
20
main.ansible.yml
Normal 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
18
vars/default.yml
Normal 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
|
||||||
Loading…
Reference in a new issue