Skip to content
Snippets Groups Projects
Verified Commit 815a188a authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

Rely on environment variables instead

parent 674d1338
No related branches found
No related tags found
No related merge requests found
...@@ -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
......
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment