79 lines
1.7 KiB
YAML
79 lines
1.7 KiB
YAML
---
|
|
- name: Build Consul cluster
|
|
hosts: consul_instances
|
|
any_errors_fatal: true
|
|
become: true
|
|
|
|
roles:
|
|
- name: ansible-consul
|
|
consul_version: "1.11.3"
|
|
consul_install_remotely: true
|
|
consul_install_upgrade: true
|
|
consul_architecture_map:
|
|
x86_64: amd64
|
|
armhfv6: arm
|
|
armv7l: arm
|
|
|
|
# consul_tls_enable: true
|
|
consul_connect_enabled: true
|
|
consul_ports_grpc: 8502
|
|
consul_client_address: "0.0.0.0"
|
|
|
|
tasks:
|
|
- name: Start Consul
|
|
systemd:
|
|
state: started
|
|
name: consul
|
|
|
|
- name: Add values
|
|
block:
|
|
- name: Install pip
|
|
pip:
|
|
name: python-consul
|
|
|
|
- name: Add a value to Consul
|
|
consul_kv:
|
|
key: ansible_test
|
|
value: Hello from Ansible!
|
|
run_once: true
|
|
|
|
- name: Build Nomad cluster
|
|
hosts: nomad_instances
|
|
any_errors_fatal: true
|
|
become: true
|
|
|
|
roles:
|
|
- name: ansible-nomad
|
|
nomad_version: "1.2.6"
|
|
nomad_install_remotely: true
|
|
nomad_install_upgrade: true
|
|
nomad_allow_purge_config: true
|
|
|
|
nomad_encrypt_enable: true
|
|
# nomad_use_consul: true
|
|
|
|
nomad_cni_enable: true
|
|
nomad_cni_version: 1.0.1
|
|
nomad_docker_enable: true
|
|
nomad_docker_dmsetup: false
|
|
|
|
nomad_bind_address: 0.0.0.0
|
|
nomad_architecture_map:
|
|
x86_64: amd64
|
|
armhfv6: arm
|
|
armv7l: arm
|
|
|
|
nomad_host_networks:
|
|
- name: nomad-bridge
|
|
# cidr: 172.26.64.0/20
|
|
interface: nomad
|
|
reserved_ports: "22"
|
|
- name: loopback
|
|
interface: lo
|
|
reserved_ports: "22"
|
|
tasks:
|
|
- name: Start Nomad
|
|
systemd:
|
|
state: started
|
|
name: nomad
|