I've rewritten my Ansible codebase to a more role-based approach.
The new repository can be found here.
Five main playbooks are defined:
This playbook renames all hosts according to a defined scheme in /etc/names
. It also renames ESXi machines along the way.
A writeup of this can be found here.
This playbook deploys a new ESXi VM with kickstart for a given ansible host. It also sets a Static DHCP mapping for pfSense!
Check this post for more info.
cockpit-deploy installs Redhat Cockpit and fetches a wildcard ssl certificate from a host defined in the inventory, in my case a pfSense box.
I wanted to make a new user for ansible to better guard privileged access. This playbook creates a new user on the host called ansible
and sets up sudo permission and ssh authentication for it.
This playbook automates the joining of my local Active Directory domain for RHEL and Ubuntu machines. It also enables login for AD users and sets up ssh pubkeys from AD.
- defines variable
scheme_name
- checks the hosts OS Family and runs the OS specific role if found
- depends on common
- defines vsphere credentials from env
- defines vault protected admin credentials for AD
- Define OS specific variables, such as location of binaries
- if Active Directory role is active, loads variables for required AD packages
Jinja2 templates used by the plays.
/etc/sudoers.d
template- Defines sudo permissions for AD groups based on hostname
/etc/hosts
template- all hosts in play are added as hosts with
scheme_name
- kickstart template for
vm-deploy
- should be customized for your needs
- Kerberos config file
- Configures the domain from variables defined in join-ad-linux.yml
- Strict
/etc/ssh/sshd_config
config file - Disables root login
- Disables password login
- Instructs to check authorized keys with
sss_ssh_authorizedkeys
- Templating for sftp location based on OS
- SSSD config file
- Configures the domain much same like the krb5.j2
- Instructs SSSD to get ssh pubkeys from altSecurityIdentities attribute
- pfSense DHCP Static Mapping Entry
- Used to add new DHCP Static Map to pfSense with ansible.builtin.xml
- Gets mac address from VMware ESXi