mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-02-22 12:41:14 +01:00
Added option to install Portainer or Portainer agent in Podman
This commit is contained in:
parent
cc581667e6
commit
4edbdaa92a
@ -19,6 +19,13 @@ $STD apt-get install -y sudo
|
||||
$STD apt-get install -y mc
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
get_latest_release() {
|
||||
curl -sL https://api.github.com/repos/$1/releases/latest | grep '"tag_name":' | cut -d'"' -f4
|
||||
}
|
||||
|
||||
PORTAINER_LATEST_VERSION=$(get_latest_release "portainer/portainer")
|
||||
PORTAINER_AGENT_LATEST_VERSION=$(get_latest_release "portainer/agent")
|
||||
|
||||
if $STD mount | grep 'on / type zfs' > null && echo "ZFS"; then
|
||||
msg_info "Enabling ZFS support."
|
||||
mkdir -p /etc/containers
|
||||
@ -47,6 +54,34 @@ $STD apt-get -y install podman
|
||||
$STD systemctl enable --now podman.socket
|
||||
msg_ok "Installed Podman"
|
||||
|
||||
read -r -p "Would you like to add Portainer? <y/N> " prompt
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing Portainer $PORTAINER_LATEST_VERSION"
|
||||
podman volume create portainer_data >/dev/null
|
||||
$STD podman run -d \
|
||||
-p 8000:8000 \
|
||||
-p 9443:9443 \
|
||||
--name=portainer \
|
||||
--restart=always \
|
||||
-v /run/podman/podman.sock:/var/run/docker.sock \
|
||||
-v portainer_data:/data \
|
||||
portainer/portainer-ce:latest
|
||||
msg_ok "Installed Portainer $PORTAINER_LATEST_VERSION"
|
||||
else
|
||||
read -r -p "Would you like to add the Portainer Agent? <y/N> " prompt
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing Portainer agent $PORTAINER_AGENT_LATEST_VERSION"
|
||||
$STD podman run -d \
|
||||
-p 9001:9001 \
|
||||
--name portainer_agent \
|
||||
--restart=always \
|
||||
-v /run/podman/podman.sock:/var/run/docker.sock \
|
||||
-v /var/lib/containers/storage/volumes:/var/lib/docker/volumes \
|
||||
portainer/agent
|
||||
msg_ok "Installed Portainer Agent $PORTAINER_AGENT_LATEST_VERSION"
|
||||
fi
|
||||
fi
|
||||
|
||||
msg_info "Pulling Home Assistant Image"
|
||||
$STD podman pull docker.io/homeassistant/home-assistant:stable
|
||||
msg_ok "Pulled Home Assistant Image"
|
||||
|
@ -19,6 +19,13 @@ $STD apt-get install -y sudo
|
||||
$STD apt-get install -y mc
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
get_latest_release() {
|
||||
curl -sL https://api.github.com/repos/$1/releases/latest | grep '"tag_name":' | cut -d'"' -f4
|
||||
}
|
||||
|
||||
PORTAINER_LATEST_VERSION=$(get_latest_release "portainer/portainer")
|
||||
PORTAINER_AGENT_LATEST_VERSION=$(get_latest_release "portainer/agent")
|
||||
|
||||
if $STD mount | grep 'on / type zfs' > null && echo "ZFS"; then
|
||||
msg_info "Enabling ZFS support."
|
||||
mkdir -p /etc/containers
|
||||
@ -48,6 +55,35 @@ $STD systemctl enable --now podman.socket
|
||||
echo -e 'unqualified-search-registries=["docker.io"]' >> /etc/containers/registries.conf
|
||||
msg_ok "Installed Podman"
|
||||
|
||||
read -r -p "Would you like to add Portainer? <y/N> " prompt
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing Portainer $PORTAINER_LATEST_VERSION"
|
||||
podman volume create portainer_data >/dev/null
|
||||
$STD podman run -d \
|
||||
-p 8000:8000 \
|
||||
-p 9443:9443 \
|
||||
--name=portainer \
|
||||
--restart=always \
|
||||
-v /run/podman/podman.sock:/var/run/docker.sock \
|
||||
-v portainer_data:/data \
|
||||
portainer/portainer-ce:latest
|
||||
msg_ok "Installed Portainer $PORTAINER_LATEST_VERSION"
|
||||
else
|
||||
read -r -p "Would you like to add the Portainer Agent? <y/N> " prompt
|
||||
if [[ ${prompt,,} =~ ^(y|yes)$ ]]; then
|
||||
msg_info "Installing Portainer agent $PORTAINER_AGENT_LATEST_VERSION"
|
||||
$STD podman run -d \
|
||||
-p 9001:9001 \
|
||||
--name portainer_agent \
|
||||
--restart=always \
|
||||
-v /run/podman/podman.sock:/var/run/docker.sock \
|
||||
-v /var/lib/containers/storage/volumes:/var/lib/docker/volumes \
|
||||
portainer/agent
|
||||
msg_ok "Installed Portainer Agent $PORTAINER_AGENT_LATEST_VERSION"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
|
@ -38,6 +38,10 @@
|
||||
{
|
||||
"text": "config path: `/var/lib/containers/storage/volumes/hass_config/_data`",
|
||||
"type": "info"
|
||||
},
|
||||
{
|
||||
"text": "Options to Install Portainer or Portainer Agent",
|
||||
"type": "warning"
|
||||
}
|
||||
]
|
||||
}
|
@ -30,5 +30,10 @@
|
||||
"username": null,
|
||||
"password": null
|
||||
},
|
||||
"notes": []
|
||||
"notes": [
|
||||
{
|
||||
"text": "Options to Install Portainer or Portainer Agent",
|
||||
"type": "warning"
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user