Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions cloud/create_vpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
- 22 # SSH
- 5986 # WinRM
- 88 # Kerberos Authentication
- 389 # LDAP

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This opens LDAP to the world (the VPC-scoped rule already had 389). Needed so AAP outside the VPC can sync, but it is cleartext LDAP on 0.0.0.0/0 — please call that out in the demo docs (same class of footgun as demo SNMP public).

- 3389 # RDP
- 9090 # Cockpit
- 9095 # Kafka EDA external listener (aws_kafka config drift)
Expand Down
6 changes: 4 additions & 2 deletions docs/_data/demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -989,9 +989,10 @@
F --> G["🔌 Test Connectivity"]
G --> H["🏰 Create Domain"]
H --> I["🤝 Join Domain"]
I --> J["🔄 Domain Inventory Sync"]
I --> J["🔄 AWS Inventory Sync"]
I --> N["🔄 AD LDAP Inventory Sync"]
J --> K["⚡ PowerShell Validation"]
J --> L["🔐 Kerberos Validation"]
N --> L["🔐 Kerberos Validation"]
G -. "any failure" .-> M["🧹 Cleanup Resources"]
H -. "any failure" .-> M
I -. "any failure" .-> M
Expand All @@ -1005,6 +1006,7 @@
style H fill:#2d1f4e,stroke:#a78bfa,color:#fff
style I fill:#2d1f4e,stroke:#a78bfa,color:#fff
style J fill:#2d2d2d,stroke:#888,color:#fff
style N fill:#2d2d2d,stroke:#888,color:#fff
style K fill:#162c46,stroke:#58a6ff,color:#fff
style L fill:#162c46,stroke:#58a6ff,color:#fff
style M fill:#4a1a1a,stroke:#ef4444,color:#fff
Expand Down
12 changes: 12 additions & 0 deletions windows/create_ad_domain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,15 @@
password: "{{ ansible_password }}"
default_realm: "{{ domain_name | upper }}"
kdc: "{{ ansible_host }}"

- name: Update Microsoft AD LDAP Credential
run_once: true
delegate_to: localhost
ansible.controller.credential:
name: Microsoft AD LDAP Credential
credential_type: Microsoft AD LDAP
organization: Ansible Product Demos (APD)
inputs:
username: "{{ ansible_user }}@{{ domain_name | upper }}"
password: "{{ ansible_password }}"
server: "{{ ansible_host }}"
13 changes: 10 additions & 3 deletions windows/docs/windows-setup-ad-domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ graph LR
F --> G["🔌 Test Connectivity"]
G --> H["🏰 Create Domain"]
H --> I["🤝 Join Domain"]
I --> J["🔄 Domain Inventory Sync"]
I --> J["🔄 AWS Inventory Sync"]
I --> N["🔄 AD LDAP Inventory Sync"]
J --> K["⚡ PowerShell Validation"]
J --> L["🔐 Kerberos Validation"]
N --> L["🔐 Kerberos Validation"]
G -. "any failure" .-> M["🧹 Cleanup Resources"]
H -. "any failure" .-> M
I -. "any failure" .-> M
Expand All @@ -33,7 +34,8 @@ graph LR
3. **Inventory Sync + Test Connectivity** — Verifies all three VMs are reachable
4. **Create Domain** — Promotes the DC to a domain controller
5. **Join Domain** — Joins the two computers to the new domain
6. **Validation** (parallel) — Tests PowerShell and Kerberos authentication
6. **Inventory Sync** (parallel) — Refreshes the AWS dynamic inventory and the AD LDAP inventory to pick up domain membership
7. **Validation** (parallel) — Tests PowerShell and Kerberos authentication

On any failure, the **Cleanup Resources** rollback node runs automatically.

Expand Down Expand Up @@ -68,6 +70,8 @@ On any failure, the **Cleanup Resources** rollback node runs automatically.
| WINDOWS ǀ Test Connectivity | [`windows/connect.yml`](../connect.yml) | Validates WinRM connectivity to all three Windows hosts |
| WINDOWS ǀ AD ǀ Create Domain | [`windows/create_ad_domain.yml`](../create_ad_domain.yml) | Promotes dc01 to domain controller and creates the ANSIBLE.LOCAL domain |
| WINDOWS ǀ AD ǀ Join Domain | [`windows/join_ad_domain.yml`](../join_ad_domain.yml) | Joins winston and winthrop to the Active Directory domain |
| AWS Inventory (Post-Join) | `(inventory sync)` | Re-syncs the AWS dynamic inventory after domain join |
| AD LDAP Inventory | `(inventory sync)` | Syncs the AD LDAP inventory via `microsoft.ad.ldap` to discover domain-joined hosts |
| WINDOWS ǀ Run PowerShell (Validation) | [`windows/powershell.yml`](../powershell.yml) | Runs Get-ADComputer on the domain controller to list joined computers |
| WINDOWS ǀ Run PowerShell ǀ Kerberos (Validation) | [`windows/powershell.yml`](../powershell.yml) | Validates Kerberos authentication by querying Security event logs |
| WINDOWS ǀ Rollback (Cleanup) | [`windows/rollback.yml`](../rollback.yml) | Cleans up resources if any workflow step fails |
Expand All @@ -94,6 +98,9 @@ On any failure, the **Cleanup Resources** rollback node runs automatically.
- This is a complete infrastructure-to-validation workflow. It provisions VMs, configures Active Directory, and proves it works — all in one click.
- Parallel VM creation with dependency management is a key AAP workflow feature. Three VMs deploy simultaneously, but domain join waits for all three to be ready.
- The automatic cleanup on failure means you never leave orphaned resources in AWS. If domain creation fails, everything rolls back.
- Two inventory sync paths included:
- amazon.aws.ec2 - dynamic group creation using tags for domain specific roles
- microsoft.ad.ldap - demonstrate leveraging the ldap plugin to generate an inventory from Active Directory
- Kerberos validation is the real proof — it shows the domain is functional, not just provisioned.
- After this workflow completes, you can pivot to the Helpdesk New User demo to show AD user management.

Expand Down
27 changes: 27 additions & 0 deletions windows/inventory.microsoft.ad.ldap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
plugin: microsoft.ad.ldap
# Connection secrets are not set here; they are supplied via environment
# variables injected by the "Microsoft AD LDAP" credential
# server <- MICROSOFT_AD_LDAP_SERVER
# username <- MICROSOFT_AD_LDAP_USERNAME (secret)
# password <- MICROSOFT_AD_LDAP_PASSWORD (secret)
auth_protocol: ntlm
search_base: DC=ansible,DC=local
search_scope: subtree
attributes:
sAMAccountName:
sam_account_name:
objectSid:
object_sid:
operatingSystem:
operating_system:
compose:
ansible_connection: "'winrm'"
ansible_winrm_transport: "'kerberos'"
ansible_winrm_server_cert_validation: "'ignore'"
ansible_port: "5986"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plugin default sets ansible_host from dNSHostName (typically *.ansible.local). Kerberos Validation in the workflow runs against Windows AD Inventory with limit: all — does WinRM from Controller actually reach those names in the standard public-IP APD lab, or do you need a compose/ansible_host that maps to something reachable (or docs that DNS/VPN is assumed)?

ansible_winrm_kinit_env_vars: "['KRB5_CONFIG']"
keyed_groups:
- key: microsoft_ad_distinguished_name | microsoft.ad.parse_dn | selectattr('0', 'eq', 'OU') | map(attribute='1') | first | lower | default('default')
prefix: ou
separator: "_"
77 changes: 72 additions & 5 deletions windows/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,34 @@ controller_credential_types:
ansible_user: !unsafe '{{ username }}'
ansible_password: !unsafe '{{ password }}'

- name: Microsoft AD LDAP
description: >-
Credential for the microsoft.ad.ldap inventory plugin. Injects the
connection env vars documented at
https://docs.ansible.com/projects/ansible/latest/collections/microsoft/ad/ldap_inventory.html
kind: cloud
inputs:
fields:
- id: username
type: string
label: Username
- id: password
type: string
label: Password
secret: true
- id: server
type: string
label: Domain Controller (LDAP Server)
required:
- username
- password
- server
injectors:
env:
MICROSOFT_AD_LDAP_USERNAME: !unsafe '{{ username }}'
MICROSOFT_AD_LDAP_PASSWORD: !unsafe '{{ password }}'
MICROSOFT_AD_LDAP_SERVER: !unsafe '{{ server }}'

controller_credentials:
- name: Kerberos Credential
credential_type: Kerberos
Expand All @@ -67,6 +95,35 @@ controller_credentials:
default_realm: ANSIBLE.LOCAL
kdc: REPLACEME

- name: Microsoft AD LDAP Credential
credential_type: Microsoft AD LDAP
organization: Ansible Product Demos (APD)
update_secrets: false
state: exists
inputs:
username: ec2-user@ANSIBLE.LOCAL
password: REPLACEME
server: REPLACEME

controller_inventories:
- name: Windows AD Inventory
organization: Ansible Product Demos (APD)
description: Hosts discovered from Active Directory via microsoft.ad.ldap

# Disable AD inventory sync during setup; dependent on Setup Active Directory Domain workflow
aap_configuration_dispatcher_exclude_roles: [controller_inventory_source_update]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good — because setup_demo.yml loads {{ demo }}/setup.yml per play, this exclude stays windows-scoped and will not disable inventory sync for other demos. Matches the follow-up commit intent.


controller_inventory_sources:
- name: AD LDAP Inventory
inventory: Windows AD Inventory
source: scm
source_project: Ansible Product Demos
source_path: windows/inventory.microsoft.ad.ldap.yml
credential: Microsoft AD LDAP Credential
overwrite: true
update_on_launch: false
update_on_project_update: false

controller_templates:
- name: "WINDOWS | Install IIS"
labels:
Expand Down Expand Up @@ -276,7 +333,8 @@ controller_templates:
project: "Ansible Product Demos"
playbook: "windows/powershell.yml"
limit: domain_ansible_local
ask_limit_on_launch: false
ask_inventory_on_launch: true
ask_limit_on_launch: true
notification_templates_started: Telemetry
notification_templates_success: Telemetry
notification_templates_error: Telemetry
Expand Down Expand Up @@ -497,7 +555,11 @@ controller_workflows:
- question_name: Keypair Public Key
type: textarea
variable: aws_public_key
required: true
required: false
question_description: >-
Optional when APD Machine Credential includes an SSH private key — the
public key is derived automatically. Otherwise paste the full public key
line (for example, from ~/.ssh/id_rsa.pub).
# Create VM variables
- question_name: Owner
type: text
Expand Down Expand Up @@ -594,12 +656,15 @@ controller_workflows:
failure_nodes:
- Cleanup Resources
success_nodes:
- Domain Inventory Sync
- identifier: Domain Inventory Sync
- AWS Inventory Sync
- AD LDAP Inventory Sync
- identifier: AWS Inventory Sync
unified_job_template: AWS Inventory
all_parents_must_converge: true
success_nodes:
- PowerShell Validation
- identifier: AD LDAP Inventory Sync
unified_job_template: AD LDAP Inventory
success_nodes:
- Kerberos Validation
- identifier: Cleanup Resources
unified_job_template: WINDOWS | Rollback
Expand All @@ -615,6 +680,8 @@ controller_workflows:
ps_script: "Get-ADComputer -Filter * | Select-Object -Property 'Name'"
- identifier: Kerberos Validation
unified_job_template: WINDOWS | Run PowerShell | Kerberos
inventory: Windows AD Inventory
limit: all
job_type: run
extra_data:
ps_script: "Get-WinEvent -LogName Security | Where-Object {$_.Message -like '*Kerberos*'} | Select-Object TimeCreated, Message -First 1"
Loading