Juniper / ansible-junos-stdlib

Junos modules for Ansible
Apache License 2.0
307 stars 158 forks source link

Software update fails with "You must provide either 'host' or 'sock_fd' value" #608

Closed mactizzle closed 6 months ago

mactizzle commented 1 year ago

Issue Type

Module Name

junipernetworks.junos.junos_package

juniper.device collection and Python libraries version

ansible [core 2.14.1]
  config file = /home/ansuser/.ansible.cfg
  configured module search path = ['/home/ansuser/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ansuser/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/ansuser/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/ansuser/.local/bin/ansible
  python version = 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True

aiohttp==3.8.3
aiosignal==1.3.1
ansible-base==2.10.8
ansible-compat==2.2.7
ansible-core==2.14.1
ansible-lint==6.11.0
apache-libcloud==3.2.0
argcomplete==1.8.1
async-timeout==4.0.2
attrs==21.2.0
Automat==20.2.0
Babel==2.8.0
bcrypt==3.2.0
black==22.12.0
blinker==1.4
bracex==2.3.post1
certifi==2020.6.20
cffi==1.15.1
chardet==4.0.0
charset-normalizer==2.1.1
click==8.0.3
cloud-init==22.4.2
colorama==0.4.4
command-not-found==0.3
commonmark==0.9.1
configobj==5.0.6
configparser==5.3.0
constantly==15.1.0
cryptography==3.4.8
dbus-python==1.2.18
distro==1.7.0
distro-info===1.1build1
dnspython==2.1.0
filelock==3.9.0
frozenlist==1.3.3
future==0.18.2
gpg===1.16.0-unknown
httplib2==0.20.2
hyperlink==21.0.0
icdiff==1.9.1
idna==3.3
importlib-metadata==4.6.4
incremental==21.3.0
jeepney==0.7.1
Jinja2==3.0.3
jmespath==0.10.0
jsnapy==1.3.7
jsonpatch==1.32
jsonpointer==2.0
jsonschema==4.17.3
junos-eznc==2.6.6
jxmlease==1.0.3
keyring==23.5.0
launchpadlib==1.10.16
lazr.restfulclient==0.14.4
lazr.uri==1.0.6
lockfile==0.12.2
lxml==4.9.2
MarkupSafe==2.0.1
more-itertools==8.10.0
multidict==6.0.4
mypy-extensions==0.4.3
ncclient==0.6.13
netaddr==0.8.0
netifaces==0.11.0
ntlm-auth==1.4.0
oauthlib==3.2.0
packaging==21.3
paramiko==2.12.0
pathspec==0.10.3
pexpect==4.8.0
platformdirs==2.6.2
ptyprocess==0.7.0
pyasn1==0.4.8
pyasn1-modules==0.2.1
pycparser==2.21
pycryptodomex==3.11.0
Pygments==2.14.0
PyGObject==3.42.1
PyHamcrest==2.0.2
PyJWT==2.3.0
pykerberos==1.1.14
PyNaCl==1.5.0
pynetbox==7.0.0
pyOpenSSL==21.0.0
pyparsing==2.4.7
pyrsistent==0.18.1
pyserial==3.5
python-apt==2.4.0
python-debian===0.1.43ubuntu1
python-magic==0.4.24
pytz==2022.1
pyvmomi==8.0.0.1.1
pywinrm==0.3.0
PyYAML==5.4.1
requests==2.25.1
requests-kerberos==0.12.0
requests-ntlm==1.1.0
requests-toolbelt==0.9.1
resolvelib==0.8.1
rich==13.1.0
ruamel.yaml==0.17.21
ruamel.yaml.clib==0.2.7
scp==0.14.4
SecretStorage==3.3.1
selinux==3.3
service-identity==18.1.0
simplejson==3.17.6
six==1.16.0
sos==4.4
ssh-import-id==5.11
subprocess-tee==0.4.1
systemd-python==234
tomli==2.0.1
transitions==0.9.0
Twisted==22.1.0
ubuntu-advantage-tools==27.12
ubuntu-drivers-common==0.0.0
ufw==0.36.1
unattended-upgrades==0.1
urllib3==1.26.5
wadllib==1.3.6
wcmatch==8.4.1
xkit==0.0.0
xmltodict==0.12.0
yamllint==1.29.0
yamlordereddictloader==0.4.0
yarl==1.8.2
zipp==1.0.0
zope.interface==5.4.0

OS / Environment

ACX710 (JUNOS 20.2R1.10)

Summary

While attempting an upgrade from 20.2R1.10 to 21.4R1-S2.3 on an ACX-710, junipernetworks.junos.junos_package fails with "You must provide either 'host' or 'sock_fd' value"

Steps to reproduce

Please see playbook below.

---
- name: Upgrade OS on Juniper Devices
  hosts: juniper_upgrade
  gather_facts: false
  collections:
    - junipernetworks.junos
    - ansible.builtin
  vars:
    - acx710_file: /home/ansuser/ansible/files/software/juniper/junos-install-acx-arm-64-21.4R1-S2.3.tgz
    - reboot_wait_time: 3600
    - ansible_connection: ansible.netcommon.netconf
  tasks:
    - name: Verify NETCONF connectivity
      ansible.builtin.wait_for:
        timeout: 10

    - name: Upgrade software on ACX710
      junipernetworks.junos.junos_package:
        src: "{{ acx710_file }}"
        validate: true
      when: "'ACX71' in inventory_hostname"
      register: acx710_response

    - name: Print the response
      ansible.builtin.debug:
        msg: "{{ acx710_response }}"

  handlers:
    - name: Wait for the device to come online
      ansible.builtin.wait_for:
        timeout: "{{ reboot_wait_time }}"
      when: not response.check_mode

Expected results

Output similar to the example playbook

TASK [Print response] ******************************************************
ok: [mx1a.example.com] => {
    "response": {
        "changed": true,
        "check_mode": false,
        "failed": false,
        "msg": "Package /home/user/ansible/software/junos-install-mx-x86-64-20.3R1.8.tgz successfully installed. Response from device is: \nVerified junos-install-mx-x86-64-20.3R1.8 signed by PackageProductionECP256_2020 method ECDSA256+SHA256\nVerified manifest signed by PackageProductionECP256_2020 method ECDSA256+SHA256\n
[...output truncated...]
NOTICE: 'pending' set will be activated at next reboot... Reboot successfully initiated. Reboot message: Shutdown NOW! [pid 83918]"
    }
}

Actual results

ansuser@network-ansible:~/ansible$ ansible-playbook playbooks/junos/junos-release-upgrade.yaml --ask-vault-pass -vvvv 
ansible-playbook [core 2.14.1]
  config file = /home/ansuser/.ansible.cfg
  configured module search path = ['/home/ansuser/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ansuser/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/ansuser/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/ansuser/.local/bin/ansible-playbook
  python version = 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True
Using /home/ansuser/.ansible.cfg as config file
Vault password: 
setting up inventory plugins
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
yaml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
ini declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
toml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
setting up inventory plugins
host_list declined parsing /home/ansuser/ansible/hosts as it did not pass its verify_file() method
script declined parsing /home/ansuser/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /home/ansuser/ansible/hosts as it did not pass its verify_file() method
Skipping empty key (hosts) in group (all)
Skipping empty key (children) in group (all)
Parsed /home/ansuser/ansible/hosts inventory source with yaml plugin
setting up inventory plugins
host_list declined parsing /home/ansuser/ansible/inventory/juniper.yaml as it did not pass its verify_file() method
script declined parsing /home/ansuser/ansible/inventory/juniper.yaml as it did not pass its verify_file() method
Parsed /home/ansuser/ansible/inventory/juniper.yaml inventory source with yaml plugin
setting up inventory plugins
host_list declined parsing /home/ansuser/ansible/inventory/linux.yaml as it did not pass its verify_file() method
script declined parsing /home/ansuser/ansible/inventory/linux.yaml as it did not pass its verify_file() method
Parsed /home/ansuser/ansible/inventory/linux.yaml inventory source with yaml plugin
setting up inventory plugins
host_list declined parsing /home/ansuser/ansible/inventory/other.yaml as it did not pass its verify_file() method
script declined parsing /home/ansuser/ansible/inventory/other.yaml as it did not pass its verify_file() method
Parsed /home/ansuser/ansible/inventory/other.yaml inventory source with yaml plugin
setting up inventory plugins
host_list declined parsing /home/ansuser/ansible/inventory/windows.yaml as it did not pass its verify_file() method
script declined parsing /home/ansuser/ansible/inventory/windows.yaml as it did not pass its verify_file() method
Parsed /home/ansuser/ansible/inventory/windows.yaml inventory source with yaml plugin
Loading collection junipernetworks.junos from /home/ansuser/.ansible/collections/ansible_collections/junipernetworks/junos
redirecting (type: action) junipernetworks.junos.junos_package to junipernetworks.junos.junos
Loading callback plugin default of type stdout, v2.0 from /home/ansuser/.local/lib/python3.10/site-packages/ansible/plugins/callback/default.py
Loading collection juniper.device from /home/ansuser/.ansible/collections/ansible_collections/juniper/device
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
Loading callback plugin jsnapy of type aggregate, v2.0 from /home/ansuser/.ansible/collections/ansible_collections/juniper/device/plugins/callback/jsnapy.py

PLAYBOOK: junos-release-upgrade.yaml *************************************************************************************************************************************************************
Positional arguments: playbooks/junos/junos-release-upgrade.yaml
verbosity: 4
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/etc/ansible/hosts', '/home/ansuser/ansible/hosts', '/home/ansuser/ansible/inventory')
ask_vault_pass: True
forks: 5
1 plays in playbooks/junos/junos-release-upgrade.yaml

PLAY [Upgrade OS on Juniper Devices] *************************************************************************************************************************************************************
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f32a430ed10> for vault_id=default

TASK [Verify NETCONF connectivity] ***************************************************************************************************************************************************************
task path: /home/ansuser/ansible/playbooks/junos/junos-release-upgrade.yaml:13
Loading collection ansible.netcommon from /home/ansuser/.ansible/collections/ansible_collections/ansible/netcommon
<10.0.5.171> attempting to start connection
<10.0.5.171> using connection plugin ansible.netcommon.netconf
Found ansible-connection at path /home/ansuser/.local/bin/ansible-connection
<10.0.5.171> local domain socket does not exist, starting it
<10.0.5.171> control socket path is /home/ansuser/.ansible/pc/ce32ca3339
<10.0.5.171> Loading collection ansible.netcommon from /home/ansuser/.ansible/collections/ansible_collections/ansible/netcommon
<10.0.5.171> Loading collection junipernetworks.junos from /home/ansuser/.ansible/collections/ansible_collections/junipernetworks/junos
<10.0.5.171> local domain socket listeners started successfully
<10.0.5.171> loaded netconf plugin ansible_collections.junipernetworks.junos.plugins.netconf.junos from path /home/ansuser/.ansible/collections/ansible_collections/junipernetworks/junos/plugins/netconf/junos.py for network_os junipernetworks.junos.junos
<10.0.5.171> 
<10.0.5.171> local domain socket path is /home/ansuser/.ansible/pc/ce32ca3339
<10.0.5.171> ESTABLISH LOCAL CONNECTION FOR USER: ansuser
<10.0.5.171> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/ansuser/.ansible/tmp/ansible-local-593626l3b3g9n7 `"&& mkdir "` echo /home/ansuser/.ansible/tmp/ansible-local-593626l3b3g9n7/ansible-tmp-1674759167.30492-593645-57349455010063 `" && echo ansible-tmp-1674759167.30492-593645-57349455010063="` echo /home/ansuser/.ansible/tmp/ansible-local-593626l3b3g9n7/ansible-tmp-1674759167.30492-593645-57349455010063 `" ) && sleep 0'
Using module file /home/ansuser/.local/lib/python3.10/site-packages/ansible/modules/wait_for.py
<10.0.5.171> PUT /home/ansuser/.ansible/tmp/ansible-local-593626l3b3g9n7/tmp0z62qdn8 TO /home/ansuser/.ansible/tmp/ansible-local-593626l3b3g9n7/ansible-tmp-1674759167.30492-593645-57349455010063/AnsiballZ_wait_for.py
<10.0.5.171> EXEC /bin/sh -c 'chmod u+x /home/ansuser/.ansible/tmp/ansible-local-593626l3b3g9n7/ansible-tmp-1674759167.30492-593645-57349455010063/ /home/ansuser/.ansible/tmp/ansible-local-593626l3b3g9n7/ansible-tmp-1674759167.30492-593645-57349455010063/AnsiballZ_wait_for.py && sleep 0'
<10.0.5.171> EXEC /bin/sh -c '/usr/bin/python3 /home/ansuser/.ansible/tmp/ansible-local-593626l3b3g9n7/ansible-tmp-1674759167.30492-593645-57349455010063/AnsiballZ_wait_for.py && sleep 0'
<10.0.5.171> EXEC /bin/sh -c 'rm -f -r /home/ansuser/.ansible/tmp/ansible-local-593626l3b3g9n7/ansible-tmp-1674759167.30492-593645-57349455010063/ > /dev/null 2>&1 && sleep 0'
ok: [ACX71-HDSC-0] => {
    "changed": false,
    "elapsed": 10,
    "invocation": {
        "module_args": {
            "active_connection_states": [
                "ESTABLISHED",
                "FIN_WAIT1",
                "FIN_WAIT2",
                "SYN_RECV",
                "SYN_SENT",
                "TIME_WAIT"
            ],
            "connect_timeout": 5,
            "delay": 0,
            "exclude_hosts": null,
            "host": "127.0.0.1",
            "msg": null,
            "path": null,
            "port": null,
            "search_regex": null,
            "sleep": 1,
            "state": "started",
            "timeout": 10
        }
    },
    "match_groupdict": {},
    "match_groups": [],
    "path": null,
    "port": null,
    "search_regex": null,
    "state": "started"
}
redirecting (type: action) junipernetworks.junos.junos_package to junipernetworks.junos.junos
Loading collection ansible.netcommon from /home/ansuser/.ansible/collections/ansible_collections/ansible/netcommon

TASK [Upgrade software on ACX710] ****************************************************************************************************************************************************************
task path: /home/ansuser/ansible/playbooks/junos/junos-release-upgrade.yaml:17
<10.0.5.171> attempting to start connection
<10.0.5.171> using connection plugin ansible.netcommon.netconf
Found ansible-connection at path /home/ansuser/.local/bin/ansible-connection
<10.0.5.171> found existing local domain socket, using it!
<10.0.5.171> 
<10.0.5.171> local domain socket path is /home/ansuser/.ansible/pc/ce32ca3339
redirecting (type: action) junipernetworks.junos.junos_package to junipernetworks.junos.junos
redirecting (type: action) junipernetworks.junos.junos_package to junipernetworks.junos.junos
<10.0.5.171> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<10.0.5.171> ANSIBLE_NETWORK_IMPORT_MODULES: found junipernetworks.junos.junos_package  at /home/ansuser/.ansible/collections/ansible_collections/junipernetworks/junos/plugins/modules/junos_package.py
<10.0.5.171> ANSIBLE_NETWORK_IMPORT_MODULES: running junipernetworks.junos.junos_package
<10.0.5.171> ANSIBLE_NETWORK_IMPORT_MODULES: complete
fatal: [ACX71-HDSC-0]: FAILED! => {
    "changed": false,
    "module_stderr": "You must provide either 'host' or 'sock_fd' value",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}

PLAY RECAP ***************************************************************************************************************************************************************************************
ACX71-HDSC-0               : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
mactizzle commented 1 year ago

After much wringing of the hands, I tried a different approach using the Juniper.junos role. From Understanding the Ansible for Junos OS Collections, Roles, and Modules, it says "In Ansible 2.9 and earlier, you can manage devices running Junos OS by using the modules provided in the Juniper Networks Juniper.junos role or by using the core modules provided as part of the Ansible base installation. Starting in Ansible 2.10, the Juniper.junos role and the Ansible core modules are superseded by the corresponding collection."

Nevertheless, I tried using the Juniper.junos role and juniper_junos_software module:

- name: Upgrade OS on Juniper Devices
  hosts: juniper_upgrade
  gather_facts: false
  roles:
   - Juniper.junos
  collections:
   - juniper.device
  vars:
   local_file_dir: /home/ansuser/ansible/files/software/juniper
   network_util_dir: /home/juniper-backup/software
   log_dir: "{{ playbook_dir }}/logs"
   wait_time: 3600
   ansible_user: network-ansible
   ansible_ssh_key: /home/ansuser/.ssh/id_rsa
   acx710_file: junos-install-acx-arm-64-21.4R1-S2.3.tgz

  tasks:
   - name: Verify NETCONF connectivity
     ansible.builtin.wait_for:
      host: "{{ inventory_hostname }}"
      timeout: 5

# ------------- ACX710 ---------------
   - name: Transfer install file to Ansible machine
     delegate_to: localhost
     ansible.builtin.command:
      cmd: "scp ansuser@172.16.201.50:{{ network_util_dir }}/acx710/{{ acx710_file }} {{ local_file_dir }}/{{ acx710_file }}"
     when: "'ACX71' in inventory_hostname"

   - name: Upgrade software on ACX710
     juniper_junos_software:
      local_package: "{{ local_file_dir }}/{{ acx710_file }}"
      validate: false
      checksum_timeout: 420
      cleanfs_timeout: 600
      install_timeout: 2000
      logfile: "{{ log_dir }}/{{ inventory_hostname }}.log"
     when: "'ACX71' in inventory_hostname"
     register: upgrade_response
     notify:
      - Wait_for_reboot

   - name: Print the response
     ansible.builtin.debug:
      msg: "{{ upgrade_response }}"
     when: "'ACX71' in inventory_hostname"

   - name: Delete the temporary installation file from Ansible host
     delegate_to: localhost
     ansible.builtin.file:
      path: "{{ local_file_dir }}/{{ acx710_file }}"
      state: absent
     when: "'ACX71' in inventory_hostname"

# ------------- ( END OF JUNIPER MODELS ) ---------------
  handlers:
   - name: Wait_for_reboot
     ansible.builtin.wait_for:
      host: "{{ inventory_hostname }}"
      timeout: "{{ wait_time }}"
     when: not upgrade_response.check_mode

This was successful, leading me to believe something is missing from junipernetworks.junos and juniper.device collections (I get a separate issue while using juniper.device)

crab86 commented 1 year ago

I know that this type of error "You must provide either 'host' or 'sock_fd' value" can be mitigated setting paramiko as ssh_type. Maybe you can give it a try.

FlorianHeigl commented 1 year ago

Can see the same issue, tried setting paramiko, in multiple ways but none worked out.

In other attempts I hit either https://github.com/ansible/ansible/issues/68034 or netconf will not be working as in https://github.com/ansible/ansible/issues/50162 and the non-deprecated [put module[(https://docs.ansible.com/ansible/latest/collections/ansible/netcommon/net_put_module.html#ansible-collections-ansible-netcommon-net-put-module) also doesn't work.

I'm at a loss and do hope Juniper can throw sufficient resources at this - so there will again a clear path that works well.

For the record, I intentionally broke stuff with the above tests and my own playbooks, removing ansible_network_os and ansible_connection from hosts and it triggered this:

            "ssh_config": null,
            "ssh_private_key_file": null
        }
    },
    "item": "/Users/floh/training/junos/scripts/roles/junos_day1/files/stp.slax",
    "msg": "junos-eznc is required but does not appear to be installed. It can be installed using `pip install junos-eznc`"
}

Installing it had absolutely no effect, putting me back at with the ACX example from above and mine.

    "msg": "You must provide either 'host' or 'sock_fd' value"

It'll always be the SCP affected, I have not found a workaround yet.

crab86 commented 1 year ago

In my experience juniper.device modules ONLY work with local connection type. So try setting local connection type. Either for the whole play or for a single tasks, which is using juniper.device modules.

chidanandpujar commented 1 year ago

Hi @mactizzle Please try to verify the JUNOS upgrade using juniper.device collections and share the results .

https://github.com/Juniper/ansible-junos-stdlib/blob/master/tests/pb.juniper_junos_software.yml

Thanks

mactizzle commented 1 year ago

Hi @chidanandpujar , since opening this we have manually upgraded all of the 710s in our network so I no longer have any to test on. I do have quite a few ACX2100s that are currently in an upgrade cycle (15.1R3.6 > 21.2R3-S6.11). If you think testing on those will prove useful for this issue then I'll give it a shot. Otherwise I can see about getting a spare 710 from our warehouse to bench-test.

I do foresee hitting PR1568757 (must use no-validate when upgrading Pre 21.2 to 21.2 and onward), so I will need to add validate: False to the juniper.device.software stanza.

Will this work for your test?

EDIT: disregard... lapse of memory. We can only upgrade the ACX2100s via USB since the version jump is so big. I'll post back if I can bench-test a 710, otherwise hopefully someone else can chime in here.

chidanandpujar commented 1 year ago

Hi @mactizzle Thanks very much for sharing the information . Please give me some time , I will check if I can borrow a ACX710s and test the upgrade scenario 20.2R1.10 to 21.4R1-S2.3 .

Thanks

chidanandpujar commented 6 months ago

Hi @mactizzle , I have verified the software installation on ACX710 with connection: local and connection: juniper.device.pyez, both looks to be working fine with following versions . Please check and confirm, if it is working fine, shall we close this issue for now .

ansible --version
ansible [core 2.16.6]
  config file = /root/ansible_release_v216_test/ansible-junos-stdlib/tests/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /root/ansible_release_v216_test/venv/lib/python3.10/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /root/ansible_release_v216_test/venv/bin/ansible
  python version = 3.10.8 (main, Dec  2 2022, 10:56:46) [GCC 7.5.0] (/root/ansible_release_v216_test/venv/bin/python)
  jinja version = 3.1.4
  libyaml = True

# /root/.ansible/collections/ansible_collections
Collection                               Version
---------------------------------------- -------
ansible.netcommon                        4.1.0  
ansible.utils                            2.8.0  
juniper.device                           1.0.4  

---
- name: Test juniper.device.software module
  hosts: all
  collections:
    - juniper.device
  gather_facts: no
  vars:
    wait_time: 3600
    pkg_dir: /var/tmp/
    OS_version: 24.2
    OS_package: junos-install-acx-arm-64-24..2.tgz 
    log_dir: /var/log/

  tasks:
    - name: Checking NETCONF connectivity
      wait_for: host={{ ansible_ssh_host }} port=830 timeout=5
    - name: Install Junos OS package
      software:
        reboot: False 
        no_copy: True 
        all_re: True 
        version: "{{ OS_version }}"
        package: "{{ pkg_dir }}/{{ OS_package }}"
        logfile: "{{ log_dir }}/software.log"
      register: test1
      notify:
        - wait_reboot

    - name: Print response
      debug:
        var: test1

    - name: Check TEST - 1
      assert:
        that:
          - test1.failed == false

  handlers:
    - name: wait_reboot
      wait_for: host={{ ansible_ssh_host }} port=830 timeout={{ wait_time }}
      when: not test1.check_mode

 ansible-playbook pb.juniper_junos_software.yml 

PLAY [Test juniper.device.software module] ********************************************************************************************************************************

TASK [Checking NETCONF connectivity] **************************************************************************************************************************************
ok: [local_connection_testcases]

TASK [Install Junos OS package] *******************************************************************************************************************************************
changed: [local_connection_testcases]

TASK [Print response] *****************************************************************************************************************************************************
ok: [local_connection_testcases] => {
    "test1": {
        "changed": true,
        "check_mode": false,
        "failed": false,
        "msg": "Package /var/tmp/junos-install-acx-arm-64-24.2.tgz successfully installed. Response from device is: \nVerified junos-install-acx-arm-64-24.2I-20240330.0.1659 signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified auto-snapshot signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified deebe signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified dsa signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified fips-mode signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified jail-runtime signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified jdocs signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified jinsight signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified jpfe-acx-arm signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified jsd-jet-1 signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified jsdn signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-daemons-mx signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-daemons signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-dp-crypto-support-mtx signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-l2-rsi signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-libs-compat32-mx signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-libs-compat32 signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-libs-mx signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-libs signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-modules-acx signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-modules signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-net-mtx-prd signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-net-prd signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-openconfig signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-platform signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-probe signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-routing-aggregated signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-routing-controller-external signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-routing-lsys signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-routing-mpls-oam-advanced signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-routing-mpls-oam-basic signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-routing-scripts signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-rpd-telemetry-application signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-runtime-acx signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified junos-runtime signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified na-telemetry signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified oam-efi signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified os-boot-efi signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified os-boot-junos-efi signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified os-compat32 signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified os-crypto signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified os-efi signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified os-forward-compat-11 signed by PackageDevelopmentECP256_2023 method ECDSA256+SHA256\nVerified os-kernel-prd signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified os-libs-compat32 signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified os-libs signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified os-modules-net signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified os-package signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified os-runtime signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified os-zoneinfo signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified py-base signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified py-extensions signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nVerified sflow-mx signed by PackageDevelopmentECP256_2024 method ECDSA256+SHA256\nNOTICE: 'pending' set will be activated at next reboot...\n"
    }
}

TASK [Check TEST - 1] *****************************************************************************************************************************************************
ok: [local_connection_testcases] => {
    "changed": false,
    "msg": "All assertions passed"
}

RUNNING HANDLER [wait_reboot] *********************************************************************************************************************************************
ok: [local_connection_testcases]

PLAY RECAP ****************************************************************************************************************************************************************
local_connection_testcases : ok=5    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Thanks Chidanand

chidanandpujar commented 6 months ago

Hi @mactizzle , We have verified the software installation on ACX710, it looks to be working fine. I have already provided the pass logs above. We are closing the issue as of now , please feel to re-open or submit new one .

Thanks Chidanand