diff --git a/templates/lb/cloud-init.cfg b/templates/lb/cloud-init.cfg index 69259e5..b09539e 100644 --- a/templates/lb/cloud-init.cfg +++ b/templates/lb/cloud-init.cfg @@ -33,6 +33,25 @@ packages: - haproxy - firewalld +# Uncomment the following lines for HTTP proxy support +# +# bootcmd: +# - | +# cloud-init-per once env sh -c "mkdir -p /etc/systemd/system/cloud-config.service.d && +# mkdir -p /etc/systemd/system/cloud-final.service.d && { cat > /etc/cloud/env <<-EOF +# http_proxy=http://admin.itix.lab:3128 +# https_proxy=http://admin.itix.lab:3128 +# EOF +# } && { cat > /etc/systemd/system/cloud-config.service.d/override.conf <<-EOF +# [Service] +# EnvironmentFile=/etc/cloud/env +# EOF +# } && { cat > /etc/systemd/system/cloud-final.service.d/override.conf <<-EOF +# [Service] +# EnvironmentFile=/etc/cloud/env +# EOF +# } && systemctl daemon-reload" + runcmd: # Enable KVM virsh console access - [ "systemctl", "enable", "serial-getty@ttyS0.service" ] diff --git a/templates/storage/cloud-init.cfg b/templates/storage/cloud-init.cfg index f0f4a24..6a72590 100644 --- a/templates/storage/cloud-init.cfg +++ b/templates/storage/cloud-init.cfg @@ -47,6 +47,23 @@ packages: - firewalld - nfs-utils +bootcmd: +- | + cloud-init-per once env sh -c "mkdir -p /etc/systemd/system/cloud-config.service.d && + mkdir -p /etc/systemd/system/cloud-final.service.d && { cat > /etc/cloud/env <<-EOF + http_proxy=http://192.168.48.2:3128 + https_proxy=http://192.168.48.2:3128 + EOF + } && { cat > /etc/systemd/system/cloud-config.service.d/override.conf <<-EOF + [Service] + EnvironmentFile=/etc/cloud/env + EOF + } && { cat > /etc/systemd/system/cloud-final.service.d/override.conf <<-EOF + [Service] + EnvironmentFile=/etc/cloud/env + EOF + } && systemctl daemon-reload" + runcmd: # Enable KVM virsh console access - [ "systemctl", "enable", "serial-getty@ttyS0.service" ]