Yes
My next take is to run rke up pointing to yaml file on my ansible host as
rke user
Will see how it goes
On Fri, Jul 22, 2022 at 3:23 PM John Petro wrote:
> glad to hear that you got it working. Now on to the next thing, right?
> hehe
>
> --John
>
> On Fri, Jul 22, 2022, 6:20 PM Tony Wong
glad to hear that you got it working. Now on to the next thing, right?
hehe
--John
On Fri, Jul 22, 2022, 6:20 PM Tony Wong wrote:
> ok finally got it working. Thanks all for your help
>
> ---
> # tasks file for createuser
> - include_vars:
>dir: vars
>
>#- name: copy id_rsa.pub to tmp
ok finally got it working. Thanks all for your help
---
# tasks file for createuser
- include_vars:
dir: vars
#- name: copy id_rsa.pub to tmp for reading
#ansible.builtin.shell:
# cmd: "{{ command2 }}"
#register: shell_output
#become: true
#delegate_to: localhost
- name: rea
ok now getting different error
ASK [rancherpocreplay : Setup authkeys for user rke]
[WARNING]: The value {'content':
'c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCZ1FERjhsU
The one thing I will add to this, is that if you are using ansible 2.9.x,
make sure you are looking at that version of the docs. Some of the
problems you might be having could be from exactly what Todd was getting
at. This goes for the module that was suggested to you earlier for this
task. ( the
The error message is pretty clear: the command module doesn't have a "cmd"
parameter. (Then it helpfully lists the parameters it does have.)
You could say
ansible.builtin.shell: "{{ command2 }}"
But Brian already gave you a solution, which I'll repeat here:
You either need to run ansible-playb
ansible 2.9.6
config file = /etc/ansible/ansible.cfg
configured module search path =
['/home/ansible/.ansible/plugins/modules',
'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
executable location = /usr/bin/ansible
python versi
What ansible version do you have installed
On Fri, Jul 22, 2022 at 2:37 PM Tony Wong wrote:
> still failed
>
> TASK [rancherpocreplay : copy id_rsa.pub to tmp for reading]
> *
> fatal:
still failed
TASK [rancherpocreplay : copy id_rsa.pub to tmp for reading]
*
fatal: [k8master -> localhost]: FAILED! => {"changed": false, "msg":
"Unsupported parameters for (command) mod
just for giggles, have you tried putting a sudo in front of your command?
I am not saying this would work, but just curious if maybe the "become" is
being honored on the remote site only, so locally it might still be running
as whatever local user you are running the ansible playbook as.
On Fri, J
trying to copy id_rsa.pub for a user (rke) on my ansible controller to
authorized_keys on remote hosts
I am running ansible playbook as user ansible
since ansible user cannt access /home/rke/.ssh, it cannot lookup the pub key
I tried elevating privileges on lookup tasks and cannot do it
On Fr
I am sure you have mentioned this before, so forgive me if it's a repeat. I
couldn't find the email in my inbox. What is it you are trying to do
again?
On Fri, Jul 22, 2022 at 2:07 PM Tony Wong wrote:
>
> trying to do this another way
>
> - name: copy id_rsa.pub to tmp for reading on localhost
trying to do this another way
- name: copy id_rsa.pub to tmp for reading on localhost
ansible.builtin.shell:
cmd: "{{ command2 }}"
register: shell_output
become: true
delegate_to: localhost
where command2 is 'cp /home/rke/.ssh/id_rsa.pub /tmp'
I am trying to run this only on the an
do you mean something like this?
---
# tasks file for createuser
- include_vars:
dir: vars
*- name: Get id_rsa.pub from localhost set_fact:auth_key: "{{
lookup('file', '/home/rke/.ssh/id_rsa.pub')}}" delegate_to: localhost*
- name: create user rke
ansible.builtin.user:
name: '
On Thu, 21 Jul 2022 at 16:32, Tony Wong wrote:
>
> yes it does, but the user (ansible) i am running the playbook with even
> though it has sudo rights and in root group cant access that folder.
Your authorized_keys task is run on the remote host, but using the
lookup/file plugin in one of the a
Sounds like you have a local permissions issue.
On Thu, Jul 21, 2022 at 10:32 AM Tony Wong wrote:
> yes it does, but the user (ansible) i am running the playbook with even
> though it has sudo rights and in root group cant access that folder.
>
> i tried to copy the id_rsa.pub to /tmp and it wor
yes it does, but the user (ansible) i am running the playbook with even
though it has sudo rights and in root group cant access that folder.
i tried to copy the id_rsa.pub to /tmp and it works
On Thu, Jul 21, 2022 at 7:10 AM John Petro wrote:
> Does /home/rke/.ssh/id_pub.rsa exist on the host y
Does /home/rke/.ssh/id_pub.rsa exist on the host you are running the
ansible playbook from? Also, what happens if you try to do a ls on that
directory as the user that is executing the ansible playbook, are you
getting any errors?
On Thu, Jul 21, 2022 at 9:09 AM Tony Wong wrote:
> [WARNING]: Un
[WARNING]: Unable to find '/home/rke/.ssh/id_pub.rsa' in expected paths
(use -v to see paths)
fatal: [k8master]: FAILED! => {"msg": "An unhandled exception occurred
while running the lookup plugin 'file'. Error was a , original message: could not locate file in
lookup: /home/rke/.ssh/id_pub.rsa
how do i access to lookup the id_rsa.pub file? The user running ansible
playbook has sudo rights on the controller
On Wed, Jul 20, 2022 at 4:31 PM Todd Lewis wrote:
> It would have root access — on the target machine, but not on the Ansible
> controller.
>
> On Wednesday, July 20, 2022 at 6:24:2
main.yml
---
- hosts: k8s
become: true
roles:
- rancherpocreplay
On Wed, Jul 20, 2022 at 4:35 PM David Logan wrote:
> I didn't see the main.yml file and can't comment on your setup. Yes, root
> should have access however I'm not sure become would carry over all tasks.
> I thought it was task sp
I didn't see the main.yml file and can't comment on your setup. Yes, root
should have access however I'm not sure become would carry over all tasks.
I thought it was task specific unless you set it in your group vars
https://docs.ansible.com/ansible/latest/user_guide/become.html
On Thu, 21 Jul 20
It would have root access — on the target machine, but not on the Ansible
controller.
On Wednesday, July 20, 2022 at 6:24:24 PM UTC-4 tdub...@gmail.com wrote:
> But I used become: in my main.yml
>
> Would that have root access?
>
--
You received this message because you are subscribed to the G
But I used become: in my main.yml
Would that have root access?
On Wed, Jul 20, 2022 at 3:13 PM David Logan wrote:
> Usually the .ssh/authorized_key file has fairly specific permissions (rw
> user only) as does the .ssh directory. It may well be the ansible user
> cannot see the files in the .ss
Usually the .ssh/authorized_key file has fairly specific permissions (rw
user only) as does the .ssh directory. It may well be the ansible user
cannot see the files in the .ssh directory as it may not have the correct
permissions.
On Thu, 21 Jul 2022 at 07:37, Tony Wong wrote:
> now different er
now different error
TASK [rancherpocreplay : Setup authkeys for user rke]
**
[WARNING]: Unable to find '/home/rke/.ssh/id_rsa.pub' in expected paths
(use -v to see paths)
fatal: [k8master]: FAILED! => {"msg": "An unhandled exception occurred
Mustaches never nest.
key: "{{ lookup('file', '/home/' ~ username ~ '/.ssh/id_rsa.pub') }}"
On Wednesday, July 20, 2022 at 5:37:15 PM UTC-4 tdub...@gmail.com wrote:
> tried this way and got same error
>
> - name: Setup authkeys for user rke
> authorized_key:
> user: '{{ username }}'
>
tried this way and got same error
- name: Setup authkeys for user rke
authorized_key:
user: '{{ username }}'
state: present
key: "{{ lookup(‘file’, '/home/{{ username }}/.ssh/id_rsa.pub') }}"
On Wed, Jul 20, 2022 at 2:12 PM Tony Wong wrote:
> can i use jinja like this?
>
> - nam
can i use jinja like this?
- name: Setup authkeys for user rke
authorized_key:
user: rke
state: present
key: “{{ lookup(‘file’, ‘{{ authorized_key }}’) }}”
keep getting error
Setup authkeys for user rke] ***
fatal: [k8master]: FAILED! => {
Just did that, you use authorized_key module
On Wed, Jul 20, 2022 at 4:24 PM Tony Wong wrote:
> how do I lookup id_rsa.pub on a host and then run ansible playbook to copy
> it to their authorized_key file?
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "An
1.
https://docs.ansible.com/ansible/latest/collections/ansible/builtin/file_lookup.html
2.
https://docs.ansible.com/ansible/latest/collections/ansible/posix/authorized_key_module.html
On Wed, 20 Jul 2022 at 15:24, Tony Wong wrote:
>
> how do I lookup id_rsa.pub on a host and then run ansible pl
how do I lookup id_rsa.pub on a host and then run ansible playbook to copy
it to their authorized_key file?
--
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
32 matches
Mail list logo