Re: [ansible-project] help me - error: Filespec must match the canonical format: [[namespace/]pod:]file/path

2019-04-09 Thread vinoth kumar
On Tue, 9 Apr 2019 at 8:12 AM, Balaji  wrote:

>
> Hello All,
>
> Need your help on below issue.
>
> I am trying to run kubernetes command on a remote host using ansible.
>
> This command works when directly run on a remote host.
>
> ==>   kubectl cp /etc/passwd
> bus-service/ssh-jumphost-6954f877bf-p5fmq:/etc/passwd_test
>
> But when using ansible
>
> - name: Copy commands
>   shell: "kubectl cp {{ item }} baas-service/{{ jumphost.stdout_lines
> }}:{{ item }}"
>   with_items:
> - { '/etc/master.passwd' }
> - { '/etc/passwd' }
> - { '/etc/group' }
>
>
> I get an error.
>
>
> failed: [gngqnc014c] (item={u'/etc/master.passwd': None}) => {
> "changed": true,
>


Here you have to take a look , it’s not seems sane which you directly rub
in command line.
You have to use

kubectl cp {{ item }} baas-service/{{ jumphost.stdout_lines }}:{{ item
}}_test”



"cmd": "kubectl cp {u'/etc/master.passwd':
> None}bus-service/[u'ssh-jumphost-6954f877bf-p5fmq',
> u'ssh-jumphost-6954f877bf-twg7j',
> u'ssh-jumphost-6954f877bf-xrmhs']:{u'/etc/master.passwd': None}",
> "delta": "0:00:00.070410",
> "end": "2019-04-08 16:04:49.551694",
> "invocation": {
> "module_args": {
> "_raw_params": "kubectl cp {u'/etc/master.passwd':
> None}bus-service/[u'ssh-jumphost-6954f877bf-p5fmq',
> u'ssh-jumphost-6954f877bf-twg7j',
> u'ssh-jumphost-6954f877bf-xrmhs']:{u'/etc/master.passwd': None}",
> "_uses_shell": true,
> "argv": null,
> "chdir": null,
> "creates": null,
> "executable": null,
> "removes": null,
> "stdin": null,
> "warn": true
> }
> },
> "item": {
> "/etc/master.passwd": null
> },
> "msg": "non-zero return code",
> "rc": 1,
> "start": "2019-04-08 16:04:49.481284",
> "stderr": "error: Filespec must match the canonical format:
> [[namespace/]pod:]file/path",
> "stderr_lines": [
> "error: Filespec must match the canonical format:
> [[namespace/]pod:]file/path"
> ],
> "stdout": "",
> "stdout_lines": []
> }
>
>
>
> Can anyone help me on this issue?
>
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/09110715-1ca6-4223-93f5-13691c03550b%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ%2BRxtQ8Si1V2DR0dW6hh%2BVxZuGUhX8fPWe9knakbV4MV_OL9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] help me - error: Filespec must match the canonical format: [[namespace/]pod:]file/path

2019-04-08 Thread Balaji

Hello All,

Need your help on below issue.

I am trying to run kubernetes command on a remote host using ansible.

This command works when directly run on a remote host.

==>   kubectl cp /etc/passwd 
bus-service/ssh-jumphost-6954f877bf-p5fmq:/etc/passwd_test

But when using ansible

- name: Copy commands
  shell: "kubectl cp {{ item }} baas-service/{{ jumphost.stdout_lines 
}}:{{ item }}"
  with_items:
- { '/etc/master.passwd' }
- { '/etc/passwd' }
- { '/etc/group' }


I get an error.


failed: [gngqnc014c] (item={u'/etc/master.passwd': None}) => {
"changed": true, 
"cmd": "kubectl cp {u'/etc/master.passwd': 
None}bus-service/[u'ssh-jumphost-6954f877bf-p5fmq', 
u'ssh-jumphost-6954f877bf-twg7j', 
u'ssh-jumphost-6954f877bf-xrmhs']:{u'/etc/master.passwd': None}", 
"delta": "0:00:00.070410", 
"end": "2019-04-08 16:04:49.551694", 
"invocation": {
"module_args": {
"_raw_params": "kubectl cp {u'/etc/master.passwd': 
None}bus-service/[u'ssh-jumphost-6954f877bf-p5fmq', 
u'ssh-jumphost-6954f877bf-twg7j', 
u'ssh-jumphost-6954f877bf-xrmhs']:{u'/etc/master.passwd': None}", 
"_uses_shell": true, 
"argv": null, 
"chdir": null, 
"creates": null, 
"executable": null, 
"removes": null, 
"stdin": null, 
"warn": true
}
}, 
"item": {
"/etc/master.passwd": null
}, 
"msg": "non-zero return code", 
"rc": 1, 
"start": "2019-04-08 16:04:49.481284", 
"stderr": "error: Filespec must match the canonical format: 
[[namespace/]pod:]file/path", 
"stderr_lines": [
"error: Filespec must match the canonical format: 
[[namespace/]pod:]file/path"
], 
"stdout": "", 
"stdout_lines": []
}



Can anyone help me on this issue?


Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/09110715-1ca6-4223-93f5-13691c03550b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.