更新consul-external、consul-internal、mariadb

This commit is contained in:
zhangzhihan
2020-01-24 17:55:06 +08:00
parent 960bdaa91f
commit e78252a137
40 changed files with 41 additions and 2552 deletions

View File

@@ -7,13 +7,13 @@
- name: "Template consul_bind_ip_generate.sh"
template:
src: "{{ role_path }}/templates/consul_bind_ip_generate.sh.j2"
dest: /opt/consul-cluster/script
dest: /opt/consul-cluster/script/consul_bind_ip_generate.sh
tags: template
- name: "Template config-server.json"
template:
src: "{{ role_path }}/templates/config-server.json.j2"
dest: /opt/consul-cluster/etc/consul
dest: /opt/consul-cluster/etc/consul/config-server.json
tags: template
- name: "Install consul-cluster"
@@ -22,5 +22,6 @@
- name: "Start consul-cluster"
systemd:
name: consul-server-cluster
state: restarted
enabled: yes
daemon_reload: yes

View File

@@ -2,11 +2,11 @@
"server" : true,
"datacenter" : "{{ consul.datacenter }}",
"data_dir" : "/var/consul-cluster",
"encrypt" : "{{ consul.keys}}",
"encrypt" : "{{ consul.dckey }}",
"disable_update_check" : true,
"bootstrap" : true,
"log_file" : "/var/consul-cluster/log/consul_cluster.log",
"retry_join" : ["{{ inventory_hostname }}"],
"retry_join" : ["{{ consul.cluster_ip }}"],
"retry_interval" : "10s"
}

View File

@@ -1,6 +1,4 @@
#!/bin/bash
#BIND_ADDRESS=$(/usr/sbin/ip route | /usr/bin/grep default | head -n 1 | /usr/bin/awk '{print $5}' | /usr/bin/xargs ifconfig | /usr/bin/grep "inet" | /usr/bin/grep -v "inet6" | /usr/bin/awk '{print $2}')
BIND_ADDRESS=$(ifconfig {{ consul.cluster_nig_mgr }} | grep inet | head -1 |awk '{print $2}')
#BIND_ADDRESS=192.168.200.5
BIND_ADDRESS=$(ifconfig {{ consul.cluster_ethname }} | grep inet | head -1 |awk '{print $2}')
systemctl set-environment CONSUL_BIND_ADDRESS=${BIND_ADDRESS}