Hi Todd:

Try and read: http://docs.ansible.com/command_module.html

What you are doing is executing shell commands, this is done through the 
shell module, not the command module, which you are now misusing.
As you can already see, changing dir with the command module should take 
chdir, not cd.

Have you tried it with 'shell' instead of 'command'.
disclaimer: I'm a noob in generating gpg

Kindest regards,
Mark


On Monday, October 6, 2014 9:18:20 PM UTC+2, Todd Sampson wrote:
>
> I'm trying to generate pgp keys. Can't find anything with Ansible to do it 
> so I'm using Linux commands.  If the keys are already generated, I don't 
> want them to be generated again.  So, I need to use 'creates'. 
>
> I found this site:  
> https://u.osu.edu/hasnan.1/2013/12/16/ansible-run-multiple-commands-using-command-module-and-with-items/
>
> Looks good but it doesn't work with Ansible version 1.7.1.
>
> This is what I'm trying:
>   - name: Generate PGP keys
>     sudo: no
>     command: "{{item}}"
>     with_items:
>      - cd /home/dfr/.gnupg
>      - gpg --homedir /home/dfr/.gnupg --batch --gen-key 
> /home/dfr/reprepro/pgp-keygen-params creates=/home/dfr/.gnupg/pubring.gpg
>
> It produces:  A variable inserted a new parameter into the module args. Be 
> sure to quote variables if they contain equal signs (for example: 
> "{{var}}").
>
> Can you help me?  Preferred response:
>
> 1. Don't be silly. Ansible does this easily this way...
> 2. Otherwise, how to get the 'creates' to work.
>
> Thanks,
> Todd
>

-- 
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/4186ea5a-5c35-46c3-ae54-bab0e658a06b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to