这是我在这里的第一个问题,我很兴奋:)
这可能是一个菜鸟问题,但我不明白......
我正在尝试使用 Gitlab-CI 和 Ansible升级 Edgerouter 固件(https://www.ui.com/edgemax/edgerouter-pro/ )。这些阶段是绝对相同的,但相同任务的标准输出、相同的 ansible.cfg、相同的 gitlab-runner、相同的管道等不同:
STAGE1
CI Deployment Docker Image:
ansible-playbook 2.8.3
python version = 3.7.4
Edgerouter:
USER1@HOSTNAME1:~$ python --version
Python 2.7.13
USER1@HOSTNAME1:~$ show system image
The system currently has the following image(s) installed:
v2.0.8.5247496.191120.1124 (running image) (default boot)
v2.0.8.5247496.191120.1124-1
OUTPUT
...identical verbose output, but:
ok: [HOSTNAME1] => changed=false
invocation:
module_args:
commands:
- show version | grep "Build ID" | cut -d ':' -f 2 | tr -d ' '
interval: 1
match: all
retries: 10
wait_for: null
stdout:
- '5247496'
stdout_lines: <omitted>
奇迹般有效!但:
STAGE2
CI Deployment Image:
ansible-playbook 2.8.3
python version = 3.7.4
Edgerouter
USER2@HOSTNAME2:~$ python --version
Python 2.7.13
USER2@HOSTNAME2:~$ show system image
The system currently has the following image(s) installed:
v2.0.8.5247496.191120.1124 (running image) (default boot)
v2.0.8.5247496.191120.1124-1
OUTPUT
...identical verbose output, but:
ok: [HOSTNAME2] => changed=false
invocation:
module_args:
commands:
- show version | grep "Build ID" | cut -d ':' -f 2 | tr -d ' '
interval: 1
match: all
retries: 10
wait_for: null
stdout:
- |-
show version | grep "Build ID" | cut -d ':' -f 2 |
tr -d ' '
5247496
stdout_lines: <omitted>
不...这是 Ansible 任务:
- name: get installed firmware build ID to compare with config
edgeos_command:
commands: show version | grep "Build ID" | cut -d ':' -f 2 | tr -d ' '
register: installed_firmware_build_id
tags: router-upgrade
我在这里想念什么?