Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let users override computed avalanchego_node_json values #76

Closed
leopaul36 opened this issue Jul 4, 2023 · 0 comments · Fixed by #77
Closed

Let users override computed avalanchego_node_json values #76

leopaul36 opened this issue Jul 4, 2023 · 0 comments · Fixed by #77
Assignees
Labels
enhancement New feature or request

Comments

@leopaul36
Copy link
Contributor

For now, some properties templated in node.json are computed:

  set_fact:
    bootstrap_ip: "{{ hostvars[groups['bootstrap_node'][0]]['ansible_host'] }}"
  when: avalanchego_network_id == 'local'

- name: Construct public-ip conf
  set_fact:
    node_conf_public_ip: |
      {{ {'public-ip': ansible_host} if avalanchego_static_public_ip else {} }}

- name: Construct bootstrap-* conf
  set_fact:
    node_conf_bootstrap: |
      {{ {
           'bootstrap-ips': '' if inventory_hostname == groups['bootstrap_node'][0]
             else (bootstrap_ip + ':' + (avalanchego_staking_port | string)),
           'bootstrap-ids': '' if inventory_hostname == groups['bootstrap_node'][0]
             else (avalanchego_bootstrap_node_id) 
         } if avalanchego_network_id == 'local' else {} }}

- name: Construct staking-tls-*-file conf
  set_fact:
    node_conf_staking_tls_files: |
      {{ {
           'staking-tls-cert-file': avalanchego_staking_certs_dir + '/' + inventory_hostname + '.crt',
           'staking-tls-key-file': avalanchego_staking_certs_dir + '/' + inventory_hostname + '.key'
         } if avalanchego_staking_use_local_certs else {} }}

- name: Construct http-tls-*-file conf
  set_fact:
    node_conf_http_tls_files: |
      {{ {
           'http-tls-cert-file': avalanchego_https_cert_file,
           'http-tls-key-file': avalanchego_https_key_file
         } if avalanchego_https_enabled else {} }}

We should be able to override these if they are already configured in avalanchego_node_json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant