Use 'become' for haproxy service state setting

Due to the use of delegation to localhost in this task,
we also need to set 'become' otherwise the task does not
have access to the socket because it's executed as the
user running the playbook (zuul).

Change-Id: I3da65d9ecdf0a91104b6253466fae80dda01b25f
This commit is contained in:
Jesse Pretorius 2018-07-11 10:11:19 +01:00
parent ee65c9f381
commit 3e1a35e3ca

View File

@ -26,5 +26,11 @@
weight: "{{ haproxy_weight | default(omit) }}"
delegate_to: "{{ item }}"
with_items: "{{ groups['haproxy'] }}"
# Due to the use of delegation to localhost
# in this task, we also need to set 'become'
# otherwise the task does not have access to
# the socket because it's executed as the
# user running the playbook (zuul).
become: yes
tags:
- common-haproxy