diff --git a/group_vars/all/all.yaml b/group_vars/all/all.yaml index ca0a153..cf93f86 100644 --- a/group_vars/all/all.yaml +++ b/group_vars/all/all.yaml @@ -182,3 +182,4 @@ service_users: unique: "unique" polimec: "polimec" ajuna: "ajuna" + penumbra: "penumbra" diff --git a/group_vars/penumbra.yaml b/group_vars/penumbra.yaml index 895351e..b796cf9 100644 --- a/group_vars/penumbra.yaml +++ b/group_vars/penumbra.yaml @@ -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" diff --git a/host_vars/bkk06.yaml b/host_vars/bkk06.yaml index 78cca09..cc0e96d 100644 --- a/host_vars/bkk06.yaml +++ b/host_vars/bkk06.yaml @@ -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" diff --git a/host_vars/bkk07.yaml b/host_vars/bkk07.yaml index 33d96bc..eea1603 100644 --- a/host_vars/bkk07.yaml +++ b/host_vars/bkk07.yaml @@ -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: @@ -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" diff --git a/roles/setup_install_penumbra/tasks/main.yaml b/roles/setup_install_penumbra/tasks/main.yaml index 8b8a787..2957c43 100644 --- a/roles/setup_install_penumbra/tasks/main.yaml +++ b/roles/setup_install_penumbra/tasks/main.yaml @@ -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 @@ -26,7 +26,7 @@ mode: "0750" state: directory loop: - - "{{ default_base_path }}" + - "{{ default_home_path }}" - "{{ default_database_path }}" - name: Gather facts @@ -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 @@ -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 @@ -59,13 +57,21 @@ 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 }}" @@ -73,7 +79,7 @@ - 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 }}" @@ -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