Feature/tailscale access (#1)

* AWS_R53_ENABLED: Delete unused variable

* Add Tailscale Feature
- Removed R53 configuration
- Updated Ansible playbook to handle empty variables
- Updated Ansible playbook to use variables file
- Updated README to include updated requirements

---------

Co-authored-by: Damien A <sepales.pret0h@icloud.com>
This commit is contained in:
Damien A
2024-02-25 17:25:34 +01:00
committed by GitHub
parent a4170247b3
commit 315910772c
9 changed files with 54 additions and 85 deletions

View File

@@ -0,0 +1,3 @@
repo_git_url: ""
local_dir_path: ""
tailscale_auth_key: ""

View File

@@ -1,11 +1,14 @@
---
- hosts: all
become: yes
vars:
repo_git_url: ""
local_dir_path: ""
vars_files:
- ./clab_vars.yml
tasks:
- name: Set hostname to ContainerLab
hostname:
name: ContainerLab
- name: Install required system packages
apt:
pkg:
@@ -43,6 +46,27 @@
user:
name: "{{ ansible_user_id }}"
group: docker
- name: Add Tailscale GPG apt Key
apt_key:
url: https://pkgs.tailscale.com/stable/ubuntu/focal.noarmor.gpg
state: present
- name: Add Tailscale Repository
apt_repository:
repo: deb https://pkgs.tailscale.com/stable/ubuntu/ focal main
state: present
filename: tailscale
update_cache: yes
- name: Update apt and install Tailscale
apt:
name: tailscale
state: latest
update_cache: yes
- name: Run Tailscale CLI command
command: "sudo tailscale up --authkey {{ tailscale_auth_key }}"
- name: Install ContainerLab
shell: |
@@ -76,15 +100,15 @@
update: yes
version: "main"
become: yes
when: repo_git_url | length > 0
when: (repo_git_url is defined) and (repo_git_url | length > 0)
- name: Synchronize local directory to VM
synchronize:
ansible.posix.synchronize:
src: "{{ local_dir_path }}"
dest: "/opt/containerlab/projet/"
recursive: yes
become: yes
when: local_dir_path | length > 0
when: (local_dir_path is defined) and (local_dir_path | length > 0)
- name: Copy network images to remote /tmp directory
copy: