mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
213 lines
8.8 KiB
YAML
213 lines
8.8 KiB
YAML
---
|
|
ansible_os_family: unix
|
|
ansible_default_ipv4:
|
|
interface: eth0
|
|
ansible_eth0:
|
|
ipv4:
|
|
address: "1.1.1.1"
|
|
ansible_system: ubuntu
|
|
consul_raw_key: consul_raw_key
|
|
_consul_lan_servers:
|
|
- localhost
|
|
_consul_wan_servercount: 1
|
|
_consul_wan_servers:
|
|
- localhost
|
|
|
|
item:
|
|
config_version: bootstrap
|
|
|
|
## Core
|
|
consul_debug: false
|
|
is_virtualenv: "{{ lookup('env','VIRTUAL_ENV') | default('', true) }}"
|
|
|
|
### Package
|
|
consul_version: "{{ lookup('env','CONSUL_VERSION') | default('1.3.1', true) }}"
|
|
consul_architecture_map:
|
|
# this first entry seems redundant
|
|
# (but it's required for reasons)
|
|
amd64: amd64
|
|
x86_64: amd64
|
|
# todo: arm32 / armelv5
|
|
armv6l: armhfv6
|
|
armv7l: armhfv6
|
|
aarch64: arm64
|
|
32-bit: "386"
|
|
64-bit: amd64
|
|
consul_architecture: "{{ consul_architecture_map[ansible_architecture] }}"
|
|
consul_os: "\
|
|
{% if ansible_os_family == 'Windows' %}\
|
|
{{ 'windows' }}\
|
|
{% else %}\
|
|
{{ ansible_system | lower }}\
|
|
{% endif %}"
|
|
consul_pkg: "consul_{{ consul_version }}_{{ consul_os }}_{{ consul_architecture }}.zip"
|
|
consul_zip_url: "https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_{{ consul_os }}_{{ consul_architecture }}.zip"
|
|
consul_checksum_file_url: "https://releases.hashicorp.com/consul/{{ consul_version }}/consul_{{ consul_version }}_SHA256SUMS"
|
|
|
|
### Install Method
|
|
consul_install_remotely: false
|
|
consul_install_upgrade: false
|
|
|
|
### Paths
|
|
consul_bin_path: "/usr/local/bin"
|
|
consul_config_path: "/etc/consul"
|
|
consul_configd_path: "{{ consul_config_path }}/consul.d"
|
|
consul_bootstrap_state: "{{ consul_config_path }}/.consul_bootstrapped"
|
|
consul_data_path: "/var/consul"
|
|
consul_log_path: "/var/log/consul"
|
|
consul_run_path: "/var/run/consul"
|
|
consul_binary: "{{ consul_bin_path }}/consul"
|
|
|
|
### System user and group
|
|
consul_manage_user: true
|
|
consul_user: "consul"
|
|
consul_manage_group: true
|
|
consul_group: "bin"
|
|
|
|
### Consul settings
|
|
consul_datacenter: "{{ lookup('env','CONSUL_DATACENTER') | default('dc1', true) }}"
|
|
consul_domain: "{{ lookup('env','CONSUL_DOMAIN') | default('consul', true) }}"
|
|
consul_node_meta: {}
|
|
consul_log_level: "{{ lookup('env','CONSUL_LOG_LEVEL') | default('INFO', true) }}"
|
|
consul_syslog_enable: "{{ lookup('env','CONSUL_SYSLOG_ENABLE') | default(true, true) }}"
|
|
consul_syslog_facility: "{{ lookup('env','CONSUL_SYSLOG_FACILITY') | default('local0', true) }}"
|
|
consul_iface: "\
|
|
{% if ansible_os_family == 'Windows' %}\
|
|
{{ lookup('env','CONSUL_IFACE') | default(ansible_interfaces[0].interface_name, true) }}\
|
|
{% else %}\
|
|
{{ lookup('env','CONSUL_IFACE') | default(ansible_default_ipv4.interface, true) }}\
|
|
{% endif %}"
|
|
consul_node_role: "{{ lookup('env','CONSUL_NODE_ROLE') | default('client', true) }}"
|
|
consul_recursors: "{{ lookup('env','CONSUL_RECURSORS') | default('[]', true) }}"
|
|
consul_bootstrap_expect: "{{ lookup('env','CONSUL_BOOTSTRAP_EXPECT') | default(false, true) }}"
|
|
consul_ui: "{{ lookup('env', 'CONSUL_UI') | default(true, true) }}"
|
|
consul_disable_update_check: false
|
|
consul_enable_script_checks: false
|
|
consul_enable_local_script_checks: false
|
|
consul_raft_protocol: "\
|
|
{% if consul_version is version_compare('0.7.0', '<=') %}\
|
|
1\
|
|
{% else %}\
|
|
3\
|
|
{% endif %}"
|
|
consul_retry_join_skip_hosts: false
|
|
consul_retry_interval: "30s"
|
|
consul_retry_interval_wan: "30s"
|
|
consul_retry_max: 0
|
|
consul_retry_max_wan: 0
|
|
|
|
### Addresses
|
|
consul_bind_address: "\
|
|
{% if ansible_system == 'FreeBSD' %}\
|
|
{{ lookup('env','CONSUL_BIND_ADDRESS') | default(hostvars[inventory_hostname]['ansible_'+ consul_iface ]['ipv4'][0]['address'], true) }}\
|
|
{% elif ansible_os_family == 'Windows' %}\
|
|
{{ lookup('env','CONSUL_BIND_ADDRESS') | default(hostvars[inventory_hostname]['ansible_ip_addresses'][0], true) }}\
|
|
{% else %}\
|
|
{{ lookup('env','CONSUL_BIND_ADDRESS') | default(hostvars[inventory_hostname]['ansible_'+ consul_iface ]['ipv4']['address'], true) }}\
|
|
{% endif %}"
|
|
consul_advertise_address: "{{ consul_bind_address }}"
|
|
consul_advertise_address_wan: "{{ consul_bind_address }}"
|
|
consul_advertise_addresses:
|
|
serf_lan: "{{ consul_advertise_addresses_serf_lan | default(consul_advertise_address+':'+consul_ports.serf_lan) }}"
|
|
serf_wan: "{{ consul_advertise_addresses_serf_wan | default(consul_advertise_address_wan+':'+consul_ports.serf_wan) }}"
|
|
rpc: "{{ consul_advertise_addresses_rpc | default(consul_bind_address+':'+consul_ports.server) }}"
|
|
consul_client_address: '127.0.0.1'
|
|
consul_addresses:
|
|
dns: "{{ consul_addresses_dns | default(consul_client_address, true) }}"
|
|
http: "{{ consul_addresses_http | default(consul_client_address, true) }}"
|
|
https: "{{ consul_addresses_https | default(consul_client_address, true) }}"
|
|
rpc: "{{ consul_addresses_rpc | default(consul_client_address, true) }}"
|
|
grpc: "{{ consul_addresses_grpc | default(consul_client_address, true) }}"
|
|
|
|
### Ports
|
|
consul_ports:
|
|
dns: "{{ consul_ports_dns | default('8600', true) }}"
|
|
http: "{{ consul_ports_http | default('8500', true) }}"
|
|
https: "{{ consul_ports_https | default('-1', true) }}"
|
|
rpc: "{{ consul_ports_rpc | default('8400', true) }}"
|
|
serf_lan: "{{ consul_ports_serf_lan | default('8301', true) }}"
|
|
serf_wan: "{{ consul_ports_serf_wan | default('8302', true) }}"
|
|
server: "{{ consul_ports_server | default('8300', true) }}"
|
|
grpc: "{{ consul_ports_grpc | default('-1', true) }}"
|
|
|
|
### Servers
|
|
consul_group_name: "{{ lookup('env','CONSUL_GROUP_NAME') | default('consul_instances', true) }}"
|
|
consul_join: ["127.0.0.1"]
|
|
consul_join_wan: []
|
|
consul_servers: "\
|
|
{% set _consul_servers = [] %}\
|
|
{% for host in groups[consul_group_name] %}\
|
|
{% set _consul_node_role = hostvars[host]['consul_node_role'] | default('client', true) %}\
|
|
{% if ( _consul_node_role == 'server' or _consul_node_role == 'bootstrap') %}\
|
|
{% if _consul_servers.append(host) %}{% endif %}\
|
|
{% endif %}\
|
|
{% endfor %}\
|
|
{{ _consul_servers }}"
|
|
consul_gather_server_facts: false
|
|
|
|
## ACL
|
|
consul_acl_policy: false
|
|
|
|
### Shared ACL config ###
|
|
consul_acl_enable: "{{ lookup('env','CONSUL_ACL_ENABLE') | default(false, true) }}"
|
|
consul_acl_ttl: "{{ lookup('env','CONSUL_ACL_TTL') | default('30s', true) }}"
|
|
consul_acl_datacenter: "{{ lookup('env','CONSUL_ACL_DATACENTER') | default(consul_datacenter, true) }}"
|
|
consul_acl_down_policy: "{{ lookup('env','CONSUL_ACL_DOWN_POLICY') | default('extend-cache', true) }}"
|
|
consul_acl_token: "{{ lookup('env','CONSUL_ACL_TOKEN') | default('', true) }}"
|
|
consul_acl_agent_token: "{{ lookup('env','CONSUL_ACL_AGENT_TOKEN') | default('', true) }}"
|
|
consul_acl_agent_master_token: "{{ lookup('env','CONSUL_ACL_AGENT_MASTER_TOKEN') | default('', true) }}"
|
|
|
|
### Server ACL settings ###
|
|
consul_acl_default_policy: "{{ lookup('env','CONSUL_ACL_DEFAULT_POLICY') | default('allow', true) }}"
|
|
consul_acl_master_token: "{{ lookup('env','CONSUL_ACL_MASTER_TOKEN') | default('42424242-4242-4242-4242-424242424242', true) }}"
|
|
consul_acl_master_token_display: "{{ lookup('env','CONSUL_ACL_MASTER_TOKEN_DISPLAY') | default(false, true) }}"
|
|
consul_acl_replication_enable: "{{ lookup('env','CONSUL_ACL_REPLICATION_ENABLE') | default('',true) }}"
|
|
consul_acl_replication_token: "{{ lookup('env','CONSUL_ACL_REPLICATION_TOKEN') | default('', true) }}"
|
|
|
|
## gossip encryption
|
|
consul_encrypt_enable: "{{ lookup('env','CONSUL_ENCRYPT_ENABLE') | default(true, true) }}"
|
|
consul_encrypt_verify_incoming: true
|
|
consul_encrypt_verify_outgoing: true
|
|
consul_disable_keyring_file: "{{ lookup('env','CONSUL_DISABLE_KEYRING_FILE') | default(false, true) }}"
|
|
|
|
## TLS
|
|
consul_tls_enable: "{{ lookup('env','CONSUL_TLS_ENABLE') | default(false, true) }}"
|
|
consul_tls_src_files: "{{ lookup('env','CONSUL_TLS_SRC_FILES') | default(role_path+'/files', true) }}"
|
|
|
|
consul_tls_dir: "{{ lookup('env','CONSUL_TLS_DIR') | default('/etc/consul/ssl', true) }}"
|
|
|
|
consul_tls_ca_crt: "{{ lookup('env','CONSUL_TLS_CA_CRT') | default('ca.crt', true) }}"
|
|
consul_tls_server_crt: "{{ lookup('env','CONSUL_SERVER_CRT') | default('server.crt', true) }}"
|
|
consul_tls_server_key: "{{ lookup('env','CONSUL_SERVER_KEY') | default('server.key', true) }}"
|
|
consul_tls_copy_keys: true
|
|
consul_tls_verify_incoming: false
|
|
consul_tls_verify_outgoing: true
|
|
consul_tls_verify_incoming_rpc: false
|
|
consul_tls_verify_incoming_https: false
|
|
consul_tls_verify_server_hostname: false
|
|
|
|
## DNS
|
|
consul_dnsmasq_enable: "{{ lookup('env','CONSUL_DNSMASQ_ENABLE') | default(false, true) }}"
|
|
consul_dnsmasq_consul_address: "\
|
|
{# Use localhost if DNS is listening on all interfaces #}\
|
|
{% if consul_addresses.dns == '0.0.0.0' %}\
|
|
127.0.0.1\
|
|
{% else %}\
|
|
{{ consul_addresses.dns }}\
|
|
{% endif %}"
|
|
consul_dnsmasq_cache: -1
|
|
consul_dnsmasq_servers:
|
|
- 8.8.8.8
|
|
- 8.8.4.4
|
|
consul_dnsmasq_revservers: []
|
|
consul_dnsmasq_no_poll: false
|
|
consul_dnsmasq_no_resolv: false
|
|
consul_dnsmasq_local_service: false
|
|
consul_dnsmasq_listen_addresses: []
|
|
consul_iptables_enable: "{{ lookup('env','CONSUL_IPTABLES_ENABLE') | default(false, true) }}"
|
|
|
|
# Performance
|
|
consul_performance:
|
|
raft_multiplier: 1
|
|
leave_drain_time: 5s
|
|
rpc_hold_timeout: 7s
|