# ansible/ansible-examples architecture

> Architecture diagram of the GitHub repository ansible/ansible-examples, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ansible/ansible-examples
- Repository: https://github.com/ansible/ansible-examples

## Overview

This repository is a collection of Ansible playbook examples, not one deployed application. The principal workflow is an operator selecting and running a playbook to configure hosts; the examples cover application stacks, database and infrastructure setups, Windows, and Ansible language features. A separate Rust example implements an Ansible-style JSON module, and a Python example supplies a custom filter. The top-level README is generic, so links among unsampled playbooks and their roles are omitted rather than inferred.

Main entry points: [`rust-module-hello-world/module-src/src/main.rs`](https://github.com/ansible/ansible-examples/blob/master/rust-module-hello-world/module-src/src/main.rs) (Rust module), [`lamp_simple/site.yml`](https://github.com/ansible/ansible-examples/blob/master/lamp_simple/site.yml) (Stack playbooks), [`lamp_haproxy/site.yml`](https://github.com/ansible/ansible-examples/blob/master/lamp_haproxy/site.yml) (LAMP variants), [`wordpress-nginx/site.yml`](https://github.com/ansible/ansible-examples/blob/master/wordpress-nginx/site.yml) (WordPress stacks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deploy["Host deployments"]
  node_stack_playbooks["Stack playbooks<br/>[site.yml]"]
  node_lamp_roles["LAMP roles"]
  node_lamp_variants["LAMP variants<br/>[site.yml]"]
  node_wordpress["WordPress stacks<br/>[site.yml]"]
  node_tomcat["Tomcat stacks<br/>[site.yml]"]
  node_jboss["JBoss stacks<br/>[site.yml]"]
  node_mongodb["MongoDB sharding<br/>[site.yml]"]
  node_failover["Tomcat failover<br/>[site.yml]"]
  node_windows_stacks["Windows stacks<br/>[site.yml]"]
end

subgraph group_features["Ansible features"]
  node_feature_plays["Feature playbooks"]
  node_custom_filter["Custom filter<br/>[custom_plugins.py]"]
end

subgraph group_modules["Example modules"]
  node_rust_module["Rust module<br/>[main.rs]"]
  node_module_input["JSON arguments"]
  node_module_output["JSON response"]
end

node_operator(("Operator"))

node_operator -->|"runs example"| node_stack_playbooks
node_operator -->|"runs example"| node_lamp_variants
node_operator -->|"runs example"| node_wordpress
node_operator -->|"runs example"| node_tomcat
node_operator -->|"runs example"| node_jboss
node_operator -->|"runs example"| node_mongodb
node_operator -->|"runs example"| node_failover
node_operator -->|"runs example"| node_windows_stacks
node_operator -->|"runs example"| node_feature_plays
node_operator -.->|"runs module"| node_rust_module
node_rust_module -->|"reads JSON"| node_module_input
node_rust_module -->|"prints JSON"| node_module_output

click node_stack_playbooks "https://github.com/ansible/ansible-examples/blob/master/lamp_simple/site.yml"
click node_lamp_roles "https://github.com/ansible/ansible-examples/tree/master/lamp_simple/roles"
click node_lamp_variants "https://github.com/ansible/ansible-examples/blob/master/lamp_haproxy/site.yml"
click node_wordpress "https://github.com/ansible/ansible-examples/blob/master/wordpress-nginx/site.yml"
click node_tomcat "https://github.com/ansible/ansible-examples/blob/master/tomcat-standalone/site.yml"
click node_jboss "https://github.com/ansible/ansible-examples/blob/master/jboss-standalone/site.yml"
click node_mongodb "https://github.com/ansible/ansible-examples/blob/master/mongodb/site.yml"
click node_failover "https://github.com/ansible/ansible-examples/blob/master/tomcat-memcached-failover/site.yml"
click node_windows_stacks "https://github.com/ansible/ansible-examples/blob/master/windows/wamp_haproxy/site.yml"
click node_feature_plays "https://github.com/ansible/ansible-examples/tree/master/language_features"
click node_custom_filter "https://github.com/ansible/ansible-examples/blob/master/language_features/filter_plugins/custom_plugins.py"
click node_rust_module "https://github.com/ansible/ansible-examples/blob/master/rust-module-hello-world/module-src/src/main.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_stack_playbooks,node_lamp_roles,node_lamp_variants,node_wordpress,node_tomcat,node_jboss,node_mongodb,node_failover,node_windows_stacks toneBlue
class node_feature_plays,node_custom_filter toneAmber
class node_rust_module,node_module_input,node_module_output toneMint
class node_operator toneIndigo
```

## Components

### Host deployments

- [Stack playbooks](https://github.com/ansible/ansible-examples/blob/master/lamp_simple/site.yml): `lamp_simple/site.yml`
- [LAMP roles](https://github.com/ansible/ansible-examples/tree/master/lamp_simple/roles): `lamp_simple/roles`
- [LAMP variants](https://github.com/ansible/ansible-examples/blob/master/lamp_haproxy/site.yml): `lamp_haproxy/site.yml`
- [WordPress stacks](https://github.com/ansible/ansible-examples/blob/master/wordpress-nginx/site.yml): `wordpress-nginx/site.yml`
- [Tomcat stacks](https://github.com/ansible/ansible-examples/blob/master/tomcat-standalone/site.yml): `tomcat-standalone/site.yml`
- [JBoss stacks](https://github.com/ansible/ansible-examples/blob/master/jboss-standalone/site.yml): `jboss-standalone/site.yml`
- [MongoDB sharding](https://github.com/ansible/ansible-examples/blob/master/mongodb/site.yml): `mongodb/site.yml`
- [Tomcat failover](https://github.com/ansible/ansible-examples/blob/master/tomcat-memcached-failover/site.yml): `tomcat-memcached-failover/site.yml`
- [Windows stacks](https://github.com/ansible/ansible-examples/blob/master/windows/wamp_haproxy/site.yml): `windows/wamp_haproxy/site.yml`

### Ansible features

- [Feature playbooks](https://github.com/ansible/ansible-examples/tree/master/language_features): `language_features`
- [Custom filter](https://github.com/ansible/ansible-examples/blob/master/language_features/filter_plugins/custom_plugins.py): `language_features/filter_plugins/custom_plugins.py`

### Example modules

- [Rust module](https://github.com/ansible/ansible-examples/blob/master/rust-module-hello-world/module-src/src/main.rs): `rust-module-hello-world/module-src/src/main.rs`
- **JSON arguments**
- **JSON response**

### Other components

- **Operator**

## Connections

- Operator → Stack playbooks: runs example (evidence: `README.md`)
- Operator → LAMP variants: runs example (evidence: `README.md`)
- Operator → WordPress stacks: runs example (evidence: `README.md`)
- Operator → Tomcat stacks: runs example (evidence: `README.md`)
- Operator → JBoss stacks: runs example (evidence: `README.md`)
- Operator → MongoDB sharding: runs example (evidence: `README.md`)
- Operator → Tomcat failover: runs example (evidence: `README.md`)
- Operator → Windows stacks: runs example (evidence: `README.md`)
- Operator → Feature playbooks: runs example (evidence: `README.md`)
- Operator → Rust module: runs module
- Rust module → JSON arguments: reads JSON (evidence: `rust-module-hello-world/module-src/src/main.rs`)
- Rust module → JSON response: prints JSON (evidence: `rust-module-hello-world/module-src/src/main.rs`)
