Skip to content

Instantly share code, notes, and snippets.

@cankush625
Created October 8, 2020 06:48
Show Gist options
  • Select an option

  • Save cankush625/314d77587593d8957a5a1cfa80848e7a to your computer and use it in GitHub Desktop.

Select an option

Save cankush625/314d77587593d8957a5a1cfa80848e7a to your computer and use it in GitHub Desktop.
---
# tasks file for haproxy
- name: install haproxy
package:
name: haproxy
state: present
register: haproxystate
- name: haproxy config
template:
dest: "/etc/haproxy/haproxy.cfg"
src: "templates/haproxy.cfg.j2"
when: haproxystate.rc == 0
notify: restart haproxy service
- name: start haproxy service
service:
name: haproxy
state: started
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment