Skip to content

autocon4-workshop containerlab install for rpm packages #74

@Lobout

Description

@Lobout

your script is not correct for installing containerlab and ansible on a redhat(rpm) based OS. It should be as follows:

Install ContainerLab

echo "--- Installing ContainerLab ---"
LATEST_RELEASE=$(curl -s https://api.github.com/repos/srl-labs/containerlab/releases/latest | grep "tag_name" | cut -d : -f 2,3 | tr -d " | tr -d , | tr -d " ")
echo "Installing ContainerLab version: $LATEST_RELEASE"
cd /tmp
if [[ $PM == "apt" ]]; then
echo "deb [trusted=yes] https://netdevops.fury.site/apt/ /" |
sudo tee -a /etc/apt/sources.list.d/netdevops.list
sudo apt update && sudo apt install containerlab
else
sudo dnf config-manager -y --add-repo "https://netdevops.fury.site/yum/" &&
echo "gpgcheck=0" | sudo tee -a /etc/yum.repos.d/netdevops.fury.site_yum_.repo
sudo dnf -y install containerlab
fi

cd -
containerlab version

Install Ansible

echo "--- Installing Ansible ---"
if [[ $PM == "apt" ]]; then
sudo apt install -y ansible
else
sudo $PM install -y ansible-core
fi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions