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
56 changes: 0 additions & 56 deletions cloud/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,62 +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 | 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
Expand Down
56 changes: 56 additions & 0 deletions common/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,62 @@ 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 | 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
Expand Down
42 changes: 42 additions & 0 deletions docs/_data/demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions windows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions windows/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
69 changes: 69 additions & 0 deletions windows/docs/windows-destroy-ad-domain.md
Original file line number Diff line number Diff line change
@@ -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, 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["🔧 Reset AD Configuration"] --> 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 (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**

## 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 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 |
| 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 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 — 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.
- 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

| 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 |
9 changes: 4 additions & 5 deletions windows/docs/windows-setup-ad-domain.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ 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
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
Expand All @@ -42,16 +42,14 @@ 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

| 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 |
Expand All @@ -68,7 +66,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 ǀ 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 |
Expand Down Expand Up @@ -108,6 +106,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 |
26 changes: 26 additions & 0 deletions windows/reset_ad_configuration.yml
Original file line number Diff line number Diff line change
@@ -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
Loading
Loading