summaryrefslogtreecommitdiff
path: root/extensions/molecule/_shared/lab_up.yml
blob: 8f041d1c0e5fbc5d24b4901458f405c7d3460495 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
- name: Deploy the scenario's containerlab topology
  hosts: localhost
  gather_facts: false
  vars:
    _topology: "{{ lookup('ansible.builtin.env', 'MOLECULE_SCENARIO_DIRECTORY') }}/topology.clab.yml"
  tasks:
    - name: Deploy lab
      ansible.builtin.command:
        cmd: containerlab deploy --reconfigure --topo {{ _topology }}
      become: "{{ lookup('ansible.builtin.env', 'CLAB_BECOME', default='true') | bool }}"
      changed_when: true

- name: Wait for VyOS nodes to accept configuration
  hosts: vyos
  gather_facts: false
  tasks:
    - name: Wait for SSH
      ansible.builtin.wait_for:
        host: "{{ ansible_host }}"
        port: 22
        timeout: 300
      delegate_to: localhost

    - name: Wait for the configuration system
      vyos.vyos.vyos_command:
        commands: [show version]
      register: _ready
      until: _ready is succeeded
      retries: 30
      delay: 10