更新consul-external、consul-internal、mariadb
This commit is contained in:
Binary file not shown.
@@ -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
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user