My Ansible version:
ansible-playbook 2.3.1.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609]
Per the documentation to add a group
# Example group command from Ansible Playbooks
- group:
name: somegroup
state: present
My playbook
======================================
---
- hosts: myhosts
tasks:
- group:
name: useradmins
state: present
=======================================
when I run I get errors:
ansible-playbook -v addgroup.yml
Using /etc/ansible/ansible.cfg as config file
ERROR! ‘group’ is not a valid attribute for a Play
The error appears to have been in ‘/etc/ansible/playbooks/addgroup.yml’: line 6, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- group:
^ here