automium.haproxy

Ansible Role: HAProxy

Build Status
Galaxy

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 this role are set in the file defaults/main.yml.

Example Playbook

To use the default variables, your playbook should look like this:

- hosts: all
  roles:
    - role: automium.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

You can test the role using Molecule.

To get started, you can install Molecule or run docker-compose run --rm molecule to create a local Docker container from the enterclousuite/molecule project.

Here’s how to test your role:

  1. Run molecule create to create a Docker container for testing.
  2. Use molecule login to access the running container.
  3. Make changes to the role files as needed.
  4. If you need other roles, add them in the molecule/default/requirements.yml file.
  5. Modify the molecule/default/playbook.yml as required.
  6. Create infrastructure tests in the molecule/default/tests folder using the goos verifier.
  7. When ready, run molecule converge to apply the playbook and molecule verify to check your tests. The converge process will also check the syntax of the role.
  8. To remove the Docker container, use molecule destroy.

To run all steps in one command, simply execute molecule test.

If you want to run the role on a virtual machine, use the playbook_deploy.yml file with a command like this:

ansible-playbook ansible-haproxy/molecule/default/playbook_deploy.yml -i VM_IP_OR_FQDN, -u ubuntu --private-key private.pem

License

MIT

Informazioni sul progetto

Role for deploying HAProxy

Installa
ansible-galaxy install automium.haproxy
Licenza
mit
Download
2k
Proprietario
Portable services for scalable and resilient infrastructures