Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to support multiple users for basic http auth #39

Open
dale-c-anderson opened this issue Feb 1, 2023 · 1 comment
Open

Need to support multiple users for basic http auth #39

dale-c-anderson opened this issue Feb 1, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@dale-c-anderson
Copy link
Member

In some cases, we need to have multiple users set up to access a given virtual host. The role currently only supports a single user.

Ideally, we'd like to be able to specify something like:

http_auth_users:
 - username: foo
   password: <vault-encrypted string>
 - username: bar
   password: <vault-encrypted string>
   state: absent   # "present" would be the default, but we need to allow for removal.

for a given vhost, and then the role could loop over these and add or remove them as specified.

If there's a clever way to keep supporting the old single user method, while implementing multi users, that would be ideal, but more likely we'll have to support both ways of specifying users for a while and deprecate the single user way. (i.e. dont forget to handle

)

@dale-c-anderson dale-c-anderson added the enhancement New feature or request label Feb 1, 2023
@dale-c-anderson
Copy link
Member Author

dale-c-anderson commented Feb 1, 2023

Until this gets added, it's possible to just manually add htpasswd tasks to your playbook, you just need to use the same path and permissions that the role uses:

  tasks:
    - name: Add additional users to htpasswd
      htpasswd:
        path: "/etc/nginx/includes/deny-anonymous.{{ linux_owner }}-{{ project }}.htpasswd"
        name: foobar
        password: !vault
          $ANSIBLE_VAULT;1.1;AES256
          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
        state: present
        owner: root
        group: www-data  # on debian machines; will be 'nginx' for redhat
        mode: '0640'
      tags:
        - htpasswd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant