Issues when run playbook on remote server

Hi,

I have this error when run playbook:

this is my playbook


  • name: df command
    hosts: all
    gather_facts: no
    vars:

    tasks:

    • name: Run df command
      command: df -h
      register: dd_output

    • name: show output command df
      debug:
      msg: β€œ{{ dd_output.stdout }}”

this is the error:

11:03:47 AM
    debug3: client_input_hostkeys: asking server to prove ownership for 1 keys
11:03:47 AM
    debug3: send packet: type 80
11:03:47 AM
    debug3: receive packet: type 91
11:03:47 AM
    debug2: channel_input_open_confirmation: channel 0: callback start
11:03:47 AM
    debug2: fd 3 setting TCP_NODELAY
11:03:47 AM
    debug3: set_sock_tos: set socket 3 IP_TOS 0x48
11:03:47 AM
    debug2: client_session2_setup: id 0
11:03:47 AM
    debug2: channel 0: request pty-req confirm 1
11:03:47 AM
    debug3: send packet: type 98
11:03:47 AM
    debug1: Sending command: /bin/sh -c '/usr/bin/python3 /home/roberto.araujo/.ansible/tmp/ansible-tmp-1738166625.7017634-6135-141683217583191/AnsiballZ_command.py && sleep 0'
11:03:47 AM
    debug2: channel 0: request exec confirm 1
11:03:47 AM
    debug3: send packet: type 98
11:03:47 AM
    debug3: client_repledge: enter
11:03:47 AM
    debug2: channel_input_open_confirmation: channel 0: callback done
11:03:47 AM
    debug2: channel 0: open confirm rwindow 0 rmax 32768
11:03:47 AM
    debug3: receive packet: type 81
11:03:47 AM
    debug1: client_global_hostkeys_prove_confirm: server used untrusted RSA signature algorithm ssh-rsa for key 0, disregarding
11:03:47 AM
    debug3: hostkeys_foreach: reading file "/home/semaphore/.ssh/known_hosts"
11:03:47 AM
    debug3: host_delete: ED25519 key already at /home/semaphore/.ssh/known_hosts:6
11:03:47 AM
    debug3: host_delete: ECDSA key already at /home/semaphore/.ssh/known_hosts:16
11:03:47 AM
    debug1: update_known_hosts: known hosts file /home/semaphore/.ssh/known_hosts2 does not exist
11:03:47 AM
    debug3: client_repledge: enter
11:03:47 AM
    debug1: pledge: fork
11:03:47 AM
    debug3: receive packet: type 99
11:03:47 AM
    debug2: channel_input_status_confirm: type 99 id 0
11:03:47 AM
    debug2: PTY allocation request accepted on channel 0
11:03:47 AM
    debug2: channel 0: rcvd adjust 2097152
11:03:47 AM
    debug3: receive packet: type 99
11:03:47 AM
    debug2: channel_input_status_confirm: type 99 id 0
11:03:47 AM
    debug2: exec request accepted on channel 0
11:03:47 AM
    debug3: receive packet: type 96
11:03:47 AM
    debug2: channel 0: rcvd eof
11:03:47 AM
    debug2: channel 0: output open -> drain
11:03:47 AM
    debug2: channel 0: obuf empty
11:03:47 AM
    debug2: chan_shutdown_write: channel 0: (i0 o1 sock -1 wfd 5 efd 6 [write])
11:03:47 AM
    debug2: channel 0: output drain -> closed
11:03:47 AM
    debug3: receive packet: type 98
11:03:47 AM
    debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
11:03:47 AM
    debug3: receive packet: type 98
11:03:47 AM
    debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
11:03:47 AM
    debug2: channel 0: rcvd eow
11:03:47 AM
    debug2: chan_shutdown_read: channel 0: (i0 o3 sock -1 wfd 4 efd 6 [write])
11:03:47 AM
    debug2: channel 0: input open -> closed
11:03:47 AM
    debug3: receive packet: type 97
11:03:47 AM
    debug2: channel 0: rcvd close
11:03:47 AM
    debug3: channel 0: will not send data after close
11:03:47 AM
    debug2: channel 0: almost dead
11:03:47 AM
    debug2: channel 0: gc: notify user
11:03:47 AM
    debug2: channel 0: gc: user detached
11:03:47 AM
    debug2: channel 0: send close
11:03:47 AM
    debug3: send packet: type 97
11:03:47 AM
    debug2: channel 0: is dead
11:03:47 AM
    debug2: channel 0: garbage collecting
11:03:47 AM
    debug1: channel 0: free: client-session, nchannels 1
11:03:47 AM
    debug3: channel 0: status: The following connections are open:
11:03:47 AM
      #0 client-session (t4 [session] r0 i3/0 o3/0 e[write]/0 fd -1/-1/6 sock -1 cc -1 io 0x00/0x00)
11:03:47 AM
  
11:03:47 AM
    debug3: send packet: type 1
11:03:47 AM
    Connection to 10.40.112.10 closed.
11:03:47 AM
    Transferred: sent 2792, received 4216 bytes, in 0.1 seconds
11:03:47 AM
    Bytes per second: sent 29548.8, received 44619.5
11:03:47 AM
    debug1: Exit status 1
11:03:47 AM
  module_stdout: |-
11:03:47 AM
    Traceback (most recent call last):
11:03:47 AM
      File "/home/roberto.araujo/.ansible/tmp/ansible-tmp-1738166625.7017634-6135-141683217583191/AnsiballZ_command.py", line 107, in <module>
11:03:47 AM
        _ansiballz_main()
11:03:47 AM
      File "/home/roberto.araujo/.ansible/tmp/ansible-tmp-1738166625.7017634-6135-141683217583191/AnsiballZ_command.py", line 99, in _ansiballz_main
11:03:47 AM
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
11:03:47 AM
      File "/home/roberto.araujo/.ansible/tmp/ansible-tmp-1738166625.7017634-6135-141683217583191/AnsiballZ_command.py", line 44, in invoke_module
11:03:47 AM
        from ansible.module_utils import basic
11:03:47 AM
      File "<frozen importlib._bootstrap>", line 971, in _find_and_load
11:03:47 AM
      File "<frozen importlib._bootstrap>", line 951, in _find_and_load_unlocked
11:03:47 AM
      File "<frozen importlib._bootstrap>", line 894, in _find_spec
11:03:47 AM
      File "<frozen importlib._bootstrap_external>", line 1157, in find_spec
11:03:47 AM
      File "<frozen importlib._bootstrap_external>", line 1131, in _get_spec
11:03:47 AM
      File "<frozen importlib._bootstrap_external>", line 1112, in _legacy_get_spec
11:03:47 AM
      File "<frozen importlib._bootstrap>", line 441, in spec_from_loader
11:03:47 AM
      File "<frozen importlib._bootstrap_external>", line 544, in spec_from_file_location
11:03:47 AM
      File "/tmp/ansible_ansible.legacy.command_payload_tzucnzhr/ansible_ansible.legacy.command_payload.zip/ansible/module_utils/basic.py", line 5
11:03:47 AM
    SyntaxError: future feature annotations is not defined
11:03:47 AM
  msg: |-
11:03:47 AM
    MODULE FAILURE: No start of json char found

You are using a version of ansible-core that doesn’t support the python version you have installed on the remote host. Check this table for support:

https://docs.ansible.com/ansible-core/devel/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix

1 Like

Hi,

I update Python version playbook run ok but I get this warning:

β€˜β€™β€™
TASK [Run df command] *********************************************************

1:43:51 PM

[WARNING]: Platform linux on host lab1 is using the discovered Python

1:43:51 PM

interpreter at /usr/bin/python3.11, but future installation of another Python

1:43:51 PM

changed: [lab1]

1:43:51 PM

interpreter could change the meaning of that path. See

1:43:51 PM

https://docs.ansible.com/ansible-

1:43:51 PM

core/2.18/reference_appendices/interpreter_discovery.html for more information.

β€˜β€™β€™

How can fix this, I read the link but isn’t clear for me

Thanks