# haproxy nbproc and cpu-map config help

**URL:** <https://forum.ansible.com/t/haproxy-nbproc-and-cpu-map-config-help/19009>\
**Category:** Ansible Project\
**Created:** [August 13, 2015, 11:49am UTC](https://forum.ansible.com/t/haproxy-nbproc-and-cpu-map-config-help/19009 "2015-08-13T11:49:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolas\_G](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Nicolas\_G](https://forum.ansible.com/u/Nicolas_G)\
**Post date:** [August 13, 2015, 11:49am UTC](https://forum.ansible.com/t/haproxy-nbproc-and-cpu-map-config-help/19009/1 "2015-08-13T11:49:20Z")

</div>

Hi All,

I’m trying to deploy with Ansible an haproxy.cfg config that will automatically render to the bellow :

#/etc/haproxy.cfg  
“”"

nbproc 11

cpu-map 1 0  
cpu-map 2 1  
cpu-map 3 2  
cpu-map 4 3  
cpu-map 5 4  
cpu-map 6 5  
cpu-map 7 6  
cpu-map 8 7  
cpu-map 9 8  
cpu-map 10 9  
cpu-map 11 10

“”"

This will use all system CPU cores but leave 1 free to the operating system. I know I can use ansible\_processor\_vcpus  
fact to get the number of cores but I’m having trouble regarding the logic of the “cpu-map” lines…

Any ideas ?

Regards,  
N.
