ansible / ansible-modules-core

Ansible modules - these modules ship with ansible
1.3k stars 1.95k forks source link

groups error #2208

Closed vegaed closed 9 years ago

vegaed commented 9 years ago
Issue Type:

ansbile 2.0 at commit 7a6b58e1285c2ab33654ff9b24c51aa64c3536be

Ansible Configuration:

No changes

Environment:

osx 10.11

Summary:

The following fails (see error below):

- name: create group
  group: name=foo gid=2000

If I run groupadd on the machine I get the following

$groupadd foo
groupadd: group 'foo' already exists
Steps To Reproduce:

Create playbook with the following and run

- name: create group
  group: name=foo gid=2000
Expected Results:
ok: [XX.XX.XX.XXX]
Actual Results:
fatal: [XX.XX.XX.XXX]: FAILED! => {"changed": false, "failed": true, "msg": "Traceback (most recent call last):\r\n  File \"/home/centos/.ansible/tmp/ansible-tmp-1444142927.04-151398350040555/group\", line 2252, in <module>\r\n    main()\r\n  File \"/home/centos/.ansible/tmp/ansible-tmp-1444142927.04-151398350040555/group\", line 394, in main\r\n    if user.distribution:\r\nNameError: global name 'user' is not defined\r\n", "parsed": false}
bcoca commented 9 years ago

this seems to already have been fixed in devel (d616fd12dae71842ba472d363e1fb5a15efb723b)

vegaed commented 9 years ago

Just tried it and yes it does.