From 8395f200b45b8739352b2e87dd83e86981c7a499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Thu, 20 Jun 2024 16:01:14 +0200 Subject: [PATCH] mainnet,sepolia,holesky: add tags for include_role tasks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit By using `apply` argument we can make the `tags` work for `include_role` calls used together with `with_items`. Signed-off-by: Jakub SokoĊ‚owski --- ansible/holesky.yml | 48 +++++++++++++++++++++++++++++++++++++-------- ansible/mainnet.yml | 14 +++++++++---- ansible/sepolia.yml | 38 ++++++++++++++++++++++++----------- 3 files changed, 77 insertions(+), 23 deletions(-) diff --git a/ansible/holesky.yml b/ansible/holesky.yml index 4a59cc4..93de0c6 100644 --- a/ansible/holesky.yml +++ b/ansible/holesky.yml @@ -24,10 +24,18 @@ - { role: redirect-ports, tags: redirect-ports } - { role: nimbus-era-files, tags: nimbus-era-files } tasks: - - include_role: name=infra-role-beacon-node-linux + - include_role: + name: infra-role-beacon-node-linux + apply: + tags: always + tags: [ beacon-node ] with_items: '{{ nodes_layout[hostname] }}' loop_control: { loop_var: node, index_var: idx } - - include_role: name=infra-role-validator-client + - include_role: + name: infra-role-validator-client + apply: + tags: always + tags: [ validator-client ] with_items: '{{ nodes_layout[hostname] }}' when: validator_client_service_enabled loop_control: { loop_var: node, index_var: idx } @@ -38,12 +46,20 @@ hosts: nimbus-holesky-geth vars_files: layout/holesky.yml tasks: - - include_role: name=infra-role-geth + - include_role: + name: infra-role-geth + apply: + tags: always + tags: [ geth ] when: node.el == "geth" with_items: '{{ nodes_layout[hostname] }}' loop_control: { loop_var: node, index_var: idx } - - include_role: name=infra-role-geth-exporter + - include_role: + name: infra-role-geth-exporter + apply: + tags: always + tags: [ geth-exporter ] when: node.el == "geth" with_items: '{{ nodes_layout[hostname] }}' loop_control: { loop_var: node, index_var: idx } @@ -54,7 +70,11 @@ hosts: nimbus-holesky-erigon vars_files: layout/holesky.yml tasks: - - include_role: name=infra-role-erigon + - include_role: + name: infra-role-erigon + apply: + tags: always + tags: [ erigon ] when: node.el == "erigon" with_items: '{{ nodes_layout[hostname] }}' loop_control: { loop_var: node, index_var: idx } @@ -65,7 +85,11 @@ hosts: nimbus-holesky-neth vars_files: layout/holesky.yml tasks: - - include_role: name=infra-role-nethermind + - include_role: + name: infra-role-nethermind + apply: + tags: always + tags: [ nethermind ] when: node.el == "nethermind" with_items: '{{ nodes_layout[hostname] }}' loop_control: { loop_var: node, index_var: idx } @@ -76,7 +100,11 @@ - nimbus-holesky-macm2 vars_files: layout/holesky.yml tasks: - - include_role: name=infra-role-beacon-node-macos + - include_role: + name: infra-role-beacon-node-macos + apply: + tags: always + tags: [ beacon-node ] with_items: '{{ nodes_layout[hostname] }}' loop_control: { loop_var: node, index_var: idx } @@ -87,6 +115,10 @@ fact_path: 'C:/ansible/facts.d' vars_files: layout/holesky.yml tasks: - - include_role: name=infra-role-beacon-node-windows + - include_role: + name: infra-role-beacon-node-windows + apply: + tags: always + tags: [ beacon-node ] with_items: '{{ nodes_layout[hostname] }}' loop_control: { loop_var: node, index_var: idx } diff --git a/ansible/mainnet.yml b/ansible/mainnet.yml index 3f08d1f..2a12da3 100644 --- a/ansible/mainnet.yml +++ b/ansible/mainnet.yml @@ -20,9 +20,12 @@ roles: - { role: infra-role-swap-file, tags: [ swap-file ] } - { role: redirect-ports, tags: [ redirect-ports ] } - - { role: get-geth-api-urls, tags: [ get-geth-api-urls ] } + - { role: get-geth-api-urls, tags: [ get-geth-api-urls, beacon-node ] } tasks: - - include_role: name=infra-role-beacon-node-linux + - include_role: + name: infra-role-beacon-node-linux + apply: { tags: always } + tags: [ beacon-node ] with_items: '{{ nodes_layout[hostname] }}' loop_control: loop_var: node @@ -44,10 +47,13 @@ - { role: redirect-ports, tags: [ redirect-ports ] } - { role: infra-role-geth, tags: [ infra-role-geth ] } - { role: infra-role-geth-exporter, tags: [ infra-role-geth-exporter ] } - - { role: get-geth-api-urls, tags: [ get-geth-api-urls ] } + - { role: get-geth-api-urls, tags: [ get-geth-api-urls, beacon-node ] } - { role: nimbus-era-files, tags: [ nimbus-era-files ] } tasks: - - include_role: name=infra-role-beacon-node-linux + - include_role: + name: infra-role-beacon-node-linux + apply: { tags: always } + tags: [ beacon-node ] with_items: '{{ nodes_layout[hostname] }}' loop_control: loop_var: node diff --git a/ansible/sepolia.yml b/ansible/sepolia.yml index 43c6a3e..d34ea8f 100644 --- a/ansible/sepolia.yml +++ b/ansible/sepolia.yml @@ -22,19 +22,31 @@ - { role: redirect-ports, tags: [ redirect-ports ] } - { role: nimbus-era-files, tags: [ nimbus-era-files ] } tasks: - - include_role: name=infra-role-geth + - include_role: + name: infra-role-geth + apply: + tags: always + tags: [ geth ] with_items: '{{ nodes_layout[hostname] }}' loop_control: loop_var: node index_var: idx - - include_role: name=infra-role-beacon-node-linux + - include_role: + name: infra-role-beacon-node-linux + apply: + tags: always + tags: [ beacon-node ] with_items: '{{ nodes_layout[hostname] }}' loop_control: loop_var: node index_var: idx - - include_role: name=infra-role-validator-client + - include_role: + name: infra-role-validator-client + apply: + tags: always + tags: [ validator-client ] with_items: '{{ nodes_layout[hostname] }}' when: validator_client_service_enabled loop_control: @@ -44,20 +56,24 @@ - name: Deploy Sepolia Testnet Nimbus-Eth1 trial become: true serial: '{{ serial|default(1) }}' - hosts: - - nimbus-sepolia-linux + hosts: nimbus-sepolia-linux + vars_files: vars/nimbus-sepolia-trial.yml tasks: - - name: Load network specific variables - tags: [ always ] - include_vars: file=vars/nimbus-sepolia-trial.yml - - - include_role: name=infra-role-nimbus-eth1 + - include_role: + name: infra-role-nimbus-eth1 + apply: + tags: always + tags: [ nimbus-eth ] with_items: '{{ nodes_layout[hostname] }}' loop_control: loop_var: node index_var: idx - - include_role: name=infra-role-beacon-node-linux + - include_role: + name: infra-role-beacon-node-linux + apply: + tags: always + tags: [ beacon-node ] with_items: '{{ nodes_layout[hostname] }}' loop_control: loop_var: node