diff --git a/ansible/generate_hcl_files.yml b/ansible/generate_hcl_files.yml index 5164487..61bc154 100644 --- a/ansible/generate_hcl_files.yml +++ b/ansible/generate_hcl_files.yml @@ -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" diff --git a/ansible/templates/README.md.j2 b/ansible/templates/README.md.j2 index 906cdb1..9e19016 100644 --- a/ansible/templates/README.md.j2 +++ b/ansible/templates/README.md.j2 @@ -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