diff --git a/ansible/generate_hcl_files.yml b/ansible/generate_hcl_files.yml index f031fc7..1ccf029 100644 --- a/ansible/generate_hcl_files.yml +++ b/ansible/generate_hcl_files.yml @@ -179,6 +179,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 f2a5483..db4ae40 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 }}/ -└── root.hcl - {{ aws_region }}/ - ├── region.hcl - └── vpc/ - ├── vpc.hcl - └── {{cluster_name }}/ - ├── cluster.hcl - ├── eks/ - │ └── terragrunt.hcl - ├── eks-cert-manager/ - │ └── terragrunt.hcl - ├── eks-grafana/ - │ └── terragrunt.hcl - └── ... (other modules) +{{ repo_tree }} ``` ## Getting Started @@ -34,7 +20,7 @@ To apply this configuration: 1. Change to the directory of the module you want to deploy: ``` - cd {{ environment }}/{{ aws_region }}/vpc/cluster/eks + cd {{ environment }}/{{ aws_region }}/vpc/{{ cluster_name }}/eks ``` 2. Initialize and apply the Terragrunt configuration: @@ -60,14 +46,4 @@ To customize this configuration further, modify the HCL files in the directory s ansible-playbook ansible/generate_hcl_files.yml -e "config_file=your-custom-config.json" ``` -## Modules Included - -This configuration includes the following modules: - -- EKS Cluster (eks) -- Cert Manager (eks-cert-manager) -- Monitoring (eks-prometheus, eks-grafana) -- Service Mesh (eks-istio) -- And more... - Each module can be deployed independently using Terragrunt.