Working. Clams integration stop.
This commit is contained in:
parent
b6e0e5ac4d
commit
16f88d964d
@ -80,7 +80,7 @@ export PROJECTS_DIR="$HOME/ss-projects"
|
|||||||
export SITES_PATH="$HOME/ss-sites"
|
export SITES_PATH="$HOME/ss-sites"
|
||||||
|
|
||||||
# The base VM image.
|
# The base VM image.
|
||||||
export LXD_UBUNTU_BASE_VERSION="22.04"
|
export LXD_UBUNTU_BASE_VERSION="jammy"
|
||||||
export BASE_IMAGE_VM_NAME="ss-base-${LXD_UBUNTU_BASE_VERSION//./-}"
|
export BASE_IMAGE_VM_NAME="ss-base-${LXD_UBUNTU_BASE_VERSION//./-}"
|
||||||
export BASE_LXC_IMAGE="ubuntu/$LXD_UBUNTU_BASE_VERSION/cloud"
|
export BASE_LXC_IMAGE="ubuntu/$LXD_UBUNTU_BASE_VERSION/cloud"
|
||||||
export UBUNTU_BASE_IMAGE_NAME="ss-ubuntu-${LXD_UBUNTU_BASE_VERSION//./-}"
|
export UBUNTU_BASE_IMAGE_NAME="ss-ubuntu-${LXD_UBUNTU_BASE_VERSION//./-}"
|
||||||
|
@ -87,6 +87,9 @@ if ! lxc remote list | grep -q "$CLUSTER_NAME"; then
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# first let's copy our ssh pubkey to the remote server so we don't have to login constantly.
|
||||||
|
ssh-copy-id -i "$HOME/.ssh/id_rsa.pub" "ubuntu@$FQDN"
|
||||||
|
|
||||||
if [ -z "$DATA_PLANE_MACVLAN_INTERFACE" ]; then
|
if [ -z "$DATA_PLANE_MACVLAN_INTERFACE" ]; then
|
||||||
echo "INFO: It looks like you didn't provide input on the command line for the data plane macvlan interface."
|
echo "INFO: It looks like you didn't provide input on the command line for the data plane macvlan interface."
|
||||||
echo " We need to know which interface that is! Enter it here now."
|
echo " We need to know which interface that is! Enter it here now."
|
||||||
@ -159,7 +162,7 @@ sudo apt-get update && sudo apt-get upgrade -y && sudo apt install htop dnsutils
|
|||||||
|
|
||||||
# install lxd as a snap if it's not installed.
|
# install lxd as a snap if it's not installed.
|
||||||
if ! snap list | grep -q lxd; then
|
if ! snap list | grep -q lxd; then
|
||||||
sudo snap install lxd
|
sudo snap install lxd --channel=5.10/stable
|
||||||
sleep 10
|
sleep 10
|
||||||
fi
|
fi
|
||||||
"
|
"
|
||||||
|
@ -17,7 +17,7 @@ fi
|
|||||||
# If the lxc VM does exist, then we will delete it (so we can start fresh)
|
# If the lxc VM does exist, then we will delete it (so we can start fresh)
|
||||||
if lxc list -q --format csv | grep -q "$BASE_IMAGE_VM_NAME"; then
|
if lxc list -q --format csv | grep -q "$BASE_IMAGE_VM_NAME"; then
|
||||||
# if there's no snapshot, we dispense with the old image and try again.
|
# if there's no snapshot, we dispense with the old image and try again.
|
||||||
if ! lxc info "$BASE_IMAGE_VM_NAME" | grep -q "ss-docker-$(date +%Y-%m)"; then
|
if ! lxc info "$BASE_IMAGE_VM_NAME" | grep -q "ss-docker-$LXD_UBUNTU_BASE_VERSION"; then
|
||||||
lxc delete "$BASE_IMAGE_VM_NAME" --force
|
lxc delete "$BASE_IMAGE_VM_NAME" --force
|
||||||
ssh-keygen -f "$SSH_HOME/known_hosts" -R "$BASE_IMAGE_VM_NAME"
|
ssh-keygen -f "$SSH_HOME/known_hosts" -R "$BASE_IMAGE_VM_NAME"
|
||||||
fi
|
fi
|
||||||
@ -31,12 +31,13 @@ else
|
|||||||
|
|
||||||
lxc start "$BASE_IMAGE_VM_NAME"
|
lxc start "$BASE_IMAGE_VM_NAME"
|
||||||
|
|
||||||
sleep 70
|
sleep 30
|
||||||
|
|
||||||
# ensure the ssh service is listening at localhost
|
# ensure the ssh service is listening at localhost
|
||||||
lxc exec "$BASE_IMAGE_VM_NAME" -- wait-for-it 127.0.0.1:22 -t 120
|
lxc exec "$BASE_IMAGE_VM_NAME" -- wait-for-it 127.0.0.1:22 -t 120
|
||||||
|
|
||||||
|
|
||||||
# stop the VM and get a snapshot.
|
# stop the VM and get a snapshot.
|
||||||
lxc stop "$BASE_IMAGE_VM_NAME"
|
lxc stop "$BASE_IMAGE_VM_NAME"
|
||||||
lxc snapshot "$BASE_IMAGE_VM_NAME" "ss-docker-$(date +%Y-%m)"
|
lxc snapshot "$BASE_IMAGE_VM_NAME" "ss-docker-$LXD_UBUNTU_BASE_VERSION"
|
||||||
fi
|
fi
|
||||||
|
@ -33,7 +33,7 @@ if ! lxc list --format csv | grep -q "$LXD_VM_NAME"; then
|
|||||||
|
|
||||||
./stub_lxc_profile.sh "$LXD_VM_NAME"
|
./stub_lxc_profile.sh "$LXD_VM_NAME"
|
||||||
|
|
||||||
lxc copy --profile="$LXD_VM_NAME" "$BASE_IMAGE_VM_NAME"/"ss-docker-$(date +%Y-%m)" "$LXD_VM_NAME"
|
lxc copy --profile="$LXD_VM_NAME" "$BASE_IMAGE_VM_NAME"/"ss-docker-$LXD_UBUNTU_BASE_VERSION" "$LXD_VM_NAME"
|
||||||
|
|
||||||
# now let's create a new VM to work with.
|
# now let's create a new VM to work with.
|
||||||
#@lxc init --profile="$LXD_VM_NAME" "$BASE_IMAGE_VM_NAME" "$LXD_VM_NAME" --vm
|
#@lxc init --profile="$LXD_VM_NAME" "$BASE_IMAGE_VM_NAME" "$LXD_VM_NAME" --vm
|
||||||
|
@ -50,12 +50,6 @@ if [ "$LXD_HOSTNAME" = "$BASE_IMAGE_VM_NAME" ]; then
|
|||||||
preserve_hostname: false
|
preserve_hostname: false
|
||||||
fqdn: ${BASE_IMAGE_VM_NAME}
|
fqdn: ${BASE_IMAGE_VM_NAME}
|
||||||
|
|
||||||
apt:
|
|
||||||
sources:
|
|
||||||
docker.list:
|
|
||||||
source: "deb [arch=amd64] https://download.docker.com/linux/ubuntu jammy stable"
|
|
||||||
keyid: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
|
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
- curl
|
- curl
|
||||||
- ssh-askpass
|
- ssh-askpass
|
||||||
@ -76,10 +70,6 @@ if [ "$LXD_HOSTNAME" = "$BASE_IMAGE_VM_NAME" ]; then
|
|||||||
- wait-for-it
|
- wait-for-it
|
||||||
- dnsutils
|
- dnsutils
|
||||||
- wget
|
- wget
|
||||||
- docker-ce
|
|
||||||
- docker-ce-cli
|
|
||||||
- containerd.io
|
|
||||||
- docker-compose-plugin
|
|
||||||
|
|
||||||
groups:
|
groups:
|
||||||
- docker
|
- docker
|
||||||
@ -104,18 +94,33 @@ if [ "$LXD_HOSTNAME" = "$BASE_IMAGE_VM_NAME" ]; then
|
|||||||
UsePAM no
|
UsePAM no
|
||||||
LogLevel INFO
|
LogLevel INFO
|
||||||
|
|
||||||
- path: /etc/docker/daemon.json
|
|
||||||
content: |
|
|
||||||
{
|
|
||||||
"registry-mirrors": ["${REGISTRY_URL}"]
|
|
||||||
}
|
|
||||||
|
|
||||||
runcmd:
|
runcmd:
|
||||||
|
- sudo mkdir -m 0755 -p /etc/apt/keyrings
|
||||||
|
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||||
|
- echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list
|
||||||
|
- sudo apt-get update
|
||||||
|
- sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||||
- sudo apt-get install -y openssh-server
|
- sudo apt-get install -y openssh-server
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
#,
|
|
||||||
#"labels": [ "githead=${LATEST_GIT_COMMIT}" ]
|
|
||||||
|
# apt:
|
||||||
|
# sources:
|
||||||
|
# docker.list:
|
||||||
|
# source: "deb [arch=amd64] https://download.docker.com/linux/ubuntu ${LXD_UBUNTU_BASE_VERSION} stable"
|
||||||
|
# keyid: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
|
||||||
|
|
||||||
|
# - path: /etc/docker/daemon.json
|
||||||
|
# content: |
|
||||||
|
# {
|
||||||
|
# "registry-mirrors": ["${REGISTRY_URL}"],
|
||||||
|
# "labels": [ "githead=${LATEST_GIT_COMMIT}" ]
|
||||||
|
# }
|
||||||
|
|
||||||
|
|
||||||
|
# - sudo apt-get update
|
||||||
|
#- sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
|
||||||
|
|
||||||
else
|
else
|
||||||
# all other machines.
|
# all other machines.
|
||||||
|
@ -10,6 +10,7 @@ if [ "$DEPLOY_BTCPAY_SERVER" = true ]; then
|
|||||||
git clone "$CLAMS_GIT_REPO" "$LOCAL_CLAMS_REPO_PATH"
|
git clone "$CLAMS_GIT_REPO" "$LOCAL_CLAMS_REPO_PATH"
|
||||||
else
|
else
|
||||||
cd "$LOCAL_CLAMS_REPO_PATH"
|
cd "$LOCAL_CLAMS_REPO_PATH"
|
||||||
|
#git config pull.ff only
|
||||||
git pull
|
git pull
|
||||||
cd -
|
cd -
|
||||||
fi
|
fi
|
||||||
|
@ -24,7 +24,7 @@ fi
|
|||||||
|
|
||||||
# install snap
|
# install snap
|
||||||
if ! snap list | grep -q lxd; then
|
if ! snap list | grep -q lxd; then
|
||||||
sudo snap install lxd --channel=5.11/candidate
|
sudo snap install lxd --channel=5.10/stable
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
# run lxd init on the remote server./dev/nvme1n1
|
# run lxd init on the remote server./dev/nvme1n1
|
||||||
|
@ -34,7 +34,7 @@ sleep 1
|
|||||||
|
|
||||||
# install snap
|
# install snap
|
||||||
if ! snap list | grep -q lxd; then
|
if ! snap list | grep -q lxd; then
|
||||||
sudo snap install lxd
|
sudo snap install lxd --channel=5.10/stable
|
||||||
sleep 6
|
sleep 6
|
||||||
|
|
||||||
# We just do an auto initialization. All we are using is the LXD client inside the management environment.
|
# We just do an auto initialization. All we are using is the LXD client inside the management environment.
|
||||||
|
Loading…
Reference in New Issue
Block a user