Skip to content

Adding new servers to the inventory

Newly created servers have to be defined in the playbook-infrastructure-company below the inventory/ directory.


First add the new servers to the inventory/hosts file:

  • For a new server cus-www-prod-lb-1 create a group cus_www_prod_lb
  • Get the public IP from the cloud providers WebUI and set it with nic_pub_ip
  • Look at the nic_wg_mesh_ip variable assigned to the other hosts and assign the next higher free IP
  • Group cus_www_prod_lb and cus_www_prod_web into the group cus_www_prod

Example inventory/hosts entry:

cus-www-prod-lb-1 nic_wg_mesh_ip= nic_pub_ip=
cus-www-prod-web-1 nic_wg_mesh_ip= nic_pub_ip=



Variables can be assigned to groups or individual servers:

  • inventory/group_vars/cus_www_prod.yml contains variables for all servers in the group cus_www_prod
  • inventory/host_vars/cus-www-prod-lb-1.yml contains variables for the server cus-www-prod-lb-1

This is to enhance the oversight and have most all inventory variables in one directory inventory/group_vars/, it is Blunix Stack default to create a group for each logical group of instances even if there is only once instance:

cus-www-prod-lb-1 nic_wg_mesh_ip= nic_pub_ip=

There is only one loadbalancer, yet we still create a group cus_www_prod_lb.

New server variables

The following variables are most commonly defined for new servers:

  • wg_mesh_aliases
  • borgbackup_client_hooks
  • letsencypt_
  • partition_disks
  • shorewall_rules_custom
  • mailrelay_opensmtpd
  • ssh_users

It is good practice to look at the other files inside inventory/group_vars/*yml for "inspiration" of what needs to defined.

Variable precedence

If the same variable is defined in multiple places, Ansible will complain (warning) during execution and take precedence in a specific order.