33 lines
No EOL
1.2 KiB
Text
33 lines
No EOL
1.2 KiB
Text
[[stack]]
|
|
name = "pve1lxc6-keepalived"
|
|
[stack.config]
|
|
server = "pve1-lxc6"
|
|
linked_repo = "mapletree-pve1lxc6"
|
|
run_directory = "/docker/keepalived"
|
|
file_paths = [
|
|
"/etc/komodo/repos/mapletree-pve1lxc6/keepalived/docker-compose.yml"
|
|
]
|
|
pre_deploy.command = """
|
|
# Add# 1. Create Directory
|
|
mkdir -p /docker/keepalived/config
|
|
mkdir -p /docker/keepalived/checks
|
|
|
|
# 2. Copy Templates from Checked-out Repo
|
|
# (Overwrites existing files, which is what we want)
|
|
cp /etc/komodo/repos/mapletree-pve1lxc6/keepalived/keepalived.conf.tpl /docker/keepalived/config/keepalived.conf
|
|
cp /etc/komodo/repos/mapletree-pve1lxc6/keepalived/check_komodo.sh /docker/keepalived/checks/check_komodo.sh
|
|
|
|
# 3. Permissions
|
|
chmod +x /docker/keepalived/checks/check_komodo.sh
|
|
|
|
# 4. Inject Variables (Directly modifying the file on Host)
|
|
# Since we mount the DIRECTORY, the container will see these changes.
|
|
sed -i "s/{{STATE}}/BACKUP/g" /docker/keepalived/config/keepalived.conf
|
|
sed -i "s/{{PRIORITY}}/100/g" /docker/keepalived/config/keepalived.conf
|
|
sed -i "s/{{PEER}}/172.16.201.206/g" /docker/keepalived/config/keepalived.conf
|
|
sed -i "s/{{PASSWORD}}/HAPass22/g" /docker/keepalived/config/keepalived.conf
|
|
"""
|
|
environment = """
|
|
|
|
|
|
""" |