1

I get this error when running my first ansible playbook (i.e. I am not familiar with ansible yet)

TASK: [Install packages] ****************************************************** 
failed: [default] => (item=@Development tools,git,curl,htop) => {"failed": true, "item": "@Development tools,git,curl,htop"}
msg: this module requires key=value arguments (['name=@Development', 'tools,git,curl,htop', 'state=present', 'update_cache=yes'])

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/Users/lukemackenzie/playbook.retry

default                    : ok=1    changed=0    unreachable=0    failed=1   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

Relvant section of playbook:

  tasks:
    - name: Install packages
      yum: name={{ item }} state=present update_cache=yes
      with_items:
        - "@Development tools"
        - git
        - curl
        - htop

I tried to adapt this from the examples

I also tried just "Development Tools". I think I am escaping spaces incorrectly in the playbook yaml but am unsure how to do this correctly.

codecowboy
  • 1,307
  • 7
  • 18
  • 31
  • 1
    You should check the 3rd note of the link you provided, they talk about the development tools group. It seems you have to use `“@development-tools”` – Pierre-Alain TORET Jan 07 '16 at 10:12

1 Answers1

1

The required naming was "@development-tools" so:

 tasks:
    - name: Install packages
      yum: name={{ item }} state=present update_cache=yes
      with_items:
        - "@development-tools"
        - git
        - curl
        - htop
codecowboy
  • 1,307
  • 7
  • 18
  • 31
  • Hmm actually I've tried and I think you will have some surprises, it doesn't install (but doesn't fail) when used as a list item or used directly as the `name="@development-tools"` but `"@Development tools"` works when only name specified. Really weird behaviour. Can you please confirm that ? – Pierre-Alain TORET Jan 07 '16 at 10:33
  • ah my bad you use CentOS 6, I use Centos 7, maybe that's the reason. – Pierre-Alain TORET Jan 07 '16 at 10:34
  • Run `yum groupinfo "Development tools"`and look for the line with "Group-Id". In CentoOS 7 this group-id is `@development`. – Tvartom Sep 29 '16 at 12:27