Skip to content

Commit

Permalink
chore: debugging playbooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Catopish committed Dec 24, 2024
1 parent 3abe328 commit 92c8136
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 49 deletions.
1 change: 1 addition & 0 deletions group_vars/all/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,4 @@ service_users:
unique: "unique"
polimec: "polimec"
ajuna: "ajuna"
penumbra: "penumbra"
5 changes: 3 additions & 2 deletions group_vars/penumbra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ cometbft_download_url: "https://github.com/cometbft/cometbft/releases/download/v
polkachu_download_url: "wget -O penumbra_{{ polkachu_version }}.tar.lz4 https://snapshots.polkachu.com/snapshots/penumbra/penumbra_{{ polkachu_version }}.tar.lz4 --inet4-only"

# service/user
penumbra_service: "penumbra"
penumbra_user: "{{ service_users['penumbra'] }}"
default_service: "penumbra"
default_user: "{{ service_users['penumbra'] }}"
default_group: "{{ service_users['penumbra'] }}"

# paths
default_home_path: "/opt/penumbra"
Expand Down
26 changes: 0 additions & 26 deletions host_vars/bkk06.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2043,29 +2043,3 @@ lxc_nodes:
- from_port: "{{ hostvars['rpc-asset-hub-paseo-01']['transition_bootnode_p2p_port_wss'] }}"
to_host: "{{ hostvars['rpc-asset-hub-paseo-01']['container_ip'] }}:{{ hostvars['rpc-asset-hub-paseo-01']['transition_bootnode_p2p_port_wss'] }}"
protocol: "tcp"
- host: "penumbra-02"
proxmox_config:
vmid: "1102"
hostname: "{{ hostvars['penumbra-02']['host_name'] }}"
ostemplate: "local:vztmpl/{{ default_container_template }}"
netif: "{{ hostvars['penumbra-02']['netif'] }}"
cores: 4
memory: 8192
swap: 8192
password: "{{ default_password }}"
disk: "{{ zfs_storage }}:20"
mounts: '{"mp0":"{{ zfs_storage }}:200,mp={{ hostvars["penumbra-02"]["default_database_path"] }}"}'
onboot: True
unprivileged: True
validate_certs: False
description: "{{ hostvars['penumbra-02']['default_network'] }} {{ hostvars['penumbra-02']['default_node_type'] }}: {{ hostvars['penumbra-02']['host_name'] }}"
state: present
features:
- nesting=1
port_forwards:
- from_port: "{{ hostvars['penumbra-02']['ansible_port'] }}"
to_host: "{{ hostvars['penumbra-02']['container_ip'] }}:{{ ssh_port }}"
protocol: "tcp"
- from_port: "{{ hostvars['penumbra-02']['default_cometbft_p2p_port'] }}"
to_host: "{{ hostvars['penumbra-02']['container_ip'] }}:{{ hostvars['penumbra-02']['default_cometbft_p2p_port'] }}"
protocol: "tcp"
48 changes: 37 additions & 11 deletions host_vars/bkk07.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -858,34 +858,34 @@ lxc_nodes:
- from_port: "{{ hostvars['rpc-asset-hub-kusama-02']['default_p2p_port'] }}"
to_host: "{{ hostvars['rpc-asset-hub-kusama-02']['container_ip'] }}:{{ hostvars['rpc-asset-hub-kusama-02']['default_p2p_port'] }}"
protocol: "tcp"
- host: "rpc-bridge-hub-kusama-01"
- host: "rpc-bridge-hub-kusama-02"
proxmox_config:
vmid: "32021"
hostname: "{{ hostvars['rpc-bridge-hub-kusama-01']['host_name'] }}"
vmid: "32022"
hostname: "{{ hostvars['rpc-bridge-hub-kusama-02']['host_name'] }}"
ostemplate: "local:vztmpl/{{ default_container_template }}"
netif: "{{ hostvars['rpc-bridge-hub-kusama-01']['netif'] }}"
netif: "{{ hostvars['rpc-bridge-hub-kusama-02']['netif'] }}"
cores: 4
memory: 16384
swap: 8192
password: "{{ default_password }}"
disk: "{{ zfs_storage }}:20"
mounts: '{"mp0":"{{ zfs_storage }}:100,mp={{ hostvars["rpc-bridge-hub-kusama-01"]["default_database_path"] }}"}'
mounts: '{"mp0":"{{ zfs_storage }}:100,mp={{ hostvars["rpc-bridge-hub-kusama-02"]["default_database_path"] }}"}'
onboot: True
unprivileged: True
validate_certs: False
description: "{{ hostvars['rpc-bridge-hub-kusama-01']['default_network'] }} {{ hostvars['rpc-bridge-hub-kusama-01']['default_node_type'] }}: {{ hostvars['rpc-bridge-hub-kusama-01']['host_name'] }}"
description: "{{ hostvars['rpc-bridge-hub-kusama-02']['default_network'] }} {{ hostvars['rpc-bridge-hub-kusama-02']['default_node_type'] }}: {{ hostvars['rpc-bridge-hub-kusama-02']['host_name'] }}"
state: present
features:
- nesting=1
port_forwards:
- from_port: "{{ hostvars['rpc-bridge-hub-kusama-01']['ansible_port'] }}"
to_host: "{{ hostvars['rpc-bridge-hub-kusama-01']['container_ip'] }}:{{ ssh_port }}"
- from_port: "{{ hostvars['rpc-bridge-hub-kusama-02']['ansible_port'] }}"
to_host: "{{ hostvars['rpc-bridge-hub-kusama-02']['container_ip'] }}:{{ ssh_port }}"
protocol: "tcp"
- from_port: "{{ hostvars['rpc-bridge-hub-kusama-01']['zabbix_ext_port'] }}"
- from_port: "{{ hostvars['rpc-bridge-hub-kusama-02']['zabbix_ext_port'] }}"
to_host: "{{ hostvars['monitor']['container_ip'] }}:{{ zabbix_port }}"
protocol: "tcp"
- from_port: "{{ hostvars['rpc-bridge-hub-kusama-01']['default_p2p_port'] }}"
to_host: "{{ hostvars['rpc-bridge-hub-kusama-01']['container_ip'] }}:{{ hostvars['rpc-bridge-hub-kusama-01']['default_p2p_port'] }}"
- from_port: "{{ hostvars['rpc-bridge-hub-kusama-02']['default_p2p_port'] }}"
to_host: "{{ hostvars['rpc-bridge-hub-kusama-02']['container_ip'] }}:{{ hostvars['rpc-bridge-hub-kusama-02']['default_p2p_port'] }}"
protocol: "tcp"
- host: "rpc-coretime-kusama-02"
proxmox_config:
Expand Down Expand Up @@ -1157,3 +1157,29 @@ lxc_nodes:
- from_port: "{{ hostvars['proxy-bkk07']['zabbix_ext_port'] }}"
to_host: "{{ hostvars['monitor']['container_ip'] }}:{{ zabbix_port }}"
protocol: "tcp"
- host: "penumbra-02"
proxmox_config:
vmid: "1102"
hostname: "{{ hostvars['penumbra-02']['host_name'] }}"
ostemplate: "local:vztmpl/{{ default_container_template }}"
netif: "{{ hostvars['penumbra-02']['netif'] }}"
cores: 4
memory: 8192
swap: 8192
password: "{{ default_password }}"
disk: "{{ zfs_storage }}:20"
mounts: '{"mp0":"{{ zfs_storage }}:200,mp={{ hostvars["penumbra-02"]["default_database_path"] }}"}'
onboot: True
unprivileged: True
validate_certs: False
description: "{{ hostvars['penumbra-02']['default_network'] }} {{ hostvars['penumbra-02']['default_node_type'] }}: {{ hostvars['penumbra-02']['host_name'] }}"
state: present
features:
- nesting=1
port_forwards:
- from_port: "{{ hostvars['penumbra-02']['ansible_port'] }}"
to_host: "{{ hostvars['penumbra-02']['container_ip'] }}:{{ ssh_port }}"
protocol: "tcp"
- from_port: "{{ hostvars['penumbra-02']['default_cometbft_p2p_port'] }}"
to_host: "{{ hostvars['penumbra-02']['container_ip'] }}:{{ hostvars['penumbra-02']['default_cometbft_p2p_port'] }}"
protocol: "tcp"
26 changes: 16 additions & 10 deletions roles/setup_install_penumbra/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
create_home: False
group: "{{ default_user }}"
groups: []
home: "{{ default_base_path }}"
home: "{{ default_home_path }}"
name: "{{ default_user }}"
shell: "/sbin/nologin"
state: present
Expand All @@ -26,7 +26,7 @@
mode: "0750"
state: directory
loop:
- "{{ default_base_path }}"
- "{{ default_home_path }}"
- "{{ default_database_path }}"

- name: Gather facts
Expand All @@ -39,7 +39,6 @@
become_user: "{{ default_user }}"
when: ansible_local['noderole']['node']['version'] != penumbra_version
args:
warn: False
executable: /bin/bash

- name: Download and install pd
Expand All @@ -49,7 +48,6 @@
become_user: "{{ default_user }}"
when: ansible_local['noderole']['node']['version'] != penumbra_version
args:
warn: False
executable: /bin/bash

- name: Download and install pclientd
Expand All @@ -59,21 +57,29 @@
become_user: "{{ default_user }}"
when: ansible_local['noderole']['node']['version'] != penumbra_version
args:
warn: False
executable: /bin/bash

- name: Ensure tmp directory exists
ansible.builtin.file:
path: "{{ default_home_path }}/tmp"
state: directory
mode: "0750"
owner: "{{ default_user }}"
group: "{{ default_user }}"
when: ansible_local['noderole']['node']['version'] != cometbft_version

- name: Download cometbft
ansible.builtin.get_url:
url: "{{ cometbft_download_url }}"
dest: "{{ default_home_path }}"
dest: "{{ default_home_path }}/tmp"
mode: "u+r+x"
owner: "{{ default_user }}"
group: "{{ default_user }}"
when: ansible_local['noderole']['node']['version'] != cometbft_version

- name: Unpack cometbft
ansible.builtin.unarchive:
src: "{{ default_home_path }}/cometbft_{{ cometbft_version }}_linux_amd64.tar.gz"
src: "{{ default_home_path }}/tmp/cometbft_{{ cometbft_version }}_linux_amd64.tar.gz"
dest: "{{ default_home_path }}"
remote_src: True
owner: "{{ default_user }}"
Expand All @@ -89,11 +95,11 @@
owner: "{{ default_user }}"
group: "{{ default_user }}"
loop:
- src: "{{ default_installation_path }}/pd"
- src: "{{ default_home_path }}/.cargo/bin/pd"
dest: "{{ default_home_path }}/pd"
- src: "{{ default_installation_path }}/pcli"
- src: "{{ default_home_path }}/.cargo/bin/pcli"
dest: "{{ default_home_path }}/pcli"
- src: "{{ default_installation_path }}/pclientd"
- src: "{{ default_home_path }}/.cargo/bin/pclientd"
dest: "{{ default_home_path }}/pclientd"

- name: Install lz4 package
Expand Down

0 comments on commit 92c8136

Please sign in to comment.