mirror of
https://github.com/kemko/nomad.git
synced 2026-01-04 17:35:43 +03:00
e2e: consolidate cloud-specific Consul configs (#8823)
The `-recursor` flag in the Consul service unit files is specific to a given cloud, but we already have cloud-specific configuration files. Consolidate all the cloud-specific items into the config.
This commit is contained in:
@@ -6,7 +6,7 @@ After=network-online.target
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
Environment=CONSUL_ALLOW_PRIVILEGED_PORTS=true
|
||||
ExecStart=/usr/local/bin/consul agent -config-dir="/etc/consul.d" -recursor="172.31.0.2"
|
||||
ExecStart=/usr/local/bin/consul agent -config-dir="/etc/consul.d"
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
KillSignal=SIGTERM
|
||||
User=root
|
||||
@@ -1,16 +0,0 @@
|
||||
[Unit]
|
||||
Description=Consul Agent
|
||||
Requires=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Restart=on-failure
|
||||
Environment=CONSUL_ALLOW_PRIVILEGED_PORTS=true
|
||||
ExecStart=/usr/local/bin/consul agent -config-dir="/etc/consul.d" -recursor="168.63.129.16"
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
KillSignal=SIGTERM
|
||||
User=root
|
||||
Group=root
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -51,7 +51,7 @@ sudo chown root:root /usr/local/bin/consul
|
||||
echo "Configure Consul"
|
||||
mkdir_for_root /etc/consul.d
|
||||
mkdir_for_root /opt/consul
|
||||
sudo mv /tmp/linux/consul_aws.service /etc/systemd/system/consul.service
|
||||
sudo mv /tmp/linux/consul.service /etc/systemd/system/consul.service
|
||||
|
||||
echo "Install Vault"
|
||||
curl -fsL -o /tmp/vault.zip \
|
||||
|
||||
@@ -11,7 +11,7 @@ CONSUL_SRC=/ops/shared/consul
|
||||
CONSUL_DEST=/etc/consul.d
|
||||
|
||||
sudo cp "$CONSUL_SRC/base.json" "$CONSUL_DEST/"
|
||||
sudo cp "$CONSUL_SRC/retry_$CLOUD.json" "$CONSUL_DEST/"
|
||||
sudo cp "$CONSUL_SRC/$CLOUD.json" "$CONSUL_DEST/"
|
||||
|
||||
sudo systemctl enable consul.service
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
@@ -14,7 +14,7 @@ CONSUL_DEST=/etc/consul.d
|
||||
sed "s/SERVER_COUNT/$SERVER_COUNT/g" "$CONSUL_SRC/server.json" > /tmp/server.json
|
||||
sudo mv /tmp/server.json "$CONSUL_DEST/server.json"
|
||||
sudo cp "$CONSUL_SRC/base.json" "$CONSUL_DEST/"
|
||||
sudo cp "$CONSUL_SRC/retry_$CLOUD.json" "$CONSUL_DEST/"
|
||||
sudo cp "$CONSUL_SRC/$CLOUD.json" "$CONSUL_DEST/"
|
||||
|
||||
sudo systemctl enable consul.service
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
@@ -11,8 +11,8 @@ Copy-Item -Force `
|
||||
-Path "C:\ops\shared\consul\base.json" `
|
||||
-Destination "C:\opt\consul.d\base.json"
|
||||
Copy-Item -Force `
|
||||
-Path "C:\ops\shared\consul\retry_$Cloud.json" `
|
||||
-Destination "C:\opt\consul.d\retry_$Cloud.json"
|
||||
-Path "C:\ops\shared\consul\$Cloud.json" `
|
||||
-Destination "C:\opt\consul.d\$Cloud.json"
|
||||
New-Service `
|
||||
-Name "Consul" `
|
||||
-BinaryPathName "C:\opt\consul.exe agent -config-dir C:\opt\consul.d -log-file C:\opt\consul\consul.log" `
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"recursors": ["172.31.0.2"],
|
||||
"retry_join": ["provider=aws tag_key=ConsulAutoJoin tag_value=auto-join"]
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
{
|
||||
"recursors": ["168.63.129.16"],
|
||||
"retry_join": ["provider=azure tag_key=ConsulAutoJoin tag_value=auto-join"]
|
||||
}
|
||||
Reference in New Issue
Block a user