Skip to content

Commit

Permalink
Add functionality to generate and display directory structure in READ…
Browse files Browse the repository at this point in the history
…ME.md
  • Loading branch information
Your Name committed Jun 26, 2025
1 parent 752554b commit 6babd93
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
17 changes: 17 additions & 0 deletions ansible/generate_hcl_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,23 @@
mode: '0644'
loop: "{{ additional_files.files }}"

- name: install tree command if not present
ansible.builtin.package:
name: tree
state: present

- name: get tree of repo structure
ansible.builtin.command: "tree -L 3 {{ output_dir }}"
register: tree_output

- name: Print tree structure of generated files
ansible.builtin.debug:
msg: "{{ tree_output.stdout }}"

- name: set repo_tree
ansible.builtin.set_fact:
repo_tree: "{{ tree_output.stdout }}"

- name: Generate README.md with documentation
ansible.builtin.template:
src: "{{ template_dir }}/README.md.j2"
Expand Down
16 changes: 1 addition & 15 deletions ansible/templates/README.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,7 @@ This EKS cluster configuration was generated on {{ generated_date }} using the t
## Directory Structure

```
{{ environment }}/
├── environment.hcl
└── {{ aws_region }}/
├── region.hcl
└── vpc/
├── vpc.hcl
└── cluster/
├── cluster.hcl
├── eks/
│ └── terragrunt.hcl
├── eks-cert-manager/
│ └── terragrunt.hcl
├── eks-grafana/
│ └── terragrunt.hcl
└── ... (other modules)
{{ repo_tree }}
```

## Getting Started
Expand Down

0 comments on commit 6babd93

Please sign in to comment.