From cc9b069ed14df782015f4c5dd2bd16510930a04d Mon Sep 17 00:00:00 2001 From: Zachary LeBlanc Date: Fri, 30 Oct 2026 15:53:36 -0500 Subject: [PATCH 1/7] add destroy windows workflow and manage ad resources node --- .ansible-lint | 1 + windows/create_ad_domain.yml | 28 ++--- windows/docs/README.md | 1 + windows/docs/windows-destroy-ad-domain.md | 69 ++++++++++++ windows/docs/windows-setup-ad-domain.md | 15 ++- windows/manage_ad_resources.yml | 73 +++++++++++++ windows/setup.yml | 121 +++++++++++++++++++--- 7 files changed, 267 insertions(+), 41 deletions(-) create mode 100644 windows/docs/windows-destroy-ad-domain.md create mode 100644 windows/manage_ad_resources.yml diff --git a/.ansible-lint b/.ansible-lint index 75ec836ab..f40ef7bdd 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -48,6 +48,7 @@ mock_modules: - amazon.aws.s3_object_info - ansible.controller.credential - ansible.controller.host + - ansible.controller.inventory_source - ansible.controller.settings - ansible.eda.project_info - ansible.eda.rulebook_info diff --git a/windows/create_ad_domain.yml b/windows/create_ad_domain.yml index e1c71038f..e1f481408 100644 --- a/windows/create_ad_domain.yml +++ b/windows/create_ad_domain.yml @@ -72,27 +72,11 @@ add: - Domain Admins - - name: Update Kerberos Credential + - name: Publish domain details for downstream workflow nodes run_once: true delegate_to: localhost - ansible.controller.credential: - name: Kerberos Credential - credential_type: Kerberos - organization: Ansible Product Demos (APD) - inputs: - username: "{{ ansible_user }}@{{ domain_name | upper }}" - 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 }}" + ansible.builtin.set_stats: + data: + ad_domain_name: "{{ domain_name }}" + ad_domain_controller_host: "{{ ansible_host }}" + per_host: false diff --git a/windows/docs/README.md b/windows/docs/README.md index f84b43312..4764e5453 100644 --- a/windows/docs/README.md +++ b/windows/docs/README.md @@ -19,3 +19,4 @@ Each file in this folder documents a corresponding windows demo playbook or work | AD โ€” New User | [windows-ad-new-user.md](windows-ad-new-user.md) | [`windows/helpdesk_new_user_portal.yml`](../helpdesk_new_user_portal.yml) | | DISA STIG | [windows-disa-stig.md](windows-disa-stig.md) | [`windows/compliance.yml`](../compliance.yml) | | Setup Active Directory Domain | [windows-setup-ad-domain.md](windows-setup-ad-domain.md) | [`windows/setup.yml`](../setup.yml) | +| Destroy Active Directory Domain | [windows-destroy-ad-domain.md](windows-destroy-ad-domain.md) | [`windows/setup.yml`](../setup.yml) | diff --git a/windows/docs/windows-destroy-ad-domain.md b/windows/docs/windows-destroy-ad-domain.md new file mode 100644 index 000000000..46ae3962a --- /dev/null +++ b/windows/docs/windows-destroy-ad-domain.md @@ -0,0 +1,69 @@ +# Destroy Active Directory Domain + + +Tears down everything created by Setup Active Directory Domain โ€” terminates the domain controller and both domain-joined computers in parallel, resets the Kerberos and AD LDAP credentials to placeholder values, deletes the AD LDAP inventory source, re-syncs the AWS dynamic inventory, and deletes the keypair and VPC. + +## Workflow + +```mermaid +graph LR + S["๐Ÿ  Start"] + S --> A + S --> B + S --> C + S --> D + A["๐Ÿ’ฅ Delete dc01"] --> F["๐Ÿ”„ Sync Inventory"] + B["๐Ÿ’ฅ Delete winston"] --> F + C["๐Ÿ’ฅ Delete winthrop"] --> F + D["๐Ÿ”ง Manage AD Resources"] --> F + F --> G["๐Ÿ”‘ Delete Keypair"] + F --> H["๐ŸŒ Delete VPC"] + style S fill:#212427,stroke:#8a8d90,color:#fff +``` + +1. Terminates dc01, winston, and winthrop **in parallel** +2. Resets the Kerberos and AD LDAP credentials to `REPLACEME` placeholders and deletes the AD LDAP inventory source (runs concurrently with the VM deletions since it only touches Controller, not AWS) +3. Syncs AWS inventory so hosts are removed from AAP +4. Deletes keypair `aws-test-key` and VPC `aws-test-vpc` (and related resources: subnet, route table, internet gateway, security group) **in parallel** + +## Prerequisites + +- An AD domain previously deployed with **Setup Active Directory Domain** +- AWS credential configured +- **AAP Credential** for Controller API callbacks when resetting AD resources + +## Survey prompts + +| Prompt | Variable | Type | Required | +|--------|----------|------|----------| +| AWS Region | `create_vm_aws_region` | multiplechoice | Yes | + +## Job templates + +| Template | Playbook | Description | +|----------|----------|-------------| +| Cloud ว€ AWS ว€ Delete Stack VM | [`cloud/delete_vm_by_name.yml`](../../cloud/delete_vm_by_name.yml) | Terminates dc01, winston, and winthrop by Name tag | +| WINDOWS ว€ AD ว€ Manage Resources | [`windows/manage_ad_resources.yml`](../manage_ad_resources.yml) | Resets the Kerberos and AD LDAP credentials to placeholders and deletes the AD LDAP inventory source | +| AWS Inventory | `(inventory sync)` | Re-syncs the AWS dynamic inventory so the deleted hosts are removed from AAP | +| Cloud ว€ AWS ว€ Delete Keypair | [`cloud/delete_keypair.yml`](../../cloud/delete_keypair.yml) | Deletes the `aws-test-key` keypair | +| Cloud ว€ AWS ว€ Delete VPC | [`cloud/delete_vpc.yml`](../../cloud/delete_vpc.yml) | Deletes the VPC and related networking resources | + +## Presenter walkthrough + +1. **When to use:** Run this at the end of a demo session, or whenever you need a clean slate before running Setup Active Directory Domain again. It's safe to run even if some resources are already gone. +2. **Launch:** Select the same AWS region used for Setup. The workflow handles everything else. +3. **Watch the parallel teardown:** The three VMs terminate simultaneously while the Kerberos and AD LDAP credentials reset and the AD LDAP inventory source is removed โ€” no dangling resources are left pointing at a domain controller that no longer exists. +4. **Wrap-up:** VPC and keypair cleanup happen last, once inventory sync confirms the hosts are gone. + +## Talking points + +- This is the matching teardown for Setup Active Directory Domain โ€” nothing is left behind, including AAP-side resources like credentials and inventory sources. +- Resetting the Kerberos and AD LDAP credentials to placeholders (rather than leaving them pointing at a deleted domain controller) avoids confusing failures the next time someone inspects or runs against them. +- Deleting the AD LDAP inventory source here โ€” rather than leaving it dangling โ€” is what keeps the Setup/Destroy lifecycle clean to run repeatedly. + +## Related demos + +| Demo | Description | +|------|-------------| +| ๐Ÿฐ [Setup Active Directory Domain](./windows-setup-ad-domain.md) | The matching provisioning workflow | +| ๐Ÿ’ฅ [Destroy Cloud Stack in AWS](../../cloud/docs/cloud-destroy-stack.md) | The equivalent teardown workflow for the general-purpose cloud stack | diff --git a/windows/docs/windows-setup-ad-domain.md b/windows/docs/windows-setup-ad-domain.md index 5a4afbd15..1de89cd2c 100644 --- a/windows/docs/windows-setup-ad-domain.md +++ b/windows/docs/windows-setup-ad-domain.md @@ -18,13 +18,15 @@ graph LR E --> F F --> G["๐Ÿ”Œ Test Connectivity"] G --> H["๐Ÿฐ Create Domain"] - H --> I["๐Ÿค Join Domain"] + H --> R["๐Ÿ”ง Manage AD Resources"] + R --> I["๐Ÿค Join Domain"] I --> J["๐Ÿ”„ AWS Inventory Sync"] I --> N["๐Ÿ”„ AD LDAP Inventory Sync"] J --> K["โšก PowerShell Validation"] N --> L["๐Ÿ” Kerberos Validation"] G -. "any failure" .-> M["๐Ÿงน Cleanup Resources"] H -. "any failure" .-> M + R -. "any failure" .-> M I -. "any failure" .-> M style S fill:#212427,stroke:#8a8d90,color:#fff ``` @@ -33,9 +35,10 @@ graph LR 2. **Create VMs** (parallel) โ€” Deploys one domain controller and two domain computers 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. **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 +5. **Manage AD Resources** โ€” Updates the Kerberos and AD LDAP credentials with the new domain controller's connection info and creates the AD LDAP inventory source +6. **Join Domain** โ€” Joins the two computers to the new domain +7. **Inventory Sync** (parallel) โ€” Refreshes the AWS dynamic inventory and the AD LDAP inventory to pick up domain membership +8. **Validation** (parallel) โ€” Tests PowerShell and Kerberos authentication On any failure, the **Cleanup Resources** rollback node runs automatically. @@ -44,7 +47,7 @@ On any failure, the **Cleanup Resources** rollback node runs automatically. - AWS credential configured with Access and Secret key - SSH public key for AWS keypair creation - **APD Machine Credential** with Windows administrator credentials -- **AAP Credential** for Controller API callbacks during domain creation +- **AAP Credential** for Controller API callbacks when creating AD resources ## Survey prompts @@ -69,6 +72,7 @@ On any failure, the **Cleanup Resources** rollback node runs automatically. | AWS Inventory | `(inventory sync)` | Syncs the AWS dynamic inventory to import the new VMs | | 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 ว€ Manage Resources | [`windows/manage_ad_resources.yml`](../manage_ad_resources.yml) | Updates the Kerberos and AD LDAP credentials with dc01's connection info and creates the AD LDAP inventory source | | 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 | @@ -108,6 +112,7 @@ On any failure, the **Cleanup Resources** rollback node runs automatically. | Demo | Description | |------|-------------| +| ๐Ÿ’ฅ [Destroy Active Directory Domain](./windows-destroy-ad-domain.md) | Tear down everything this workflow creates | | ๐ŸชŸ [AD โ€” New User](./windows-ad-new-user.md) | Create users in the domain built by this workflow for a helpdesk self-service demo | | ๐ŸชŸ [Patching](./windows-patching.md) | Patch the domain-joined Windows hosts to show day-2 operations | | ๐Ÿš€ [Deploy Cloud Stack in AWS](../../cloud/docs/deploy-cloud-stack.md) | The general-purpose infrastructure provisioning workflow for mixed OS environments | diff --git a/windows/manage_ad_resources.yml b/windows/manage_ad_resources.yml new file mode 100644 index 000000000..15e080af4 --- /dev/null +++ b/windows/manage_ad_resources.yml @@ -0,0 +1,73 @@ +--- +- name: Manage AD resources in Controller + hosts: localhost + gather_facts: false + + tasks: + - name: Assert domain details are available + ansible.builtin.assert: + that: + - ad_domain_name is defined + - ad_domain_controller_host is defined + - ad_resource_state is defined + fail_msg: "Domain details are not available" + success_msg: "Domain details are available" + + - name: Update Kerberos Credential + when: ad_resource_state == 'present' + ansible.controller.credential: + name: Kerberos Credential + credential_type: Kerberos + organization: Ansible Product Demos (APD) + inputs: + username: "{{ ansible_user }}@{{ ad_domain_name | upper }}" + password: "{{ ansible_password }}" + default_realm: "{{ ad_domain_name | upper }}" + kdc: "{{ ad_domain_controller_host }}" + + - name: Update Microsoft AD LDAP Credential + when: ad_resource_state == 'present' + ansible.controller.credential: + name: Microsoft AD LDAP Credential + credential_type: Microsoft AD LDAP + organization: Ansible Product Demos (APD) + inputs: + username: "{{ ansible_user }}@{{ ad_domain_name | upper }}" + password: "{{ ansible_password }}" + server: "{{ ad_domain_controller_host }}" + + - name: Reset Kerberos Credential + when: ad_resource_state == 'absent' + ansible.controller.credential: + name: Kerberos Credential + credential_type: Kerberos + organization: Ansible Product Demos (APD) + inputs: + username: ec2-user@ANSIBLE.LOCAL + password: REPLACEME + default_realm: ANSIBLE.LOCAL + kdc: REPLACEME + + - name: Reset Microsoft AD LDAP Credential + when: ad_resource_state == 'absent' + ansible.controller.credential: + name: Microsoft AD LDAP Credential + credential_type: Microsoft AD LDAP + organization: Ansible Product Demos (APD) + inputs: + username: ec2-user@ANSIBLE.LOCAL + password: REPLACEME + server: REPLACEME + + - name: Manage AD LDAP inventory source + ansible.controller.inventory_source: + 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 + state: "{{ ad_resource_state }}" diff --git a/windows/setup.yml b/windows/setup.yml index 3b00cbbe4..4e1920823 100644 --- a/windows/setup.yml +++ b/windows/setup.yml @@ -110,20 +110,6 @@ controller_inventories: 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] - -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: @@ -413,6 +399,28 @@ controller_templates: notification_templates_started: Telemetry notification_templates_success: Telemetry notification_templates_error: Telemetry + credentials: + - APD Machine Credential + survey_enabled: true + survey: + name: '' + description: '' + spec: + - question_name: Server Name or Pattern + type: text + variable: _hosts + required: false + + - name: "WINDOWS | AD | Manage Resources" + labels: + - windows + job_type: run + inventory: Ansible Product Demos Inventory + project: "Ansible Product Demos" + playbook: "windows/manage_ad_resources.yml" + notification_templates_started: Telemetry + notification_templates_success: Telemetry + notification_templates_error: Telemetry credentials: - APD Machine Credential - AAP Credential @@ -425,6 +433,14 @@ controller_templates: type: text variable: _hosts required: false + - question_name: AD Resource State + type: multiplechoice + variable: ad_resource_state + required: true + default: present + choices: + - present + - absent - name: "WINDOWS | AD | Join Domain" labels: @@ -645,6 +661,16 @@ controller_workflows: _hosts: purpose_domain_controller failure_nodes: - Cleanup Resources + success_nodes: + - Manage AD Resources + - identifier: Manage AD Resources + unified_job_template: WINDOWS | AD | Manage Resources + job_type: run + extra_data: + _hosts: purpose_domain_controller + ad_resource_state: present + failure_nodes: + - Cleanup Resources success_nodes: - Join Domain - identifier: Join Domain @@ -685,3 +711,70 @@ controller_workflows: job_type: run extra_data: ps_script: "Get-WinEvent -LogName Security | Where-Object {$_.Message -like '*Kerberos*'} | Select-Object TimeCreated, Message -First 1" + + - name: Destroy Active Directory Domain + description: Tear down the AD domain VMs, VPC, and keypair created by Setup Active Directory Domain + labels: + - aws.ec2 + - aws.vpc + - windows + organization: Ansible Product Demos (APD) + notification_templates_started: Telemetry + notification_templates_success: Telemetry + notification_templates_error: Telemetry + survey_enabled: true + survey: + name: '' + description: '' + spec: + - question_name: AWS Region + question_description: >- + AWS region where the AD domain stack was deployed. + type: multiplechoice + variable: create_vm_aws_region + required: true + default: us-east-2 + choices: + - us-east-1 + - us-east-2 + - us-west-1 + - us-west-2 + simplified_workflow_nodes: + - identifier: Delete Domain Controller + unified_job_template: Cloud | AWS | Delete Stack VM + extra_data: + create_vm_vm_name: dc01 + success_nodes: + - Update Inventory + - identifier: Delete Computer 1 + unified_job_template: Cloud | AWS | Delete Stack VM + extra_data: + create_vm_vm_name: winston + success_nodes: + - Update Inventory + - identifier: Delete Computer 2 + unified_job_template: Cloud | AWS | Delete Stack VM + extra_data: + create_vm_vm_name: winthrop + success_nodes: + - Update Inventory + - identifier: Manage AD Resources + unified_job_template: WINDOWS | AD | Manage Resources + job_type: run + extra_data: + _hosts: localhost + ad_resource_state: absent + success_nodes: + - Update Inventory + - identifier: Update Inventory + unified_job_template: AWS Inventory + all_parents_must_converge: true + success_nodes: + - Delete Keypair + - Delete VPC + - identifier: Delete Keypair + unified_job_template: Cloud | AWS | Delete Keypair + all_parents_must_converge: true + - identifier: Delete VPC + unified_job_template: Cloud | AWS | Delete VPC + all_parents_must_converge: true From a8bf8f52f7501e12ca8d3fd83d065dd8b6211efe Mon Sep 17 00:00:00 2001 From: Zachary LeBlanc Date: Fri, 30 Oct 2026 16:13:58 -0500 Subject: [PATCH 2/7] add placeholder resources back to setup, workflow needs references --- .ansible-lint | 1 - windows/docs/windows-destroy-ad-domain.md | 12 ++++++------ windows/docs/windows-setup-ad-domain.md | 4 ++-- windows/manage_ad_resources.yml | 15 +-------------- windows/setup.yml | 22 ++++++++++++++++------ 5 files changed, 25 insertions(+), 29 deletions(-) diff --git a/.ansible-lint b/.ansible-lint index f40ef7bdd..75ec836ab 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -48,7 +48,6 @@ mock_modules: - amazon.aws.s3_object_info - ansible.controller.credential - ansible.controller.host - - ansible.controller.inventory_source - ansible.controller.settings - ansible.eda.project_info - ansible.eda.rulebook_info diff --git a/windows/docs/windows-destroy-ad-domain.md b/windows/docs/windows-destroy-ad-domain.md index 46ae3962a..dbd8ee821 100644 --- a/windows/docs/windows-destroy-ad-domain.md +++ b/windows/docs/windows-destroy-ad-domain.md @@ -1,7 +1,7 @@ # Destroy Active Directory Domain -Tears down everything created by Setup Active Directory Domain โ€” terminates the domain controller and both domain-joined computers in parallel, resets the Kerberos and AD LDAP credentials to placeholder values, deletes the AD LDAP inventory source, re-syncs the AWS dynamic inventory, and deletes the keypair and VPC. +Tears down everything created by Setup Active Directory Domain โ€” terminates the domain controller and both domain-joined computers in parallel, resets the Kerberos and AD LDAP credentials to placeholder values, re-syncs the AWS dynamic inventory, and deletes the keypair and VPC. ## Workflow @@ -22,7 +22,7 @@ graph LR ``` 1. Terminates dc01, winston, and winthrop **in parallel** -2. Resets the Kerberos and AD LDAP credentials to `REPLACEME` placeholders and deletes the AD LDAP inventory source (runs concurrently with the VM deletions since it only touches Controller, not AWS) +2. Resets the Kerberos and AD LDAP credentials to `REPLACEME` placeholders (runs concurrently with the VM deletions since it only touches Controller, not AWS). The AD LDAP inventory source itself is left in place โ€” it's a standing resource referenced directly by the Setup workflow's AD LDAP Inventory Sync node โ€” but with placeholder credentials, it can no longer authenticate against a real domain controller. 3. Syncs AWS inventory so hosts are removed from AAP 4. Deletes keypair `aws-test-key` and VPC `aws-test-vpc` (and related resources: subnet, route table, internet gateway, security group) **in parallel** @@ -43,7 +43,7 @@ graph LR | Template | Playbook | Description | |----------|----------|-------------| | Cloud ว€ AWS ว€ Delete Stack VM | [`cloud/delete_vm_by_name.yml`](../../cloud/delete_vm_by_name.yml) | Terminates dc01, winston, and winthrop by Name tag | -| WINDOWS ว€ AD ว€ Manage Resources | [`windows/manage_ad_resources.yml`](../manage_ad_resources.yml) | Resets the Kerberos and AD LDAP credentials to placeholders and deletes the AD LDAP inventory source | +| WINDOWS ว€ AD ว€ Manage Resources | [`windows/manage_ad_resources.yml`](../manage_ad_resources.yml) | Resets the Kerberos and AD LDAP credentials to placeholders | | AWS Inventory | `(inventory sync)` | Re-syncs the AWS dynamic inventory so the deleted hosts are removed from AAP | | Cloud ว€ AWS ว€ Delete Keypair | [`cloud/delete_keypair.yml`](../../cloud/delete_keypair.yml) | Deletes the `aws-test-key` keypair | | Cloud ว€ AWS ว€ Delete VPC | [`cloud/delete_vpc.yml`](../../cloud/delete_vpc.yml) | Deletes the VPC and related networking resources | @@ -52,14 +52,14 @@ graph LR 1. **When to use:** Run this at the end of a demo session, or whenever you need a clean slate before running Setup Active Directory Domain again. It's safe to run even if some resources are already gone. 2. **Launch:** Select the same AWS region used for Setup. The workflow handles everything else. -3. **Watch the parallel teardown:** The three VMs terminate simultaneously while the Kerberos and AD LDAP credentials reset and the AD LDAP inventory source is removed โ€” no dangling resources are left pointing at a domain controller that no longer exists. +3. **Watch the parallel teardown:** The three VMs terminate simultaneously while the Kerberos and AD LDAP credentials reset to placeholders โ€” no credentials are left pointing at a domain controller that no longer exists. 4. **Wrap-up:** VPC and keypair cleanup happen last, once inventory sync confirms the hosts are gone. ## Talking points -- This is the matching teardown for Setup Active Directory Domain โ€” nothing is left behind, including AAP-side resources like credentials and inventory sources. +- This is the matching teardown for Setup Active Directory Domain โ€” AAP-side credentials are returned to their pristine, pre-setup state, not left pointing at a terminated domain controller. - Resetting the Kerberos and AD LDAP credentials to placeholders (rather than leaving them pointing at a deleted domain controller) avoids confusing failures the next time someone inspects or runs against them. -- Deleting the AD LDAP inventory source here โ€” rather than leaving it dangling โ€” is what keeps the Setup/Destroy lifecycle clean to run repeatedly. +- The AD LDAP Inventory source and inventory container are standing resources โ€” they're referenced directly by the Setup workflow's own node definitions, so they're never deleted. Resetting the credentials they depend on is what keeps the Setup/Destroy lifecycle safe to run repeatedly. ## Related demos diff --git a/windows/docs/windows-setup-ad-domain.md b/windows/docs/windows-setup-ad-domain.md index 1de89cd2c..0bcfc3a20 100644 --- a/windows/docs/windows-setup-ad-domain.md +++ b/windows/docs/windows-setup-ad-domain.md @@ -35,7 +35,7 @@ graph LR 2. **Create VMs** (parallel) โ€” Deploys one domain controller and two domain computers 3. **Inventory Sync + Test Connectivity** โ€” Verifies all three VMs are reachable 4. **Create Domain** โ€” Promotes the DC to a domain controller -5. **Manage AD Resources** โ€” Updates the Kerberos and AD LDAP credentials with the new domain controller's connection info and creates the AD LDAP inventory source +5. **Manage AD Resources** โ€” Updates the Kerberos and AD LDAP credentials with the new domain controller's connection info 6. **Join Domain** โ€” Joins the two computers to the new domain 7. **Inventory Sync** (parallel) โ€” Refreshes the AWS dynamic inventory and the AD LDAP inventory to pick up domain membership 8. **Validation** (parallel) โ€” Tests PowerShell and Kerberos authentication @@ -72,7 +72,7 @@ On any failure, the **Cleanup Resources** rollback node runs automatically. | AWS Inventory | `(inventory sync)` | Syncs the AWS dynamic inventory to import the new VMs | | 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 ว€ Manage Resources | [`windows/manage_ad_resources.yml`](../manage_ad_resources.yml) | Updates the Kerberos and AD LDAP credentials with dc01's connection info and creates the AD LDAP inventory source | +| WINDOWS ว€ AD ว€ Manage Resources | [`windows/manage_ad_resources.yml`](../manage_ad_resources.yml) | Updates the Kerberos and AD LDAP credentials with dc01's connection info | | 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 | diff --git a/windows/manage_ad_resources.yml b/windows/manage_ad_resources.yml index 15e080af4..f7144057a 100644 --- a/windows/manage_ad_resources.yml +++ b/windows/manage_ad_resources.yml @@ -5,11 +5,11 @@ tasks: - name: Assert domain details are available + when: ad_resource_state == 'present' ansible.builtin.assert: that: - ad_domain_name is defined - ad_domain_controller_host is defined - - ad_resource_state is defined fail_msg: "Domain details are not available" success_msg: "Domain details are available" @@ -58,16 +58,3 @@ username: ec2-user@ANSIBLE.LOCAL password: REPLACEME server: REPLACEME - - - name: Manage AD LDAP inventory source - ansible.controller.inventory_source: - 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 - state: "{{ ad_resource_state }}" diff --git a/windows/setup.yml b/windows/setup.yml index 4e1920823..d02dfa48c 100644 --- a/windows/setup.yml +++ b/windows/setup.yml @@ -110,6 +110,22 @@ controller_inventories: 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] + +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 + source_vars: + DISCLAIMER: RUN SETUP ACTIVE DIRECTORY DOMAIN BEFORE SYNCING + controller_templates: - name: "WINDOWS | Install IIS" labels: @@ -429,10 +445,6 @@ controller_templates: name: '' description: '' spec: - - question_name: Server Name or Pattern - type: text - variable: _hosts - required: false - question_name: AD Resource State type: multiplechoice variable: ad_resource_state @@ -667,7 +679,6 @@ controller_workflows: unified_job_template: WINDOWS | AD | Manage Resources job_type: run extra_data: - _hosts: purpose_domain_controller ad_resource_state: present failure_nodes: - Cleanup Resources @@ -762,7 +773,6 @@ controller_workflows: unified_job_template: WINDOWS | AD | Manage Resources job_type: run extra_data: - _hosts: localhost ad_resource_state: absent success_nodes: - Update Inventory From 982d3a13b8ae04269909fa4846b5bbcd116f03c9 Mon Sep 17 00:00:00 2001 From: Zachary LeBlanc Date: Fri, 30 Oct 2026 16:58:57 -0500 Subject: [PATCH 3/7] keep creation simple, add reset node for destroy --- windows/create_ad_domain.yml | 28 ++++++++--- windows/docs/windows-destroy-ad-domain.md | 4 +- windows/docs/windows-setup-ad-domain.md | 18 +++---- windows/manage_ad_resources.yml | 60 ----------------------- windows/reset_ad_configuration.yml | 26 ++++++++++ windows/setup.yml | 44 +++-------------- 6 files changed, 64 insertions(+), 116 deletions(-) delete mode 100644 windows/manage_ad_resources.yml create mode 100644 windows/reset_ad_configuration.yml diff --git a/windows/create_ad_domain.yml b/windows/create_ad_domain.yml index e1f481408..e1c71038f 100644 --- a/windows/create_ad_domain.yml +++ b/windows/create_ad_domain.yml @@ -72,11 +72,27 @@ add: - Domain Admins - - name: Publish domain details for downstream workflow nodes + - name: Update Kerberos Credential run_once: true delegate_to: localhost - ansible.builtin.set_stats: - data: - ad_domain_name: "{{ domain_name }}" - ad_domain_controller_host: "{{ ansible_host }}" - per_host: false + ansible.controller.credential: + name: Kerberos Credential + credential_type: Kerberos + organization: Ansible Product Demos (APD) + inputs: + username: "{{ ansible_user }}@{{ domain_name | upper }}" + 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 }}" diff --git a/windows/docs/windows-destroy-ad-domain.md b/windows/docs/windows-destroy-ad-domain.md index dbd8ee821..2449663c6 100644 --- a/windows/docs/windows-destroy-ad-domain.md +++ b/windows/docs/windows-destroy-ad-domain.md @@ -15,7 +15,7 @@ graph LR A["๐Ÿ’ฅ Delete dc01"] --> F["๐Ÿ”„ Sync Inventory"] B["๐Ÿ’ฅ Delete winston"] --> F C["๐Ÿ’ฅ Delete winthrop"] --> F - D["๐Ÿ”ง Manage AD Resources"] --> F + D["๐Ÿ”ง Reset AD Configuration"] --> F F --> G["๐Ÿ”‘ Delete Keypair"] F --> H["๐ŸŒ Delete VPC"] style S fill:#212427,stroke:#8a8d90,color:#fff @@ -43,7 +43,7 @@ graph LR | Template | Playbook | Description | |----------|----------|-------------| | Cloud ว€ AWS ว€ Delete Stack VM | [`cloud/delete_vm_by_name.yml`](../../cloud/delete_vm_by_name.yml) | Terminates dc01, winston, and winthrop by Name tag | -| WINDOWS ว€ AD ว€ Manage Resources | [`windows/manage_ad_resources.yml`](../manage_ad_resources.yml) | Resets the Kerberos and AD LDAP credentials to placeholders | +| WINDOWS ว€ AD ว€ Reset Configuration | [`windows/reset_ad_configuration.yml`](../reset_ad_configuration.yml) | Resets the Kerberos and AD LDAP credentials to placeholders | | AWS Inventory | `(inventory sync)` | Re-syncs the AWS dynamic inventory so the deleted hosts are removed from AAP | | Cloud ว€ AWS ว€ Delete Keypair | [`cloud/delete_keypair.yml`](../../cloud/delete_keypair.yml) | Deletes the `aws-test-key` keypair | | Cloud ว€ AWS ว€ Delete VPC | [`cloud/delete_vpc.yml`](../../cloud/delete_vpc.yml) | Deletes the VPC and related networking resources | diff --git a/windows/docs/windows-setup-ad-domain.md b/windows/docs/windows-setup-ad-domain.md index 0bcfc3a20..c96c60fb6 100644 --- a/windows/docs/windows-setup-ad-domain.md +++ b/windows/docs/windows-setup-ad-domain.md @@ -18,15 +18,13 @@ graph LR E --> F F --> G["๐Ÿ”Œ Test Connectivity"] G --> H["๐Ÿฐ Create Domain"] - H --> R["๐Ÿ”ง Manage AD Resources"] - R --> I["๐Ÿค Join Domain"] + H --> I["๐Ÿค Join Domain"] I --> J["๐Ÿ”„ AWS Inventory Sync"] I --> N["๐Ÿ”„ AD LDAP Inventory Sync"] J --> K["โšก PowerShell Validation"] N --> L["๐Ÿ” Kerberos Validation"] G -. "any failure" .-> M["๐Ÿงน Cleanup Resources"] H -. "any failure" .-> M - R -. "any failure" .-> M I -. "any failure" .-> M style S fill:#212427,stroke:#8a8d90,color:#fff ``` @@ -34,11 +32,10 @@ graph LR 1. **Create Keypair + VPC** โ€” Provisions AWS infrastructure 2. **Create VMs** (parallel) โ€” Deploys one domain controller and two domain computers 3. **Inventory Sync + Test Connectivity** โ€” Verifies all three VMs are reachable -4. **Create Domain** โ€” Promotes the DC to a domain controller -5. **Manage AD Resources** โ€” Updates the Kerberos and AD LDAP credentials with the new domain controller's connection info -6. **Join Domain** โ€” Joins the two computers to the new domain -7. **Inventory Sync** (parallel) โ€” Refreshes the AWS dynamic inventory and the AD LDAP inventory to pick up domain membership -8. **Validation** (parallel) โ€” Tests PowerShell and Kerberos authentication +4. **Create Domain** โ€” Promotes the DC to a domain controller and updates the Kerberos and AD LDAP credentials with its connection info +5. **Join Domain** โ€” Joins the two computers to the new domain +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. @@ -47,7 +44,7 @@ On any failure, the **Cleanup Resources** rollback node runs automatically. - AWS credential configured with Access and Secret key - SSH public key for AWS keypair creation - **APD Machine Credential** with Windows administrator credentials -- **AAP Credential** for Controller API callbacks when creating AD resources +- **AAP Credential** for Controller API callbacks during domain creation ## Survey prompts @@ -71,8 +68,7 @@ On any failure, the **Cleanup Resources** rollback node runs automatically. | Cloud ว€ AWS ว€ Create VM (Computer 2 - winthrop) | [`cloud/create_vm.yml`](../../cloud/create_vm.yml) | Deploys the winthrop Windows Server instance as domain computer | | AWS Inventory | `(inventory sync)` | Syncs the AWS dynamic inventory to import the new VMs | | 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 ว€ Manage Resources | [`windows/manage_ad_resources.yml`](../manage_ad_resources.yml) | Updates the Kerberos and AD LDAP credentials with dc01's connection info | +| WINDOWS ว€ AD ว€ Create Domain | [`windows/create_ad_domain.yml`](../create_ad_domain.yml) | Promotes dc01 to domain controller, creates the ANSIBLE.LOCAL domain, and updates the Kerberos and AD LDAP credentials with dc01's connection info | | 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 | diff --git a/windows/manage_ad_resources.yml b/windows/manage_ad_resources.yml deleted file mode 100644 index f7144057a..000000000 --- a/windows/manage_ad_resources.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -- name: Manage AD resources in Controller - hosts: localhost - gather_facts: false - - tasks: - - name: Assert domain details are available - when: ad_resource_state == 'present' - ansible.builtin.assert: - that: - - ad_domain_name is defined - - ad_domain_controller_host is defined - fail_msg: "Domain details are not available" - success_msg: "Domain details are available" - - - name: Update Kerberos Credential - when: ad_resource_state == 'present' - ansible.controller.credential: - name: Kerberos Credential - credential_type: Kerberos - organization: Ansible Product Demos (APD) - inputs: - username: "{{ ansible_user }}@{{ ad_domain_name | upper }}" - password: "{{ ansible_password }}" - default_realm: "{{ ad_domain_name | upper }}" - kdc: "{{ ad_domain_controller_host }}" - - - name: Update Microsoft AD LDAP Credential - when: ad_resource_state == 'present' - ansible.controller.credential: - name: Microsoft AD LDAP Credential - credential_type: Microsoft AD LDAP - organization: Ansible Product Demos (APD) - inputs: - username: "{{ ansible_user }}@{{ ad_domain_name | upper }}" - password: "{{ ansible_password }}" - server: "{{ ad_domain_controller_host }}" - - - name: Reset Kerberos Credential - when: ad_resource_state == 'absent' - ansible.controller.credential: - name: Kerberos Credential - credential_type: Kerberos - organization: Ansible Product Demos (APD) - inputs: - username: ec2-user@ANSIBLE.LOCAL - password: REPLACEME - default_realm: ANSIBLE.LOCAL - kdc: REPLACEME - - - name: Reset Microsoft AD LDAP Credential - when: ad_resource_state == 'absent' - ansible.controller.credential: - name: Microsoft AD LDAP Credential - credential_type: Microsoft AD LDAP - organization: Ansible Product Demos (APD) - inputs: - username: ec2-user@ANSIBLE.LOCAL - password: REPLACEME - server: REPLACEME diff --git a/windows/reset_ad_configuration.yml b/windows/reset_ad_configuration.yml new file mode 100644 index 000000000..f2a38e69c --- /dev/null +++ b/windows/reset_ad_configuration.yml @@ -0,0 +1,26 @@ +--- +- name: Reset AD Controller configuration to placeholders + hosts: localhost + gather_facts: false + + tasks: + - name: Reset Kerberos Credential + ansible.controller.credential: + name: Kerberos Credential + credential_type: Kerberos + organization: Ansible Product Demos (APD) + inputs: + username: ec2-user@ANSIBLE.LOCAL + password: REPLACEME + default_realm: ANSIBLE.LOCAL + kdc: REPLACEME + + - name: Reset Microsoft AD LDAP Credential + ansible.controller.credential: + name: Microsoft AD LDAP Credential + credential_type: Microsoft AD LDAP + organization: Ansible Product Demos (APD) + inputs: + username: ec2-user@ANSIBLE.LOCAL + password: REPLACEME + server: REPLACEME diff --git a/windows/setup.yml b/windows/setup.yml index d02dfa48c..aaf6c3173 100644 --- a/windows/setup.yml +++ b/windows/setup.yml @@ -109,6 +109,8 @@ controller_inventories: - name: Windows AD Inventory organization: Ansible Product Demos (APD) description: Hosts discovered from Active Directory via microsoft.ad.ldap + variables: + DISCLAIMER: RUN SETUP ACTIVE DIRECTORY DOMAIN BEFORE SYNCING # Disable AD inventory sync during setup; dependent on Setup Active Directory Domain workflow aap_configuration_dispatcher_exclude_roles: [controller_inventory_source_update] @@ -417,6 +419,7 @@ controller_templates: notification_templates_error: Telemetry credentials: - APD Machine Credential + - AAP Credential survey_enabled: true survey: name: '' @@ -427,32 +430,18 @@ controller_templates: variable: _hosts required: false - - name: "WINDOWS | AD | Manage Resources" + - name: "WINDOWS | AD | Reset Configuration" labels: - windows job_type: run inventory: Ansible Product Demos Inventory project: "Ansible Product Demos" - playbook: "windows/manage_ad_resources.yml" + playbook: "windows/reset_ad_configuration.yml" notification_templates_started: Telemetry notification_templates_success: Telemetry notification_templates_error: Telemetry credentials: - - APD Machine Credential - AAP Credential - survey_enabled: true - survey: - name: '' - description: '' - spec: - - question_name: AD Resource State - type: multiplechoice - variable: ad_resource_state - required: true - default: present - choices: - - present - - absent - name: "WINDOWS | AD | Join Domain" labels: @@ -580,14 +569,6 @@ controller_workflows: - us-east-2 - us-west-1 - us-west-2 - - question_name: Keypair Public Key - type: textarea - variable: aws_public_key - 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 @@ -673,15 +654,6 @@ controller_workflows: _hosts: purpose_domain_controller failure_nodes: - Cleanup Resources - success_nodes: - - Manage AD Resources - - identifier: Manage AD Resources - unified_job_template: WINDOWS | AD | Manage Resources - job_type: run - extra_data: - ad_resource_state: present - failure_nodes: - - Cleanup Resources success_nodes: - Join Domain - identifier: Join Domain @@ -769,11 +741,9 @@ controller_workflows: create_vm_vm_name: winthrop success_nodes: - Update Inventory - - identifier: Manage AD Resources - unified_job_template: WINDOWS | AD | Manage Resources + - identifier: Reset AD Configuration + unified_job_template: WINDOWS | AD | Reset Configuration job_type: run - extra_data: - ad_resource_state: absent success_nodes: - Update Inventory - identifier: Update Inventory From e50bc0b9af444f0e5f5b47356aa572013414411f Mon Sep 17 00:00:00 2001 From: Zachary LeBlanc Date: Tue, 3 Nov 2026 12:40:04 -0600 Subject: [PATCH 4/7] source jt nodes in windows workflow from common jt tmpls --- windows/docs/windows-destroy-ad-domain.md | 2 +- windows/setup.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/windows/docs/windows-destroy-ad-domain.md b/windows/docs/windows-destroy-ad-domain.md index 2449663c6..002826a62 100644 --- a/windows/docs/windows-destroy-ad-domain.md +++ b/windows/docs/windows-destroy-ad-domain.md @@ -42,7 +42,7 @@ graph LR | Template | Playbook | Description | |----------|----------|-------------| -| Cloud ว€ AWS ว€ Delete Stack VM | [`cloud/delete_vm_by_name.yml`](../../cloud/delete_vm_by_name.yml) | Terminates dc01, winston, and winthrop by Name tag | +| Cloud ว€ AWS ว€ Delete VM | [`cloud/delete_vm_by_name.yml`](../../cloud/delete_vm_by_name.yml) | Terminates dc01, winston, and winthrop by Name tag | | WINDOWS ว€ AD ว€ Reset Configuration | [`windows/reset_ad_configuration.yml`](../reset_ad_configuration.yml) | Resets the Kerberos and AD LDAP credentials to placeholders | | AWS Inventory | `(inventory sync)` | Re-syncs the AWS dynamic inventory so the deleted hosts are removed from AAP | | Cloud ว€ AWS ว€ Delete Keypair | [`cloud/delete_keypair.yml`](../../cloud/delete_keypair.yml) | Deletes the `aws-test-key` keypair | diff --git a/windows/setup.yml b/windows/setup.yml index aaf6c3173..9021e7228 100644 --- a/windows/setup.yml +++ b/windows/setup.yml @@ -724,19 +724,19 @@ controller_workflows: - us-west-2 simplified_workflow_nodes: - identifier: Delete Domain Controller - unified_job_template: Cloud | AWS | Delete Stack VM + unified_job_template: Cloud | AWS | Delete VM extra_data: create_vm_vm_name: dc01 success_nodes: - Update Inventory - identifier: Delete Computer 1 - unified_job_template: Cloud | AWS | Delete Stack VM + unified_job_template: Cloud | AWS | Delete VM extra_data: create_vm_vm_name: winston success_nodes: - Update Inventory - identifier: Delete Computer 2 - unified_job_template: Cloud | AWS | Delete Stack VM + unified_job_template: Cloud | AWS | Delete VM extra_data: create_vm_vm_name: winthrop success_nodes: From 32033561e2f05392f6e6574c90b22b95a06f81bb Mon Sep 17 00:00:00 2001 From: Zachary LeBlanc Date: Tue, 3 Nov 2026 13:00:07 -0600 Subject: [PATCH 5/7] migrate delete keypair to common --- cloud/setup.yml | 28 ---------------------------- common/setup.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/cloud/setup.yml b/cloud/setup.yml index 0023f2d3a..6bc21a0a8 100644 --- a/cloud/setup.yml +++ b/cloud/setup.yml @@ -294,34 +294,6 @@ controller_templates: - us-west-1 - us-west-2 - - name: Cloud | AWS | Delete Keypair - labels: - - aws.ec2 - job_type: run - organization: Ansible Product Demos (APD) - credentials: - - AWS - project: Ansible Product Demos - playbook: cloud/delete_keypair.yml - inventory: Ansible Product Demos Inventory - notification_templates_started: Telemetry - notification_templates_success: Telemetry - notification_templates_error: Telemetry - survey_enabled: true - survey: - name: '' - description: '' - spec: - - question_name: AWS Region - type: multiplechoice - variable: create_vm_aws_region - required: true - choices: - - us-east-1 - - us-east-2 - - us-west-1 - - us-west-2 - - name: Cloud | AWS | Patch Pre-check RHEL labels: - aws.ec2 diff --git a/common/setup.yml b/common/setup.yml index 1f0673295..280e3236e 100644 --- a/common/setup.yml +++ b/common/setup.yml @@ -253,6 +253,34 @@ controller_templates: public key is derived automatically. Otherwise paste the full public key line (for example, from ~/.ssh/id_rsa.pub). + - name: Cloud | AWS | Delete Keypair + labels: + - aws.ec2 + job_type: run + organization: Ansible Product Demos (APD) + credentials: + - AWS + project: Ansible Product Demos + playbook: cloud/delete_keypair.yml + inventory: Ansible Product Demos Inventory + notification_templates_started: Telemetry + notification_templates_success: Telemetry + notification_templates_error: Telemetry + survey_enabled: true + survey: + name: '' + description: '' + spec: + - question_name: AWS Region + type: multiplechoice + variable: create_vm_aws_region + required: true + choices: + - us-east-1 + - us-east-2 + - us-west-1 + - us-west-2 + - name: Cloud | AWS | Create VM labels: - aws.ec2 From 09f248245b89591955d04e146f32aae84b12b3b7 Mon Sep 17 00:00:00 2001 From: Zachary LeBlanc Date: Tue, 3 Nov 2026 13:17:38 -0600 Subject: [PATCH 6/7] migrate delete vpc to common setup --- cloud/setup.yml | 28 ---------------------------- common/setup.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/cloud/setup.yml b/cloud/setup.yml index 6bc21a0a8..6a8b9001f 100644 --- a/cloud/setup.yml +++ b/cloud/setup.yml @@ -266,34 +266,6 @@ controller_templates: variable: create_vm_vm_name required: true - - name: Cloud | AWS | Delete VPC - labels: - - aws.vpc - job_type: run - organization: Ansible Product Demos (APD) - credentials: - - AWS - project: Ansible Product Demos - playbook: cloud/delete_vpc.yml - inventory: Ansible Product Demos Inventory - notification_templates_started: Telemetry - notification_templates_success: Telemetry - notification_templates_error: Telemetry - survey_enabled: true - survey: - name: '' - description: '' - spec: - - question_name: AWS Region - type: multiplechoice - variable: create_vm_aws_region - required: true - choices: - - us-east-1 - - us-east-2 - - us-west-1 - - us-west-2 - - name: Cloud | AWS | Patch Pre-check RHEL labels: - aws.ec2 diff --git a/common/setup.yml b/common/setup.yml index 280e3236e..eda0fd65b 100644 --- a/common/setup.yml +++ b/common/setup.yml @@ -281,6 +281,34 @@ controller_templates: - us-west-1 - us-west-2 + - name: Cloud | AWS | Delete VPC + labels: + - aws.vpc + job_type: run + organization: Ansible Product Demos (APD) + credentials: + - AWS + project: Ansible Product Demos + playbook: cloud/delete_vpc.yml + inventory: Ansible Product Demos Inventory + notification_templates_started: Telemetry + notification_templates_success: Telemetry + notification_templates_error: Telemetry + survey_enabled: true + survey: + name: '' + description: '' + spec: + - question_name: AWS Region + type: multiplechoice + variable: create_vm_aws_region + required: true + choices: + - us-east-1 + - us-east-2 + - us-west-1 + - us-west-2 + - name: Cloud | AWS | Create VM labels: - aws.ec2 From 61e9ef5b85cb471396f1c8496b05a6318fa09cea Mon Sep 17 00:00:00 2001 From: Zachary LeBlanc Date: Wed, 4 Nov 2026 14:08:52 -0600 Subject: [PATCH 7/7] address docs and remove pubkey req for setup --- docs/_data/demos.yml | 42 +++++++++++++++++++++++++ windows/README.md | 1 + windows/docs/windows-setup-ad-domain.md | 4 +-- 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/docs/_data/demos.yml b/docs/_data/demos.yml index b1d4a1706..8e7f1af1d 100644 --- a/docs/_data/demos.yml +++ b/docs/_data/demos.yml @@ -1012,6 +1012,48 @@ style M fill:#4a1a1a,stroke:#ef4444,color:#fff style S fill:#212427,stroke:#8a8d90,color:#fff +- slug: windows-destroy-ad-domain + readme_path: windows/docs/windows-destroy-ad-domain.md + title: "Destroy Active Directory Domain" + category: windows + status: active + is_workflow: true + tags: + - Workflow + - Survey + - Active Directory + - AWS + thumbnail: + gradient: "linear-gradient(135deg, #dc2626 0%, #7f1d1d 100%)" + icon: "๐Ÿ’ฅ" + blurb: "Tear down the domain controller, both domain-joined hosts, VPC, and keypair created by Setup Active Directory Domain, reset AD credentials, and sync inventory." + stats: + workflows: 1 + playbooks: 5 + url: /demos/windows-destroy-ad-domain/ + github_path: windows/setup.yml + workflow_mermaid: | + graph LR + S["๐Ÿ  Start"] + S --> A + S --> B + S --> C + S --> D + A["๐Ÿ’ฅ Delete dc01"] --> F["๐Ÿ”„ Sync Inventory"] + B["๐Ÿ’ฅ Delete winston"] --> F + C["๐Ÿ’ฅ Delete winthrop"] --> F + D["๐Ÿ”ง Reset AD Configuration"] --> F + F --> G["๐Ÿ”‘ Delete Keypair"] + F --> H["๐ŸŒ Delete VPC"] + style A fill:#4a1a1a,stroke:#ef4444,color:#fff + style B fill:#4a1a1a,stroke:#ef4444,color:#fff + style C fill:#4a1a1a,stroke:#ef4444,color:#fff + style D fill:#2d1f4e,stroke:#a78bfa,color:#fff + style F fill:#2d2d2d,stroke:#888,color:#fff + style G fill:#1e3a5f,stroke:#4a90d9,color:#fff + style H fill:#1e3a5f,stroke:#4a90d9,color:#fff + style S fill:#212427,stroke:#8a8d90,color:#fff + # โ”€โ”€โ”€ Network โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ - slug: network-deploy-containerlab-stack diff --git a/windows/README.md b/windows/README.md index a4651e26f..9b0be3b99 100644 --- a/windows/README.md +++ b/windows/README.md @@ -25,6 +25,7 @@ We are currently investigating an intermittent connectivity issue related to the | Workflow | Description | |----------|-------------| | [**Setup Active Directory Domain**](docs/windows-setup-ad-domain.md) | One-click workflow to provision a domain controller and two domain-joined Windows hosts in AWS, including Kerberos validation. | +| [**Destroy Active Directory Domain**](docs/windows-destroy-ad-domain.md) | Tear down the domain controller and both domain-joined hosts created by Setup, reset Kerberos and AD LDAP credentials, and delete the keypair and VPC. | ### Jobs diff --git a/windows/docs/windows-setup-ad-domain.md b/windows/docs/windows-setup-ad-domain.md index c96c60fb6..861390ca5 100644 --- a/windows/docs/windows-setup-ad-domain.md +++ b/windows/docs/windows-setup-ad-domain.md @@ -42,8 +42,7 @@ On any failure, the **Cleanup Resources** rollback node runs automatically. ## Prerequisites - AWS credential configured with Access and Secret key -- SSH public key for AWS keypair creation -- **APD Machine Credential** with Windows administrator credentials +- **APD Machine Credential** with Windows administrator credentials and an SSH private key (Create Keypair derives the public key from it) - **AAP Credential** for Controller API callbacks during domain creation ## Survey prompts @@ -51,7 +50,6 @@ On any failure, the **Cleanup Resources** rollback node runs automatically. | Prompt | Variable | Type | Required | |--------|----------|------|----------| | AWS Region | `create_vm_aws_region` | multiplechoice | Yes | -| Keypair Public Key | `aws_public_key` | textarea | Yes | | Owner | `create_vm_vm_owner` | text | Yes | | Environment | `create_vm_vm_environment` | multiplechoice | Yes | | Subnet | `create_vm_aws_vpc_subnet_name` | text | Yes |