Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ansible ContainerLab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
Development Playbooks
Ansible ContainerLab
Commits
815a188a
Verified
Commit
815a188a
authored
2 years ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
Rely on environment variables instead
parent
674d1338
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+7
-7
7 additions, 7 deletions
README.md
playbook.yml
+2
-2
2 additions, 2 deletions
playbook.yml
with
9 additions
and
9 deletions
README.md
+
7
−
7
View file @
815a188a
...
@@ -4,22 +4,22 @@ This playbook is used to install ContainerLab on a VM, and test network configur
...
@@ -4,22 +4,22 @@ This playbook is used to install ContainerLab on a VM, and test network configur
To run this playbook:
To run this playbook:
```
```
ansible-playbook -i $the-vm-you-want-to-configure, playbook.yml
-e "username=$your-username-on-registry" -e "secret_token=$your-secret-tocken"
-k
ansible-playbook -i $the-vm-you-want-to-configure, playbook.yml -k
```
```
Please note the comma after the target.
Please note the comma after the target.
Consider that the Docker repository and the username to login on the box are
hardcoded in the playbook
:
Consider that the Docker repository and the username to login on the box are
passed through environment variables
:
```
```
- name: Install Docker and ContainerLab
- name: Install Docker and ContainerLab
hosts: all
hosts: all
become: true
become: true
vars:
vars:
docker:
docker:
registry_url: gitlab.geant.net:5005/docker/ci_registry
<<<<<<<<<<<<<<<<
registry_url: gitlab.geant.net:5005/docker/ci_registry
username: "{{
username
}}"
username: "{{
lookup('ansible.builtin.env', 'GITLAB_USER'
}}"
private_token: "{{
secret_token
}}"
private_token: "{{
lookup('ansible.builtin.env', 'GITLAB_TOKEN'
}}"
nat_user: nat
<<<<<<<<<<<<<<<<
nat_user: nat
<<<<<<<< username is hardcoded
roles:
roles:
- docker
- docker
- containerlab
- containerlab
...
...
This diff is collapsed.
Click to expand it.
playbook.yml
+
2
−
2
View file @
815a188a
...
@@ -4,8 +4,8 @@
...
@@ -4,8 +4,8 @@
vars
:
vars
:
docker
:
docker
:
registry_url
:
gitlab.geant.net:5005/docker/ci_registry
registry_url
:
gitlab.geant.net:5005/docker/ci_registry
username
:
"
{{
username
}}"
username
:
"
{{
lookup('ansible.builtin.env',
'GITLAB_USER'
}}"
private_token
:
"
{{
secret_token
}}"
private_token
:
"
{{
lookup('ansible.builtin.env',
'GITLAB_TOKEN'
}}"
nat_user
:
nat
nat_user
:
nat
roles
:
roles
:
-
docker
-
docker
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment