--- - name: Test SONiC CLI hosts: datacenter gather_facts: true connection: ssh vars: build_number: 120 tasks: - name: Download image from build server ansible.builtin.get_url: # url: "http://10.14.1.208/work/sonic_archive1/dell_sonic_3.1.x_share/{{ build_number }}/sonic-broadcom.bin" # url: http://devopsweb.force10networks.com/tftpboot/SONIC/dell_sonic_3.1.x_share/last_good/sonic-broadcom.bin url: http://10.14.1.69/tftpboot/SONIC/dell_sonic_3.1.x_share/{{ build_number }}/sonic-broadcom.bin dest: /tmp/sonic-broadcom-{{ build_number }}.bin mode: '0777' - name: Install the downloaded image become: true ansible.builtin.command: sonic_installer install /tmp/sonic-broadcom-{{ build_number }}.bin -y register: output changed_when: true - name: Wait for 3 seconds ansible.builtin.pause: seconds: 3 - name: Unconditionally reboot the machine with all defaults become: true ansible.builtin.reboot: - name: Wait for system to get ready ansible.builtin.command: show system status register: result changed_when: false until: result.stdout.find("System is ready") >= 0 retries: 15 delay: 15