Ansible seems not supporting fundemental user management commands in Arch Linux

Hello,

I am building a nas server with manjaro architect (arch based distribution). I try to automate tasks with ansible. However ansible user management is giving me errors stating that "“msg”: “Unsupported parameters for (group) module: append, comment, group, groups, home, shell Supported parameters include: gid, local, name, non_unique, state, system”} "

However to the best of my knowledge command set is the same with debian, ubuntu etc. The not supported parameters are crucial for account management since I use lots of custom groups and custom home folder paths along with shell option.

I believe ansible detect the environment as follows

“ansible_distribution”: “Archlinux”,
“ansible_distribution_file_path”: “/etc/arch-release”,
“ansible_distribution_file_variety”: “Archlinux”,
“ansible_distribution_major_version”: “18”,
“ansible_distribution_release”: “Juhraya”,
“ansible_distribution_version”: “18.1.3”,

Any help much appreciated

Can you add the playbook you’re running? The error message alone only gets us so far.

The error message is telling you that a task using the group module cannot include all the parameters you’re passing to it. Take a look at http://docs.testing.ansible.com/ansible/devel/modules/group_module.html for detailed documentation on how to use the group module and the parameters it accepts.

Hope this helps,
Alicia

Thank you for the response.

I have extracted some private information but the playbook is a follows…

  • hosts: nas
    remote_user: root
    tasks:
  • name: create users
    group:
    name: “{{ item.name }}”
    comment: “{{ item.comment }}”
    shell: “{{ item.shell }}”
    home: “{{ item.home }}”
    group: “{{ item.name }}”
    groups: “{{ item.groups }}”
    append: yes
    loop:
  • { name: ‘user1’, comment: ‘User1 Information’, shell: ‘/user/bin/bash’, home: ‘/pool/home/user1’, groups: ‘group1,group2,group3,group4,group5,group6’}
  • { name: ‘user2’, comment: ‘User2 Information’, shell: ‘/user/bin/nologin’, home: ‘/pool/home/user2’, groups: ‘group1,group2,group3,group4,group5,group6’}
  • { name: ‘user3’, comment: ‘User3 Information’, shell: ‘/user/bin/nologin’, home: ‘/pool/home/user3’, groups: ‘group1,group2,group3,group4,group5,group6’}

Hi,

You did a mix between the user module and the group module parameters.

Please read docs and samples :

https://docs.ansible.com/ansible/latest/modules/group_module.html

https://docs.ansible.com/ansible/latest/modules/user_module.html

I think you should made a loop around group module to ensure all wanted groups exist,

and a second loop around user module to create users you want

Regards,

JYL

Thank you for the solution. Embrassing copy and paste error … Do not know what to say…Thank you again for sparing time…