Ansible playbook for preparing a server with cPanel, CloudLinux, CageFS, MySQL Governor, and Imunify360.
The main playbook in site.yml runs these roles in order:
cloudlinux- converts and configures the host for CloudLinux, installs base packages, and verifies the kernel and license.cpanel- installs cPanel, sets the hostname, and configures AutoSSL behavior.cagefs- installs and enables CageFS for all users.mysql_governor- installs and configures MySQL Governor.imunify360- installs Imunify360 and opens the required firewall ports.
- Linux server with a RedHat-family distribution
- Ansible installed on the control machine or local host
- Root or sudo access on the target host
- Valid CloudLinux, and Imunify360 license are needed
Currently set to run towards localhost, If you want to run against another server, then just replace localhost with the targeted host.
[cPanel]
localhost ansible_connection=localMost variables can be found in group_vars/main.yml. Make sure to look trough this file if you need or want to add variables.
Secrets and license material should stay in secret.yml and be encrypted with Ansible Vault.
Create or edit the vault file with:
ansible-vault edit secret.ymlThe vault password can be sotred inside of a .vault.yml
Syntax check:
ansible-playbook -i inventory.ini --syntax-check site.ymlRun the playbook:
ansible-playbook -i inventory.ini site.yml