I’m trying to execute commands with fortios module via ssh – username and password. (Not ssh key)
‘”‘”‘echo ~admin && sleep 0′”‘”” is being used by ssh even though I have mentioned ansible_network_os=fortinet.fortios.fortios
in the inventory file.
The commands using raw works but I’m unable to use any of the fortios modules. The same error occurs everytime.
hosts_css (Inventory):
Hello ansible_host=10.172.139.2 ansible_user=admin ansible_password=<password> ansible_ssh_extra_args='-o StrictHostKeyChecking=no' ansible_connection=ssh
ansible_network_os=fortinet.fortios.fortios
<code>[testing]
Hello ansible_host=10.172.139.2 ansible_user=admin ansible_password=<password> ansible_ssh_extra_args='-o StrictHostKeyChecking=no' ansible_connection=ssh
[all:vars]
ansible_network_os=fortinet.fortios.fortios
</code>
[testing]
Hello ansible_host=10.172.139.2 ansible_user=admin ansible_password=<password> ansible_ssh_extra_args='-o StrictHostKeyChecking=no' ansible_connection=ssh
[all:vars]
ansible_network_os=fortinet.fortios.fortios
pls.yml (playbook):
- name: Get system status using CLI
register: system_status_output
var: system_status_output.stdout_lines
- name: Get license status
fortinet.fortios.fortios_monitor_fact:
- selector: license_status
- selector: system_status
- selector: firewall_security-policy
<code>- hosts: testing
gather_facts: no
collections:
- fortinet.fortios
tasks:
- name: Get system status using CLI
raw: get system status
register: system_status_output
- debug:
var: system_status_output.stdout_lines
- name: Get license status
fortinet.fortios.fortios_monitor_fact:
vdom: root
selectors:
- selector: license_status
- selector: system_status
- selector: firewall_security-policy
params:
policyid: '1'
</code>
- hosts: testing
gather_facts: no
collections:
- fortinet.fortios
tasks:
- name: Get system status using CLI
raw: get system status
register: system_status_output
- debug:
var: system_status_output.stdout_lines
- name: Get license status
fortinet.fortios.fortios_monitor_fact:
vdom: root
selectors:
- selector: license_status
- selector: system_status
- selector: firewall_security-policy
params:
policyid: '1'
ansible.cfg:
interpreter_python=/usr/local/bin/python
host_key_checking = false
<code>[defaults]
interpreter_python=/usr/local/bin/python
host_key_checking = false
</code>
[defaults]
interpreter_python=/usr/local/bin/python
host_key_checking = false
Task with raw module gets executed properly:
<code>TASK [Get system status using CLI] ************************************************************************************************************************************************************************
task path: /home/tejas/Ansible/pls.yml:7
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' -tt 10.172.139.2 'get system status'
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # Version: FortiGate-100F v6.2.3,build6188,200109 (GA)rnFirmware Signature: certified
debug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rnShared connection to 10.172.139.2 closed.rn')
<code>TASK [Get system status using CLI] ************************************************************************************************************************************************************************
task path: /home/tejas/Ansible/pls.yml:7
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' -tt 10.172.139.2 'get system status'
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # Version: FortiGate-100F v6.2.3,build6188,200109 (GA)rnFirmware Signature: certified
.......
debug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rnShared connection to 10.172.139.2 closed.rn')
</code>
TASK [Get system status using CLI] ************************************************************************************************************************************************************************
task path: /home/tejas/Ansible/pls.yml:7
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' -tt 10.172.139.2 'get system status'
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # Version: FortiGate-100F v6.2.3,build6188,200109 (GA)rnFirmware Signature: certified
.......
debug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rnShared connection to 10.172.139.2 closed.rn')
This is the debug output for Get license status task which I tried to execute with fortinet.fortios.fortios_monitor_fact:
<code>TASK [Get license status] *********************************************************************************************************************************************************************************
task path: /home/tejas/Ansible/pls.yml:14
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' 10.172.139.2 '/bin/sh -c '"'"'echo ~admin && sleep 0'"'"''
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # ntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rn8278: Unknown action 0nCommand fail. Return code -1ndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rn')
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' 10.172.139.2 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo trondheim02-vpn-1-mgmt #/.ansible/tmp `"&& mkdir "` echo trondheim02-vpn-1-mgmt #/.ansible/tmp/ansible-tmp-1721587091.1048012-8344-202590340256464 `" && echo ansible-tmp-1721587091.1048012-8344-202590340256464="` echo trondheim02-vpn-1-mgmt #/.ansible/tmp/ansible-tmp-1721587091.1048012-8344-202590340256464 `" ) && sleep 0'"'"''
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # ntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rn8278: Unknown action 0nCommand fail. Return code -1ndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rn')
Using module file /home/tejas/.ansible/collections/ansible_collections/fortinet/fortios/plugins/modules/fortios_monitor_fact.py
<10.172.139.2> PUT /home/tejas/.ansible/tmp/ansible-local-8321msrd7qqs/tmp2l6h9yru TO trondheim02-vpn-1-mgmt #/AnsiballZ_fortios_monitor_fact.py
<10.172.139.2> SSH: EXEC sshpass -d12 sftp -o BatchMode=no -b - -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' '[10.172.139.2]'
[WARNING]: sftp transfer mechanism failed on [10.172.139.2]. Use ANSIBLE_DEBUG=1 to see detailed information
<10.172.139.2> SSH: EXEC sshpass -d12 scp -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' /home/tejas/.ansible/tmp/ansible-local-8321msrd7qqs/tmp2l6h9yru '[10.172.139.2]:'"'"'trondheim02-vpn-1-mgmt #/AnsiballZ_fortios_monitor_fact.py'"'"''
[WARNING]: scp transfer mechanism failed on [10.172.139.2]. Use ANSIBLE_DEBUG=1 to see detailed information
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' 10.172.139.2 'dd of=trondheim02-vpn-1-mgmt #/AnsiballZ_fortios_monitor_fact.py bs=65536'
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # ntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rn8278: Unknown action 0nCommand fail. Return code -1ndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rn')
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # ntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rn8278: Unknown action 0nCommand fail. Return code -1ndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rn')
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' 10.172.139.2 '/bin/sh -c '"'"'chmod u+x '"'"'"'"'"'"'"'"'trondheim02-vpn-1-mgmt #/'"'"'"'"'"'"'"'"' '"'"'"'"'"'"'"'"'trondheim02-vpn-1-mgmt #/AnsiballZ_fortios_monitor_fact.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # ntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rn8278: Unknown action 0nCommand fail. Return code -1ndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rn')
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' -tt 10.172.139.2 '/bin/sh -c '"'"'/usr/local/bin/python '"'"'"'"'"'"'"'"'trondheim02-vpn-1-mgmt #/AnsiballZ_fortios_monitor_fact.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # 8278: Unknown action 0rnCommand fail. Return code -1rnrntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rnShared connection to 10.172.139.2 closed.rn')
fatal: [Hello]: FAILED! => {
"module_stderr": "OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rnShared connection to 10.172.139.2 closed.rn",
"module_stdout": "trondheim02-vpn-1-mgmt # 8278: Unknown action 0rnCommand fail. Return code -1rnrntrondheim02-vpn-1-mgmt # ",
"msg": "MODULE FAILUREnSee stdout/stderr for the exact error",
<code>TASK [Get license status] *********************************************************************************************************************************************************************************
task path: /home/tejas/Ansible/pls.yml:14
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' 10.172.139.2 '/bin/sh -c '"'"'echo ~admin && sleep 0'"'"''
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # ntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rn8278: Unknown action 0nCommand fail. Return code -1ndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rn')
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' 10.172.139.2 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo trondheim02-vpn-1-mgmt #/.ansible/tmp `"&& mkdir "` echo trondheim02-vpn-1-mgmt #/.ansible/tmp/ansible-tmp-1721587091.1048012-8344-202590340256464 `" && echo ansible-tmp-1721587091.1048012-8344-202590340256464="` echo trondheim02-vpn-1-mgmt #/.ansible/tmp/ansible-tmp-1721587091.1048012-8344-202590340256464 `" ) && sleep 0'"'"''
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # ntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rn8278: Unknown action 0nCommand fail. Return code -1ndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rn')
Using module file /home/tejas/.ansible/collections/ansible_collections/fortinet/fortios/plugins/modules/fortios_monitor_fact.py
<10.172.139.2> PUT /home/tejas/.ansible/tmp/ansible-local-8321msrd7qqs/tmp2l6h9yru TO trondheim02-vpn-1-mgmt #/AnsiballZ_fortios_monitor_fact.py
<10.172.139.2> SSH: EXEC sshpass -d12 sftp -o BatchMode=no -b - -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' '[10.172.139.2]'
[WARNING]: sftp transfer mechanism failed on [10.172.139.2]. Use ANSIBLE_DEBUG=1 to see detailed information
<10.172.139.2> SSH: EXEC sshpass -d12 scp -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' /home/tejas/.ansible/tmp/ansible-local-8321msrd7qqs/tmp2l6h9yru '[10.172.139.2]:'"'"'trondheim02-vpn-1-mgmt #/AnsiballZ_fortios_monitor_fact.py'"'"''
[WARNING]: scp transfer mechanism failed on [10.172.139.2]. Use ANSIBLE_DEBUG=1 to see detailed information
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' 10.172.139.2 'dd of=trondheim02-vpn-1-mgmt #/AnsiballZ_fortios_monitor_fact.py bs=65536'
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # ntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rn8278: Unknown action 0nCommand fail. Return code -1ndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rn')
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # ntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rn8278: Unknown action 0nCommand fail. Return code -1ndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rn')
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' 10.172.139.2 '/bin/sh -c '"'"'chmod u+x '"'"'"'"'"'"'"'"'trondheim02-vpn-1-mgmt #/'"'"'"'"'"'"'"'"' '"'"'"'"'"'"'"'"'trondheim02-vpn-1-mgmt #/AnsiballZ_fortios_monitor_fact.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # ntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rn8278: Unknown action 0nCommand fail. Return code -1ndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rn')
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' -tt 10.172.139.2 '/bin/sh -c '"'"'/usr/local/bin/python '"'"'"'"'"'"'"'"'trondheim02-vpn-1-mgmt #/AnsiballZ_fortios_monitor_fact.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # 8278: Unknown action 0rnCommand fail. Return code -1rnrntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rnShared connection to 10.172.139.2 closed.rn')
fatal: [Hello]: FAILED! => {
"changed": false,
"module_stderr": "OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rnShared connection to 10.172.139.2 closed.rn",
"module_stdout": "trondheim02-vpn-1-mgmt # 8278: Unknown action 0rnCommand fail. Return code -1rnrntrondheim02-vpn-1-mgmt # ",
"msg": "MODULE FAILUREnSee stdout/stderr for the exact error",
"rc": 0
}
</code>
TASK [Get license status] *********************************************************************************************************************************************************************************
task path: /home/tejas/Ansible/pls.yml:14
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' 10.172.139.2 '/bin/sh -c '"'"'echo ~admin && sleep 0'"'"''
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # ntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rn8278: Unknown action 0nCommand fail. Return code -1ndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rn')
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' 10.172.139.2 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo trondheim02-vpn-1-mgmt #/.ansible/tmp `"&& mkdir "` echo trondheim02-vpn-1-mgmt #/.ansible/tmp/ansible-tmp-1721587091.1048012-8344-202590340256464 `" && echo ansible-tmp-1721587091.1048012-8344-202590340256464="` echo trondheim02-vpn-1-mgmt #/.ansible/tmp/ansible-tmp-1721587091.1048012-8344-202590340256464 `" ) && sleep 0'"'"''
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # ntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rn8278: Unknown action 0nCommand fail. Return code -1ndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rn')
Using module file /home/tejas/.ansible/collections/ansible_collections/fortinet/fortios/plugins/modules/fortios_monitor_fact.py
<10.172.139.2> PUT /home/tejas/.ansible/tmp/ansible-local-8321msrd7qqs/tmp2l6h9yru TO trondheim02-vpn-1-mgmt #/AnsiballZ_fortios_monitor_fact.py
<10.172.139.2> SSH: EXEC sshpass -d12 sftp -o BatchMode=no -b - -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' '[10.172.139.2]'
[WARNING]: sftp transfer mechanism failed on [10.172.139.2]. Use ANSIBLE_DEBUG=1 to see detailed information
<10.172.139.2> SSH: EXEC sshpass -d12 scp -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' /home/tejas/.ansible/tmp/ansible-local-8321msrd7qqs/tmp2l6h9yru '[10.172.139.2]:'"'"'trondheim02-vpn-1-mgmt #/AnsiballZ_fortios_monitor_fact.py'"'"''
[WARNING]: scp transfer mechanism failed on [10.172.139.2]. Use ANSIBLE_DEBUG=1 to see detailed information
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' 10.172.139.2 'dd of=trondheim02-vpn-1-mgmt #/AnsiballZ_fortios_monitor_fact.py bs=65536'
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # ntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rn8278: Unknown action 0nCommand fail. Return code -1ndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rn')
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # ntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rn8278: Unknown action 0nCommand fail. Return code -1ndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rn')
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' 10.172.139.2 '/bin/sh -c '"'"'chmod u+x '"'"'"'"'"'"'"'"'trondheim02-vpn-1-mgmt #/'"'"'"'"'"'"'"'"' '"'"'"'"'"'"'"'"'trondheim02-vpn-1-mgmt #/AnsiballZ_fortios_monitor_fact.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # ntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rn8278: Unknown action 0nCommand fail. Return code -1ndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rn')
<10.172.139.2> ESTABLISH SSH CONNECTION FOR USER: admin
<10.172.139.2> SSH: EXEC sshpass -d12 ssh -vvvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o 'User="admin"' -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o 'ControlPath="/home/tejas/.ansible/cp/4a0f0783ec"' -tt 10.172.139.2 '/bin/sh -c '"'"'/usr/local/bin/python '"'"'"'"'"'"'"'"'trondheim02-vpn-1-mgmt #/AnsiballZ_fortios_monitor_fact.py'"'"'"'"'"'"'"'"' && sleep 0'"'"''
<10.172.139.2> (0, b'trondheim02-vpn-1-mgmt # 8278: Unknown action 0rnCommand fail. Return code -1rnrntrondheim02-vpn-1-mgmt # ', b'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rnShared connection to 10.172.139.2 closed.rn')
fatal: [Hello]: FAILED! => {
"changed": false,
"module_stderr": "OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug2: fd 3 setting O_NONBLOCKrndebug2: mux_client_hello_exchange: master version 4rndebug3: mux_client_forwards: request forwardings: 0 local, 0 remoterndebug3: mux_client_request_session: enteringrndebug3: mux_client_request_alive: enteringrndebug3: mux_client_request_alive: done pid = 8340rndebug3: mux_client_request_session: session request sentrndebug1: mux_client_request_session: master session id: 2rndebug3: mux_client_read_packet: read header failed: Broken piperndebug2: Received exit status from master 0rnShared connection to 10.172.139.2 closed.rn",
"module_stdout": "trondheim02-vpn-1-mgmt # 8278: Unknown action 0rnCommand fail. Return code -1rnrntrondheim02-vpn-1-mgmt # ",
"msg": "MODULE FAILUREnSee stdout/stderr for the exact error",
"rc": 0
}
I’m unable to use any fortios module as I’m getting the same error.