now different error
TASK [rancherpocreplay : Setup authkeys for user rke]
******************************************************
[WARNING]: Unable to find '/home/rke/.ssh/id_rsa.pub' in expected paths
(use -vvvvv to see paths)
fatal: [k8master]: FAILED! => {"msg": "An unhandled exception occurred
while running the lookup plugin 'file'. Error was a <class
'ansible.errors.AnsibleError'>, original message: could not locate file in
lookup: /home/rke/.ssh/id_rsa.pub"}
[WARNING]: Unable to find '/home/rke/.ssh/id_rsa.pub' in expected paths
(use -vvvvv to see paths)
fatal: [k8node01]: FAILED! => {"msg": "An unhandled exception occurred
while running the lookup plugin 'file'. Error was a <class
'ansible.errors.AnsibleError'>, original message: could not locate file in
lookup: /home/rke/.ssh/id_rsa.pub"}
[WARNING]: Unable to find '/home/rke/.ssh/id_rsa.pub' in expected paths
(use -vvvvv to see paths)
fatal: [k8node02]: FAILED! => {"msg": "An unhandled exception occurred
while running the lookup plugin 'file'. Error was a <class
'ansible.errors.AnsibleError'>, original message: could not locate file in
lookup: /home/rke/.ssh/id_rsa.pub"}
but /home/rke/.ssh/id_rsa.pub is there on the ansible host
On Wed, Jul 20, 2022 at 2:50 PM Todd Lewis <[email protected]> wrote:
> Mustaches never nest.
>
> key: "{{ lookup('file', '/home/' ~ username ~ '/.ssh/id_rsa.pub') }}"
>
> On Wednesday, July 20, 2022 at 5:37:15 PM UTC-4 [email protected] wrote:
>
>> 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 <[email protected]> wrote:
>>
>>> 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! => {"msg": "template error while templating
>>> string: unexpected char '‘' at 11. String: “{{ lookup(‘file’, ‘{{
>>> authorized_key }}’) }}”"}
>>> fatal: [k8node02]: FAILED! => {"msg": "template error while templating
>>> string: unexpected char '‘' at 11. String: “{{ lookup(‘file’, ‘{{
>>> authorized_key }}’) }}”"}
>>> fatal: [k8node01]: FAILED! => {"msg": "template error while templating
>>> string: unexpected char '‘' at 11. String: “{{ lookup(‘file’, ‘{{
>>> authorized_key }}’) }}”"}
>>>
>>>
>>>
>>> On Wed, Jul 20, 2022 at 10:31 AM boncalo mihai <[email protected]>
>>> wrote:
>>>
>>>> Just did that, you use authorized_key module
>>>>
>>>> On Wed, Jul 20, 2022 at 4:24 PM Tony Wong <[email protected]> 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 "Ansible Project" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/ansible-project/2994746b-812f-4038-ad58-27d5b0c47been%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/ansible-project/2994746b-812f-4038-ad58-27d5b0c47been%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "Ansible Project" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/ansible-project/gkaigHAiAC0/unsubscribe
>>>> .
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> [email protected].
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/ansible-project/CAOK917Sv42GhE_GR3yo5vxSrYjB9bs-8bHsn9%2BA-4O5tcLNaDA%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/ansible-project/CAOK917Sv42GhE_GR3yo5vxSrYjB9bs-8bHsn9%2BA-4O5tcLNaDA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/gkaigHAiAC0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/ae4c2b44-f45e-4be7-b196-1c6b17903aaen%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/ae4c2b44-f45e-4be7-b196-1c6b17903aaen%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CALmkhkrzxV3F7%2BRdu7Z8OTe2R6VqmNqUQyC6yUi3ULH8BDweSg%40mail.gmail.com.