Unable to create user on Ubuntu Server with Ansible

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












I run the following ansible script on my Centos and Ubuntu servers.



- name: add user testuser1
user:
name: "testuser1"
state: present
groups: "wheel"


The script worked fine on Centos but failed on Ubuntu.



The error message was:



fatal: [ubuntu1]: FAILED! => 
"changed": false,
"failed": true,
"invocation":
"module_args":
"append": false,
"comment": null,
"createhome": true,
"expires": null,
"force": false,
"generate_ssh_key": null,
"group": null,
"groups": [
"wheel"
],
"home": null,
"login_class": null,
"move_home": false,
"name": "testuser1",
"non_unique": false,
"password": null,
"remove": false,
"seuser": null,
"shell": null,
"skeleton": null,
"ssh_key_bits": 0,
"ssh_key_comment": "ansible-generated on ubuntu1",
"ssh_key_file": null,
"ssh_key_passphrase": null,
"ssh_key_type": "rsa",
"state": "present",
"system": false,
"uid": null,
"update_password": "always"

,
"msg": "Group wheel does not exist"



Does anyone have any idea why it failed on Ubuntu?







share|improve this question


























    up vote
    0
    down vote

    favorite












    I run the following ansible script on my Centos and Ubuntu servers.



    - name: add user testuser1
    user:
    name: "testuser1"
    state: present
    groups: "wheel"


    The script worked fine on Centos but failed on Ubuntu.



    The error message was:



    fatal: [ubuntu1]: FAILED! => 
    "changed": false,
    "failed": true,
    "invocation":
    "module_args":
    "append": false,
    "comment": null,
    "createhome": true,
    "expires": null,
    "force": false,
    "generate_ssh_key": null,
    "group": null,
    "groups": [
    "wheel"
    ],
    "home": null,
    "login_class": null,
    "move_home": false,
    "name": "testuser1",
    "non_unique": false,
    "password": null,
    "remove": false,
    "seuser": null,
    "shell": null,
    "skeleton": null,
    "ssh_key_bits": 0,
    "ssh_key_comment": "ansible-generated on ubuntu1",
    "ssh_key_file": null,
    "ssh_key_passphrase": null,
    "ssh_key_type": "rsa",
    "state": "present",
    "system": false,
    "uid": null,
    "update_password": "always"

    ,
    "msg": "Group wheel does not exist"



    Does anyone have any idea why it failed on Ubuntu?







    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I run the following ansible script on my Centos and Ubuntu servers.



      - name: add user testuser1
      user:
      name: "testuser1"
      state: present
      groups: "wheel"


      The script worked fine on Centos but failed on Ubuntu.



      The error message was:



      fatal: [ubuntu1]: FAILED! => 
      "changed": false,
      "failed": true,
      "invocation":
      "module_args":
      "append": false,
      "comment": null,
      "createhome": true,
      "expires": null,
      "force": false,
      "generate_ssh_key": null,
      "group": null,
      "groups": [
      "wheel"
      ],
      "home": null,
      "login_class": null,
      "move_home": false,
      "name": "testuser1",
      "non_unique": false,
      "password": null,
      "remove": false,
      "seuser": null,
      "shell": null,
      "skeleton": null,
      "ssh_key_bits": 0,
      "ssh_key_comment": "ansible-generated on ubuntu1",
      "ssh_key_file": null,
      "ssh_key_passphrase": null,
      "ssh_key_type": "rsa",
      "state": "present",
      "system": false,
      "uid": null,
      "update_password": "always"

      ,
      "msg": "Group wheel does not exist"



      Does anyone have any idea why it failed on Ubuntu?







      share|improve this question














      I run the following ansible script on my Centos and Ubuntu servers.



      - name: add user testuser1
      user:
      name: "testuser1"
      state: present
      groups: "wheel"


      The script worked fine on Centos but failed on Ubuntu.



      The error message was:



      fatal: [ubuntu1]: FAILED! => 
      "changed": false,
      "failed": true,
      "invocation":
      "module_args":
      "append": false,
      "comment": null,
      "createhome": true,
      "expires": null,
      "force": false,
      "generate_ssh_key": null,
      "group": null,
      "groups": [
      "wheel"
      ],
      "home": null,
      "login_class": null,
      "move_home": false,
      "name": "testuser1",
      "non_unique": false,
      "password": null,
      "remove": false,
      "seuser": null,
      "shell": null,
      "skeleton": null,
      "ssh_key_bits": 0,
      "ssh_key_comment": "ansible-generated on ubuntu1",
      "ssh_key_file": null,
      "ssh_key_passphrase": null,
      "ssh_key_type": "rsa",
      "state": "present",
      "system": false,
      "uid": null,
      "update_password": "always"

      ,
      "msg": "Group wheel does not exist"



      Does anyone have any idea why it failed on Ubuntu?









      share|improve this question













      share|improve this question




      share|improve this question








      edited May 15 at 16:00









      Jason Aller

      43158




      43158










      asked May 14 at 15:41









      peter

      82




      82




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          I don't think ubuntu has a group named wheel, you can use



          addgroup wheel


          however it may be best if you what it is you are trying to accomplish.
          Are you trying to add to the sudoers group? as this group is sudoers



          usermod -aG sudo testuser1





          share|improve this answer



























            up vote
            0
            down vote













            There is no wheel group in Ubuntu. That's a Debian-ism that did not get included in Ubuntu by default.



            The corresponding equivalent group for sudo access in Ubuntu is called sudo. You should be adding users who get sudo access to that group, and not wheel.






            share|improve this answer




















            • I'm trying to create a new group called 'Wheel'..
              – peter
              May 14 at 19:52










            • I created a new group called 'Wheel' in both Centos OS and Ubuntu. The group was created in Centos but not in Ubuntu, and I don't know why?
              – peter
              May 14 at 19:54










            • Just to clarification the group name doesn't matter .. the group could have been called anything - the fact is that the group wasn't created in Ubuntu, but it was created in Centos.
              – peter
              May 14 at 20:31










            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );








             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1036167%2funable-to-create-user-on-ubuntu-server-with-ansible%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote













            I don't think ubuntu has a group named wheel, you can use



            addgroup wheel


            however it may be best if you what it is you are trying to accomplish.
            Are you trying to add to the sudoers group? as this group is sudoers



            usermod -aG sudo testuser1





            share|improve this answer
























              up vote
              1
              down vote













              I don't think ubuntu has a group named wheel, you can use



              addgroup wheel


              however it may be best if you what it is you are trying to accomplish.
              Are you trying to add to the sudoers group? as this group is sudoers



              usermod -aG sudo testuser1





              share|improve this answer






















                up vote
                1
                down vote










                up vote
                1
                down vote









                I don't think ubuntu has a group named wheel, you can use



                addgroup wheel


                however it may be best if you what it is you are trying to accomplish.
                Are you trying to add to the sudoers group? as this group is sudoers



                usermod -aG sudo testuser1





                share|improve this answer












                I don't think ubuntu has a group named wheel, you can use



                addgroup wheel


                however it may be best if you what it is you are trying to accomplish.
                Are you trying to add to the sudoers group? as this group is sudoers



                usermod -aG sudo testuser1






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 14 at 18:11









                j-money

                322110




                322110






















                    up vote
                    0
                    down vote













                    There is no wheel group in Ubuntu. That's a Debian-ism that did not get included in Ubuntu by default.



                    The corresponding equivalent group for sudo access in Ubuntu is called sudo. You should be adding users who get sudo access to that group, and not wheel.






                    share|improve this answer




















                    • I'm trying to create a new group called 'Wheel'..
                      – peter
                      May 14 at 19:52










                    • I created a new group called 'Wheel' in both Centos OS and Ubuntu. The group was created in Centos but not in Ubuntu, and I don't know why?
                      – peter
                      May 14 at 19:54










                    • Just to clarification the group name doesn't matter .. the group could have been called anything - the fact is that the group wasn't created in Ubuntu, but it was created in Centos.
                      – peter
                      May 14 at 20:31














                    up vote
                    0
                    down vote













                    There is no wheel group in Ubuntu. That's a Debian-ism that did not get included in Ubuntu by default.



                    The corresponding equivalent group for sudo access in Ubuntu is called sudo. You should be adding users who get sudo access to that group, and not wheel.






                    share|improve this answer




















                    • I'm trying to create a new group called 'Wheel'..
                      – peter
                      May 14 at 19:52










                    • I created a new group called 'Wheel' in both Centos OS and Ubuntu. The group was created in Centos but not in Ubuntu, and I don't know why?
                      – peter
                      May 14 at 19:54










                    • Just to clarification the group name doesn't matter .. the group could have been called anything - the fact is that the group wasn't created in Ubuntu, but it was created in Centos.
                      – peter
                      May 14 at 20:31












                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    There is no wheel group in Ubuntu. That's a Debian-ism that did not get included in Ubuntu by default.



                    The corresponding equivalent group for sudo access in Ubuntu is called sudo. You should be adding users who get sudo access to that group, and not wheel.






                    share|improve this answer












                    There is no wheel group in Ubuntu. That's a Debian-ism that did not get included in Ubuntu by default.



                    The corresponding equivalent group for sudo access in Ubuntu is called sudo. You should be adding users who get sudo access to that group, and not wheel.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered May 14 at 18:14









                    Thomas Ward♦

                    41.1k23112166




                    41.1k23112166











                    • I'm trying to create a new group called 'Wheel'..
                      – peter
                      May 14 at 19:52










                    • I created a new group called 'Wheel' in both Centos OS and Ubuntu. The group was created in Centos but not in Ubuntu, and I don't know why?
                      – peter
                      May 14 at 19:54










                    • Just to clarification the group name doesn't matter .. the group could have been called anything - the fact is that the group wasn't created in Ubuntu, but it was created in Centos.
                      – peter
                      May 14 at 20:31
















                    • I'm trying to create a new group called 'Wheel'..
                      – peter
                      May 14 at 19:52










                    • I created a new group called 'Wheel' in both Centos OS and Ubuntu. The group was created in Centos but not in Ubuntu, and I don't know why?
                      – peter
                      May 14 at 19:54










                    • Just to clarification the group name doesn't matter .. the group could have been called anything - the fact is that the group wasn't created in Ubuntu, but it was created in Centos.
                      – peter
                      May 14 at 20:31















                    I'm trying to create a new group called 'Wheel'..
                    – peter
                    May 14 at 19:52




                    I'm trying to create a new group called 'Wheel'..
                    – peter
                    May 14 at 19:52












                    I created a new group called 'Wheel' in both Centos OS and Ubuntu. The group was created in Centos but not in Ubuntu, and I don't know why?
                    – peter
                    May 14 at 19:54




                    I created a new group called 'Wheel' in both Centos OS and Ubuntu. The group was created in Centos but not in Ubuntu, and I don't know why?
                    – peter
                    May 14 at 19:54












                    Just to clarification the group name doesn't matter .. the group could have been called anything - the fact is that the group wasn't created in Ubuntu, but it was created in Centos.
                    – peter
                    May 14 at 20:31




                    Just to clarification the group name doesn't matter .. the group could have been called anything - the fact is that the group wasn't created in Ubuntu, but it was created in Centos.
                    – peter
                    May 14 at 20:31












                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1036167%2funable-to-create-user-on-ubuntu-server-with-ansible%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Unable to execute new pre-installation script (/var/lib/dpkg/tmp.ci/preinst)

                    Running the scala interactive shell from the command line

                    Do not install recommended packages of dependencies