entercloudsuite.haproxy

Ansible Role: HAProxy

Build Status Galaxy

NOTE: Development of ansible-haproxy is now active on https://github.com/automium/ansible-haproxy

This role installs HAProxy on Ubuntu 16.04 (Xenial).

Requirements

You need Ansible version 2.4 or higher to use this role.

Role Variables

Most variables for the role are defined in defaults/main.yml.

Example Playbook

To run with default variables:

- hosts: all
  roles:
    - role: entercloudsuite.haproxy
      haproxy_user: haproxyuser
      haproxy_pass: haproxypass
      haproxy_conf: |
        listen web
            mode http
            bind *:80
            default-server port 80
            server web-0 1.1.1.1:80 check

Testing

Testing is done with Molecule.

You can install Molecule or use docker-compose run --rm molecule to run it in a local Docker container from the entercloudsuite/molecule project.

  1. Run molecule create to start the Docker container on your local machine.
  2. Log into the running container with molecule login.
  3. Edit the role files as needed.
  4. Add any external required roles in the molecule/default/requirements.yml file.
  5. Modify the molecule/default/playbook.yml as necessary.
  6. Create tests in the molecule/default/tests folder using the goos verifier.
  7. When everything is set, run molecule converge to execute the Ansible Playbook and molecule verify to run the tests.
    Note: The converge process will check the syntax of the role.
  8. To remove the Docker container, use molecule destroy.

To run all these steps in one command, just use molecule test.

If you want to run the role on a VM, use the playbook_deploy.yml file like this: ansible-playbook ansible-haproxy/molecule/default/playbook_deploy.yml -i VM_IP_OR_FQDN, -u ubuntu --private-key private.pem.

License

This project is licensed under MIT.

Informazioni sul progetto

Playbook for HAProxy.

Installa
ansible-galaxy install entercloudsuite.haproxy
Licenza
mit
Download
171.8k
Proprietario