Skip to content

Commit

Permalink
consul variables cleaning rc
Browse files Browse the repository at this point in the history
  • Loading branch information
aurelienmaury committed Mar 27, 2024
1 parent fd7e95e commit 0fbdb05
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
11 changes: 7 additions & 4 deletions roles/consul/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ hs_consul_node_cert_fullchain: "{{ hs_consul_local_secrets_dir }}/self.fullchain
# * Path to local node certificate private key.
hs_consul_node_cert_private_key: "{{ hs_consul_local_secrets_dir }}/self.cert.key"

hs_consul_terraform_work_dir:
hs_consul_terraform_work_dir: >-
{{
hs_workspace_tf_modules_dir
| default(lookup('env', 'PWD') + '/terraform')
Expand All @@ -43,12 +43,15 @@ hs_consul_terraform_work_dir:
hs_consul_datacenter_name: "{{ hs_workspace | default('datacenter1') }}"
hs_consul_node_name: "{{ inventory_hostname | regex_replace('_', '-') }}"
hs_consul_connect_token: ~

#
# * HTTPS listener
#
hs_consul_https_listen_ipv4: "0.0.0.0"
hs_consul_api_port: "8501"

#
# * GRPC listener
#
hs_consul_grpc_listen_ipv4: "0.0.0.0"
hs_consul_grpc_port: "8502"
hs_consul_grpc_tls_port: "8503"

hs_consul_prometheus_enabled: true
Expand Down
2 changes: 1 addition & 1 deletion roles/consul/tasks/_tf_configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

- name: "[LOCAL] Copy terraform consul configuration" # noqa risky-file-permissions name[template]
copy:
src: "{{ role_path }}/files/consul_config/"
src: "{{ __hs_consul_local_tf_config }}/"
dest: "{{ hs_consul_terraform_work_dir }}/consul_config/"
mode: "u+rwX,g+rX,o-rX"
delegate_to: localhost
Expand Down
4 changes: 2 additions & 2 deletions roles/consul/tasks/common/_prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
run_once: true
become: false
command: >
terraform -chdir={{ role_path }}/files/terraform init
terraform -chdir={{ __hs_consul_local_tf_config }} init
tags:
- online
- prepare-tf-providers
Expand All @@ -25,7 +25,7 @@
run_once: true
become: false
file:
path: "{{ role_path }}/files/terraform/.terraform/"
path: "{{ __hs_consul_local_tf_config }}/.terraform/"
state: absent
tags:
- online
Expand Down
2 changes: 2 additions & 0 deletions roles/consul/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,5 @@ __hs_consul_archive_filename: "consul-{{ hs_consul_version }}.zip"
__hs_consul_local_archive_path: "{{ hs_consul_local_cache_dir }}/{{ __hs_consul_archive_filename }}"
__hs_consul_license_file: "{{ __hs_consul_conf_dir }}/consul.license"


__hs_consul_local_tf_config: "{{ role_path }}/files/consul_config"

0 comments on commit 0fbdb05

Please sign in to comment.