Skip to content

Yaml syntax incorrect in debian tasks file #1

@jacquesbh

Description

@jacquesbh

Hi!

Here is my issue:

Issue

I've got this error: Error: Module unable to decode valid JSON on stdin. Unable to figure out what parameters were passed

Here is the trace:

TASK [redirectionio.nginx_module : Install redirection.io repository] *************************************************************************************************************************
task path: /Users/jacques/Sites/website/resources/provisioning/roles/redirectionio.nginx_module/tasks/pkg-debian.yml:19
<51.15.200.201> ESTABLISH SSH CONNECTION FOR USER: root
<51.15.200.201> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o 'ControlPath="/Users/jacques/.ansible/cp/0466a76521"' 51.15.200.201 '/bin/sh -c '"'"'echo ~root && sleep 0'"'"''
<51.15.200.201> (0, b'/root\n', b'')
<51.15.200.201> ESTABLISH SSH CONNECTION FOR USER: root
<51.15.200.201> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o 'ControlPath="/Users/jacques/.ansible/cp/0466a76521"' 51.15.200.201 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1657100146.2553012-35561-167120051343552 `" && echo ansible-tmp-1657100146.2553012-35561-167120051343552="` echo /root/.ansible/tmp/ansible-tmp-1657100146.2553012-35561-167120051343552 `" ) && sleep 0'"'"''
<51.15.200.201> (0, b'ansible-tmp-1657100146.2553012-35561-167120051343552=/root/.ansible/tmp/ansible-tmp-1657100146.2553012-35561-167120051343552\n', b'')
Using module file /usr/local/Cellar/ansible/5.9.0/libexec/lib/python3.10/site-packages/ansible/modules/apt_repository.py
<51.15.200.201> PUT /Users/jacques/.ansible/tmp/ansible-local-34055f5kck70_/tmp36afou84 TO /root/.ansible/tmp/ansible-tmp-1657100146.2553012-35561-167120051343552/AnsiballZ_apt_repository.py
<51.15.200.201> SSH: EXEC sftp -b - -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o 'ControlPath="/Users/jacques/.ansible/cp/0466a76521"' '[51.15.200.201]'
<51.15.200.201> (0, b'sftp> put /Users/jacques/.ansible/tmp/ansible-local-34055f5kck70_/tmp36afou84 /root/.ansible/tmp/ansible-tmp-1657100146.2553012-35561-167120051343552/AnsiballZ_apt_repository.py\n', b'')
<51.15.200.201> ESTABLISH SSH CONNECTION FOR USER: root
<51.15.200.201> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o 'ControlPath="/Users/jacques/.ansible/cp/0466a76521"' 51.15.200.201 '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1657100146.2553012-35561-167120051343552/ /root/.ansible/tmp/ansible-tmp-1657100146.2553012-35561-167120051343552/AnsiballZ_apt_repository.py && sleep 0'"'"''
<51.15.200.201> (0, b'', b'')
<51.15.200.201> ESTABLISH SSH CONNECTION FOR USER: root
<51.15.200.201> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o 'ControlPath="/Users/jacques/.ansible/cp/0466a76521"' -tt 51.15.200.201 '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp
/ansible-tmp-1657100146.2553012-35561-167120051343552/AnsiballZ_apt_repository.py && sleep 0'"'"''
<51.15.200.201> (1, b'\r\n{"msg": "Error: Module unable to decode valid JSON on stdin.  Unable to figure out what parameters were passed", "failed": true}\r\n', b'Shared connection to 51.15.2
00.201 closed.\r\n')
<51.15.200.201> Failed to connect to the host via ssh: Shared connection to 51.15.200.201 closed.
<51.15.200.201> ESTABLISH SSH CONNECTION FOR USER: root
<51.15.200.201> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o
 PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o 'ControlPath="/Users/jacques/.ansible/cp/0466a76521"' 51.15.200.201 '/bin/sh -c '"'"'rm -f -r /root/.ansible/tmp/ansible-tm
p-1657100146.2553012-35561-167120051343552/ > /dev/null 2>&1 && sleep 0'"'"''
<51.15.200.201> (0, b'', b'')
fatal: [website.fr]: FAILED! => {
    "changed": false,
    "msg": "Error: Module unable to decode valid JSON on stdin.  Unable to figure out what parameters were passed"
}
$ ansible --version
ansible [core 2.12.6]
  config file = /Users/jacques/Sites/website/resources/provisioning/ansible.cfg
  configured module search path = ['/Users/jacques/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/5.9.0/libexec/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/jacques/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.4 (main, Apr 26 2022, 19:42:59) [Clang 13.1.6 (clang-1316.0.21.2)]
  jinja version = 3.1.2
  libyaml = True

And the solution

--- a/resources/provisioning/roles/redirectionio.nginx_module/tasks/pkg-debian.yml
+++ b/resources/provisioning/roles/redirectionio.nginx_module/tasks/pkg-debian.yml
@@ -18,9 +18,7 @@

 - name: Install redirection.io repository
   apt_repository:
-    repo: >
-      deb {{ redirectionio_packages_url }}deb/{{ redirectionio_nginx_module_channel }}/{{ redirectionio_nginx_module_main_version }}
-      {{ ansible_distribution_release }} main
+    repo: deb {{ redirectionio_packages_url }}deb/{{ redirectionio_nginx_module_channel }}/{{ redirectionio_nginx_module_main_version }} {{ ansible_distribution_release }} main
     state: present
   when: redirectionio_nginx_module_main_version > 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions