ansible_role_consul_config

ansible role to configure consul

MIT License

Stars
1

ansible_role_consul_config

ansible role to configure consul

https://galaxy.ansible.com/suzuki-shunsuke/consul_config

This role doesn't install consul. If you want to install, please use akoi and suzuki-shunsuke.akoi.

packages:
  consul:
    url: "https://releases.hashicorp.com/consul/{{.Version}}/consul_{{.Version}}_linux_amd64.zip"
    version: 1.2.1
    files:
    - name: consul
      archive: consul

Directory Structure

  • user: consul_user default:consul
  • group: consul_group default:consul
data_dir/ default:/opt/consul
consul_pid_file default:/var/run/consul/consul.pid
consul_config_file default:/etc/consul/consul.json
consul_configd_path/ default:/etc/consul/consul.d/
  service.json
consul_service_unit_file default:/etc/systemd/system/consul.service

Requirements

Nothing.

Role Variables

Required variables are nothing. Please see

Handlers

restart consul

If consul_use_systemd is true, systemd's service is restarted.

You can define custom handlers. For example, if you manage consul with supervisor,

handlers:
- name: restart consul (supervisor)
  supervisorctl:
    name: consul
    state: restarted
  listen: restart consul

Example Playbook

- hosts: servers
  roles:
  - role: suzuki-shunsuke.consul_config
    consul_path: /usr/local/bin/consul
    consul_config_files:
      web:
        service:
          name: web
          tags:
          - rails
          port: 80
    become: yes

Change Log

See CHANGELOG.md.

Contributing

See CONTRIBUTING.md.

License

MIT