Hi Michael,

So I did search all the modules. My question was how to import all the keys 
from the /etc/pki... all i could find was individual loads, it was so that 
I run multiple CentOS and RedHat servers and some have different repos 
enabled, so bulk import would be a better solution I thought?

Sure, my bad, though I just asked myself how I would go about if someone 
asked me the same question. I would only reply directly to their question 
but that is just me. Anyways, don't want to stir anything further so 
apologies to all esp to JYL for my rude comment. 

Thank you to those that helped me and to everyone that replied to this 
thread :) 

On Wednesday, May 6, 2020 at 7:16:14 PM UTC-4, Michael M wrote:
>
> Quad Zero,
> You didn't even indicate if you tried using the module JYL took the time 
> to point out to you. There are examples there and everything. If you want 
> pre-written Ansible code without doing any research or leg work you should 
> look on galaxy.ansible.com. 
>
> And that is really weak criticizing someone that took more time to try to 
> solve your problem than you did. People are likely going to stop responding 
> to you after that comment.
>  
>
> On Wed, May 6, 2020 at 4:01 PM Quad Zero <quad...@gmail.com <javascript:>> 
> wrote:
>
>> Thanks for your reply but really is not helpful bud.
>>
>> This is like if i asked how i can get to a destination, you are telling 
>> me to go to a train or bus station. 
>>
>>
>> On Wednesday, May 6, 2020 at 7:32:08 AM UTC-4, Jean-Yves LENHOF wrote:
>>>
>>> Hi,
>>>
>>> There's a module to import key, please use it !
>>>
>>> https://docs.ansible.com/ansible/latest/modules/rpm_key_module.html
>>>
>>> Regards,
>>>
>>> JYL
>>> Le 06/05/2020 à 12:17, Quad Zero a écrit :
>>>
>>> Hi all,
>>>
>>> Thank you for your help in my last post. I have come quite a way (small 
>>> compared to many of you) but nevertheless making good progress each day. 
>>>
>>> I hit roadblocks quite a bit and thankfully google has helped me quite a 
>>> bit. I have come across this problem now which I hope some of you can 
>>> explain and then help me with finding a solution. This is my code so far:
>>>
>>> ---
>>> - hosts: all
>>>   serial: 3
>>>   become: yes
>>>   tasks:
>>>     - name: ping all the machines
>>>       ping:
>>>
>>>     - name: Import all GPG keys for repo
>>>       command: "rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-*"
>>>
>>>
>>> When I am trying to run the rpm --import as a command, I get this error 
>>> on my 3 test hosts:
>>> 1. What does it mean, why is this producing an error? I can enter this 
>>> directly as a command in shell and it works just fine, so where is Ansible 
>>> having issues?
>>> 2. How can I fix this and find a solution so that all my keys from the 
>>> pki directory is imported as I have a mixture of RHEL and CentOS systems?
>>>
>>> TASK [Import all GPG keys for repo] 
>>> *****************************************************************************************************
>>> [WARNING]: Consider using the yum, dnf or zypper module rather than 
>>> running 'rpm'.  If you need to use command because yum, dnf or
>>> zypper is insufficient you can add 'warn: false' to this command task or 
>>> set 'command_warnings=False' in ansible.cfg to get rid of this
>>> message.
>>> fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["rpm", 
>>> "--import", "/etc/pki/rpm-gpg/RPM-GPG-KEY-*"], "delta": "0:00:00.029904", 
>>> "end": "2020-05-06 05:08:49.909745", "msg": "non-zero return code", "rc": 
>>> 1, "start": "2020-05-06 05:08:49.879841", "stderr": "error: 
>>> /etc/pki/rpm-gpg/RPM-GPG-KEY-*: import read failed(2).", "stderr_lines": 
>>> ["error: /etc/pki/rpm-gpg/RPM-GPG-KEY-*: import read failed(2)."], 
>>> "stdout": "", "stdout_lines": []}
>>> fatal: [testb_centos78]: FAILED! => {"changed": true, "cmd": ["rpm", 
>>> "--import", "/etc/pki/rpm-gpg/RPM-GPG-KEY-*"], "delta": "0:00:00.027775", 
>>> "end": "2020-05-06 05:08:50.031696", "msg": "non-zero return code", "rc": 
>>> 1, "start": "2020-05-06 05:08:50.003921", "stderr": "error: 
>>> /etc/pki/rpm-gpg/RPM-GPG-KEY-*: import read failed(2).", "stderr_lines": 
>>> ["error: /etc/pki/rpm-gpg/RPM-GPG-KEY-*: import read failed(2)."], 
>>> "stdout": "", "stdout_lines": []}
>>> fatal: [testa_centos78]: FAILED! => {"changed": true, "cmd": ["rpm", 
>>> "--import", "/etc/pki/rpm-gpg/RPM-GPG-KEY-*"], "delta": "0:00:00.027843", 
>>> "end": "2020-05-06 05:08:50.035566", "msg": "non-zero return code", "rc": 
>>> 1, "start": "2020-05-06 05:08:50.007723", "stderr": "error: 
>>> /etc/pki/rpm-gpg/RPM-GPG-KEY-*: import read failed(2).", "stderr_lines": 
>>> ["error: /etc/pki/rpm-gpg/RPM-GPG-KEY-*: import read failed(2)."], 
>>> "stdout": "", "stdout_lines": []}
>>>
>>> Thanks in advance everyone. 
>>> -- 
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/cf399d8a-bba9-49b8-afe9-6d07516eb99f%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/ansible-project/cf399d8a-bba9-49b8-afe9-6d07516eb99f%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 ansible...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/ae9486f0-9769-4363-8803-7060273a6878%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/ae9486f0-9769-4363-8803-7060273a6878%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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c446ade2-4aad-4417-b222-8e2d69772def%40googlegroups.com.

Reply via email to