Skip to content

feat: create AD users and groups for OPA integration tests #8

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

Merged
merged 3 commits into from
Jul 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions roles/ad-dc/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,45 @@
dest_path: target/ca.crt
format: pem
delegate_to: localhost

# Create users and groups used by the OPA ad-ad-userinfo test

- name: Create Superset Admins group
microsoft.ad.group:
name: Superset Admins
scope: global
state: present

- name: Create user alice
microsoft.ad.user:
name: alice
sam_account_name: sam-alice # different than upn prefix (name)
password: Asdf1234
enabled: true
upn: "alice@{{ ansible_facts.domain | lower }}"
groups:
set:
- Domain Users
- Superset Admins

- name: Create user bob
microsoft.ad.user:
name: bob
sam_account_name: bob # same as upn prefix (name)
password: Asdf1234
enabled: true
upn: "bob@{{ ansible_facts.domain | upper }}"
groups:
set:
- Domain Users

- name: Create user charlie
microsoft.ad.user:
name: charlie
sam_account_name: charlie
password: Asdf1234
enabled: true
upn: "charlie@custom.test" # custom suffix
groups:
set:
- Domain Users