Installing Ansible v2 with a clustered Automation Hub

Clustering your Automation Hub in AAPv2 can be an annoying process. The official documentation used to be spread out over a couple of different articles and documents but Red Hat has finally combined it into a single document. Now if they would just put it in the main install documentation instead of making you search for it somewhere else.

Before running your installer make sure your firewall is configured, removed, etc based on your security requirements. Then configure your inventory file with the list of Automation Hub servers, login information, and SSO if you plan to use it for Automation Hub. Also, be sure to configure your automationhub_main_url or it will default to the first node in the list.

Next lets set up the NFS mounts needed, but first make sure you have nfs-utils installed. You will need to create two NFS shares. The first is for /var/lib/pulp and the second is for /var/lib/pulp/pulpcore_static.

First, lets update fstab with our NFS shares. Open fstab in your favorite editor and add two lines.

srv_rhel8:/data /var/lib/pulp nfs defaults,_netdev,nosharecache 0 0
srv_rhel8:/data/pulpcore_static /var/lib/pulp/pulpcore_static nfs defaults,_netdev,nosharecache,context="system_u:object_r:httpd_sys_content_rw_t:s0" 0 0

Then just follow along with these commands to mount the shares.

mkdir /var/lib/pulp/

mount /var/lib/pulp

mkdir /var/lib/pulp/pulpcore_static

mount -a

Now, go run your installer. I’ll wait. Are you done yet? Good now that you have a successful install we need to do a few post install steps on Automation Hub. First stop the Pulp service

systemctl stop pulpcore.service

Next unmount pulpcore.static and pulp so we can update fstab.

umount /var/lib/pulp/pulpcore_static
umount /var/lib/pulp

Now open up fstab and edit the line for /var/lib/pulp to the below

srv_rhel8:/data /var/lib/pulp nfs defaults,_netdev,nosharecache,context="system_u:object_r:pulpcore_var_lib_t:s0" 0 0

Remount your drives.

mount -a

While the Pulp service is still stopped lets set the service to start after networking spins up.

systemctl edit pulpcore.service

Add the following entry to pulpcore.service

[Unit]
After=network.target var-lib-pulp.mount

Lastly enable remote.fs-target

systemctl enable remote-fs.target

And finally reboot your system. That’s all it takes to set up your clustered Automation Hub, Congrats!