Skip to content

Commit

Permalink
FIX: Name and lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
NeoPlays committed Jun 11, 2024
1 parent 8c0c396 commit b092662
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
service_configuration: "{{ service_configuration_raw['content'] | b64decode | from_yaml }}"
service_configuration_text: "{{ service_configuration_raw['content'] | b64decode }}"

- name: Adjust Charon Config if connected to "ssv-nimbus"
- name: Adjust Charon Config if connected to a NimbusBeaconService
lineinfile:
path: "{{ config_file_path }}"
insertafter: "--beacon-node-endpoints"
Expand Down
13 changes: 10 additions & 3 deletions controls/roles/update-changes/tasks/2.1.5/charon_teku_changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,22 @@
service_configuration_text: "{{ service_configuration_raw['content'] | b64decode }}"

- name: Check if service_configuration.id is in any of the filtered_files
set_fact:
id_in_filtered_files: "{{ filtered_files | map('lookup', 'file') | join(' ') | regex_search(service_configuration.id) }}"
shell: "grep -lq '{{ service_configuration.id }}' {{ item }}"
loop: "{{ filtered_files }}"
ignore_errors: true
register: grep_result
changed_when: false

- name: debug grep_result
debug:
var: grep_result

- name: Adjust Teku Config if charon service connected to it
lineinfile:
path: "{{ item.path }}"
insertafter: "--network"
line: "{{ service_configuration_text | split('\n') | select('match', '^\\s*- --network') | first | split('-') | first }}- --validators-graffiti-client-append-format=DISABLED"
when:
- id_in_filtered_files
- grep_result.results | selectattr('rc', 'equalto', 0) | list | length > 0
- service_configuration.service == "TekuBeaconService"
- service_configuration.command | select('match', '--validators-graffiti-client-append-format') | length == 0

0 comments on commit b092662

Please sign in to comment.