• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Ansible pfsense create users

Scheduled Pinned Locked Moved General pfSense Questions
9 Posts 5 Posters 1.4k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H
    hec
    last edited by Apr 30, 2019, 9:45 AM

    Hello,

    is there a ansible module for creating users?

    I did not find anything. I would need to create more than 100 users. Any Ideas how to do this?

    best regards
    Gregor

    1 Reply Last reply Reply Quote 0
    • J
      johnpoz LAYER 8 Global Moderator
      last edited by johnpoz Apr 30, 2019, 10:20 AM Apr 30, 2019, 10:19 AM

      You can always manipulate the xml file and then restore it..

      I take it this is for vpn users?

      If so many users prob better to use some other system for the auth of the users vs the local userbase.

      An intelligent man is sometimes forced to be drunk to spend time with his fools
      If you get confused: Listen to the Music Play
      Please don't Chat/PM me for help, unless mod related
      SG-4860 24.11 | Lab VMs 2.7.2, 24.11

      1 Reply Last reply Reply Quote 0
      • N
        NogBadTheBad
        last edited by NogBadTheBad Apr 30, 2019, 12:52 PM Apr 30, 2019, 12:39 PM

        If it is for VPN users I'd be tempted to use FreeRadius for Auth.

        Add a couple of users, see what it does in the xml and then update and import the xml.

        Better still its a flat text file /usr/local/etc/raddb/users

        Andy

        1 x Netgate SG-4860 - 3 x Linksys LGS308P - 1 x Aruba InstantOn AP22

        1 Reply Last reply Reply Quote 0
        • H
          hec
          last edited by Apr 30, 2019, 12:58 PM

          I need the users for the CP but this does not make any difference.

          We use ansible to manage our infrastructure. For sure i could work with xml and import this - but i think it would be real great to do this with ansible. This would save a lot of time.

          We have this problem at the satelite sites for guest access.

          1 Reply Last reply Reply Quote 0
          • J
            johnpoz LAYER 8 Global Moderator
            last edited by johnpoz Apr 30, 2019, 1:12 PM Apr 30, 2019, 1:09 PM

            @hec said in Ansible pfsense create users:

            ansible

            While there is no built in feature for this, or package afaik - simple google finds say this
            https://github.com/opoplawski/ansible-pfsense

            Sure there prob others.. Use at your own risk for sure!!!!

            But it doesn't list "users" as one of its modules

            Here is another one
            https://github.com/bevhost/ansible-module-pfsense

            But again don't see "users" as option to manage.

            If you need to have lots of lots of different users for whatever reason - you normally point to some other auth server.

            An intelligent man is sometimes forced to be drunk to spend time with his fools
            If you get confused: Listen to the Music Play
            Please don't Chat/PM me for help, unless mod related
            SG-4860 24.11 | Lab VMs 2.7.2, 24.11

            1 Reply Last reply Reply Quote 0
            • S
              stephenw10 Netgate Administrator
              last edited by May 1, 2019, 3:51 PM

              Captive Portal can auth against something else. Something that can be configured with Ansible.

              Steve

              1 Reply Last reply Reply Quote 0
              • H
                hec
                last edited by May 3, 2019, 12:03 PM

                I know these Ansible Modules but they does not work with users.

                I know i can auth against other databases but i don't like to do a more complex setup.
                I have only a thinclient at these sites running pfsense.

                But even if i do auth against some other auth server i need still create the users. This is the step i like to run with ansible - this saves a lot of time.

                1 Reply Last reply Reply Quote 0
                • J
                  johnpoz LAYER 8 Global Moderator
                  last edited by May 3, 2019, 12:51 PM

                  @hec said in Ansible pfsense create users:

                  auth server i need still create the users. This is the step i like to run with ansible

                  Create the users in the other system via ansible ;) Thought that was obvious...

                  step

                  1. point pfsense to auth server
                  2. create users in said auth server with ansible
                  3. done

                  How is this not what you are asking to do?

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                  1 Reply Last reply Reply Quote 0
                  • O
                    opoplawski
                    last edited by Oct 28, 2019, 9:26 PM

                    https://github.com/opoplawski/ansible-pfsense now has a basic pfsense_user module. Feedback welcome.

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                      This community forum collects and processes your personal information.
                      consent.not_received