Repository navigation
Add demo for microsoft.ad.ldap inventory plugin #379
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
Changes from all commits
9777299
165e35e
65a97b2
d274538
22189d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Plugin default sets |
||
| 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: "_" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good — because |
||
|
|
||
| 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: | ||
|
|
@@ -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 | ||
|
|
@@ -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 | ||
|
|
@@ -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 | ||
|
|
@@ -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" | ||
There was a problem hiding this comment.
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 SNMPpublic).