Hello,
I'm using Python API to deploy a Kubernetes cluster but I have an issue 
executing two commands using the shell module.
this is the first task's dictionary:

> {
>         'name': 'install flannel for pod network',
>         'action': {
>             'module': 'shell',
>             'args': 'kubectl apply -f {{ flannel_url }}'
>         },
>         'become': 'yes',
>         'become_user': 'kubeuser'
> }

where 'flannel_url': 
'https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml'

and the second task:
> {
>         'name': 'join_cluster',
>         'action': {
>             'module': 'shell',
>             'args': '{{ join_command }}'
>         },
>         'become': 'yes'
> }

where 'join_command': 'kubeadm join 10.10.10.10:6443 --token 
ng0q9f.6qc6w82civ7o0m4l     --discovery-token-ca-cert-hash 
sha256:b6cd3a4509f61f95cc6b1ecaee5977d638d0cc7b319a863456ebb22266b9d1d9 '

I always get the following error message:
> An exception occurred during task execution. To see the full traceback, 
use -vvv. The error was: TypeError: expected string or bytes-like object 
fatal: [10.10.10.10]: FAILED! => {"msg": "Unexpected failure during module 
execution.", "stdout": ""}

I've tried setting the logl evel to DEBUG but there was no other 
information on these tasks.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-devel/cc2638b8-ae3c-418e-a07b-4f2a9c46e786%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to