Created
December 17, 2020 09:35
-
-
Save cankush625/6ff35f0339e31cb1aa4617ffb4a81cf7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: localhost | |
vars: | |
- loadbalancer_port: 8080 | |
tasks: | |
- name: Install HAProxy Software | |
package: | |
name: "haproxy" | |
state: present | |
register: haproxyinstall | |
- name: haproxy config | |
template: | |
dest: "/etc/haproxy/haproxy.cfg" | |
src: "/home/cankush/AnsibleAutomation-RH294/configureLoadBalancerHAProxy/haproxy.cfg.j2" | |
when: haproxyinstall.rc == 0 | |
notify: haproxy restart | |
- name: start haproxy services | |
service: | |
name: "haproxy" | |
state: started | |
handlers: | |
- name: haproxy restart | |
service: | |
name: "haproxy" | |
state: restarted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment