ansible-community / ansible-nomad

:watch: Ansible role for Nomad
https://galaxy.ansible.com/brianshumate/nomad
BSD 2-Clause "Simplified" License
297 stars 165 forks source link

Question: How feasible would it be to use this role to deploy a Nomad server and a Nomad client on the same machine? #140

Closed awarner-greshamtech closed 1 year ago

awarner-greshamtech commented 3 years ago

Hello,

I am wondering how feasible it would be to use this role to deploy a Nomad server and a Nomad client on the same machine?

We are currently using ansible-nomad (and ansible-vault and ansible-consul) quite happily across a cluster of 3 VMs running Nomad/Consul severs, 3 VMs running Vault servers, and several VMs running Nomad/Consul clients.

We are experimenting with running Nomad (and Consul) clients on the server VMs. We appreciate this is against HashiCorp's advice, in general, but it's something of a trade-off. It will allow us to deploy a minimum of docker containers on the server nodes such as log collectors.

I am experimenting now but wondering if the authors had any insights as to whether the system services etc. set-up by the role would allow a server and client to co-exist? In-particular I am wondering whether the system service for server and client would clash? https://github.com/ansible-community/ansible-nomad/blob/6182a5bb80468335e1752d9a78263be5ccfd8600/tasks/main.yml#L186

Any help in understanding whether this is feasible, or if not what might clash so we could consider adding some properties to make things configurable, would be appreciated.

lanefu commented 2 years ago

@awarner-greshamtech

there is the nomad_node_role: both setting which would be a single instance of the nomad agent, but supports being both a server and client.