diff --git a/generate_nginx_config.yml b/generate_nginx_config.yml index 4213079..5eab775 100644 --- a/generate_nginx_config.yml +++ b/generate_nginx_config.yml @@ -2,73 +2,53 @@ - name: Generate NGINX configuration hosts: localhost gather_facts: no + + vars_prompt: + - name: TS_DIR + prompt: "Enter the TS-XXXXX directory name where the conf file will be placed" + private: no + + - name: upstream_name + prompt: "Enter the upstream name" + private: no + + - name: zone + prompt: "Enter the zone name" + private: no + + - name: backend1 + prompt: "Enter the IP address of backend1" + private: no + + - name: backend1_port + prompt: "Enter the port of backend1" + private: no + + - name: backend2 + prompt: "Enter the IP address of backend2" + private: no + + - name: backend2_port + prompt: "Enter the port of backend2" + private: no + + - name: URL + prompt: "Enter the server URL" + private: no + + - name: SIEM_IP + prompt: "Enter the SIEM IP address" + private: no + + - name: status_zone + prompt: "Enter the status zone name" + private: no + + - name: saml_yes + prompt: "Is SAML required (yes/no)?" + private: no + tasks: - - name: Prompt for TS-XXXXX directory - vars_prompt: - - name: "TS_DIR" - prompt: "Enter the TS-XXXXX directory name where the conf file will be placed" - private: no - - - name: Prompt for upstream name - vars_prompt: - - name: "upstream_name" - prompt: "Enter the upstream name" - private: no - - - name: Prompt for zone name - vars_prompt: - - name: "zone" - prompt: "Enter the zone name" - private: no - - - name: Prompt for backend1 IP - vars_prompt: - - name: "backend1" - prompt: "Enter the IP address of backend1" - private: no - - - name: Prompt for backend1 port - vars_prompt: - - name: "backend1_port" - prompt: "Enter the port of backend1" - private: no - - - name: Prompt for backend2 IP - vars_prompt: - - name: "backend2" - prompt: "Enter the IP address of backend2" - private: no - - - name: Prompt for backend2 port - vars_prompt: - - name: "backend2_port" - prompt: "Enter the port of backend2" - private: no - - - name: Prompt for server URL - vars_prompt: - - name: "URL" - prompt: "Enter the server URL" - private: no - - - name: Prompt for SIEM IP - vars_prompt: - - name: "SIEM_IP" - prompt: "Enter the SIEM IP address" - private: no - - - name: Prompt for status zone name - vars_prompt: - - name: "status_zone" - prompt: "Enter the status zone name" - private: no - - - name: Prompt for SAML presence (yes/no) - vars_prompt: - - name: "saml_yes" - prompt: "Is SAML required (yes/no)?" - private: no - - name: Ensure TS-XXXXX directory exists in the current directory file: path: "./{{ TS_DIR }}" @@ -76,7 +56,7 @@ - name: Generate the NGINX configuration file template: - src: templates/nginx_template.j2 + src: nginx_template.j2 dest: "./{{ TS_DIR }}/{{ URL }}.conf" vars: - saml_yes: "{{ 's' if saml_yes == 'yes' else '' }}" + saml_yes: "{{ 's' if saml_yes == 'yes' else '' }}" \ No newline at end of file