Push Project :
- Terraform ⚙️ : Instance creation - Ansible 🛠️ : ContainerLab installation
This commit is contained in:
45
ansible/install_containerlab.yml
Normal file
45
ansible/install_containerlab.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
- hosts: all
|
||||
become: yes
|
||||
tasks:
|
||||
|
||||
- name: Install required system packages
|
||||
apt:
|
||||
pkg:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
- curl
|
||||
- software-properties-common
|
||||
- python3-pip
|
||||
- virtualenv
|
||||
- python3-setuptools
|
||||
- git
|
||||
state: latest
|
||||
update_cache: true
|
||||
|
||||
- name: Add Docker GPG apt Key
|
||||
apt_key:
|
||||
url: https://download.docker.com/linux/ubuntu/gpg
|
||||
state: present
|
||||
|
||||
- name: Add Docker Repository
|
||||
apt_repository:
|
||||
repo: deb https://download.docker.com/linux/ubuntu focal stable
|
||||
state: present
|
||||
|
||||
- name: Update apt and install docker-ce
|
||||
apt:
|
||||
name: docker-ce
|
||||
state: latest
|
||||
update_cache: true
|
||||
|
||||
- name: Add the current user to the docker group
|
||||
user:
|
||||
name: "{{ ansible_user_id }}"
|
||||
group: docker
|
||||
|
||||
- name: Install ContainerLab
|
||||
shell: |
|
||||
curl -sL https://get.containerlab.dev | sudo bash
|
||||
args:
|
||||
creates: /usr/local/bin/containerlab
|
||||
Reference in New Issue
Block a user