diff --git a/bkk03 b/bkk03 index 9e3a1c3..5cf3f41 100644 --- a/bkk03 +++ b/bkk03 @@ -17,6 +17,7 @@ bkk00 [polkadot] dot23 +ksm23 wnd23 [cumulus] @@ -27,14 +28,14 @@ wbr23 pch23 wch23 -[proxmox_hosts] -bkk03 - [services] ibp [unmanaged] +[proxmox_hosts] +bkk03 + [hardware] bkk03 @@ -44,7 +45,6 @@ proxmox_nodes unmanaged [referrence_nodes] -dot14 -dot24 -wnd14 -wnd24 +monitor +dot26 +wnd26 diff --git a/bkk04 b/bkk04 index 26155a7..ae9bd97 100644 --- a/bkk04 +++ b/bkk04 @@ -17,22 +17,16 @@ bkk00 [polkadot] ksm04 ksm24 -; pso24 +pso24 [cumulus] -; mine24 -; kbr24 -; kch24 -; pabr24 -; pach24 +mine24 +kbr24 [encointer] -enc14 -; enc24 +enc24 [services] -ansible -matrix monitor [proxmox_hosts] @@ -49,7 +43,7 @@ proxmox_nodes unmanaged [referrence_nodes] -dot14 -dot24 -wnd14 -wnd24 +ksm14 +ksm24 +ksm26 +pso26 diff --git a/host_vars/dot24.yaml b/host_vars/dot24.yaml deleted file mode 100644 index 66d5763..0000000 --- a/host_vars/dot24.yaml +++ /dev/null @@ -1,29 +0,0 @@ ---- -ansible_host: "27.131.160.106" -container_ip: "192.168.69.14" -ansible_port: "2314" -host_name: "dot24.rotko.net" -host_timezone: "Asia/Bangkok" -netif: '{"net0":"name=eth0,gw={{ default_nat_network_forward_cidr.split("/")[0] }},ip={{ default_host_ip }}/16,bridge={{ default_nat_device }}"}' -role: "polkadot" -pinned_service: True - -default_telemetry_name: "Rotko Networks - {{ host_name.split('.')[0] }} {{ default_node_type | capitalize }}" -default_public_dns: "{{ host_name }}" -default_public_dns_lb: "polkadot.rotko.net" -default_public_dns_ibp: "rpc.ibp.network" -default_public_dns_dotters: "rpc.dotters.network" -default_ibp_repository: "git@github.com:GATOTECH-LTD/ibp-ssl" -default_dotters_repository: "git@github.com:senseless/dotters-ssl" -default_network: "polkadot" -default_node_type: "endpoint" -default_pruning: "archive" -default_database: rocksdb -default_syncmode: full -default_p2p_port: 33314 -default_p2p_port_ws: 34314 -default_p2p_port_wss: 35314 -default_rpc_port: 9314 -default_secure_rpc_port: 42314 -default_prom_port: 7314 -zabbix_ext_port: 10314 diff --git a/host_vars/ksm24.yaml b/host_vars/ksm24.yaml index 8e4ef53..1213556 100644 --- a/host_vars/ksm24.yaml +++ b/host_vars/ksm24.yaml @@ -18,7 +18,7 @@ default_dotters_repository: "git@github.com:senseless/dotters-ssl" default_network: kusama default_node_type: "endpoint" default_pruning: "archive" -default_database: rocksdb +default_database: paritydb default_syncmode: full default_p2p_port: 33324 default_p2p_port_ws: 34324 diff --git a/host_vars/mint26.yaml b/host_vars/mint26.yaml index bb873c8..a1175f5 100644 --- a/host_vars/mint26.yaml +++ b/host_vars/mint26.yaml @@ -18,7 +18,7 @@ default_node_type: "endpoint" default_p2p_port: 33616 default_p2p_port_ws: 34616 default_p2p_port_wss: 35616 -default_rpc_port: 9716 +default_rpc_port: 9616 default_secure_rpc_port: 42616 default_prom_port: 7616 zabbix_ext_port: 10616 diff --git a/host_vars/wnd24.yaml b/host_vars/wnd24.yaml deleted file mode 100644 index 3de99f2..0000000 --- a/host_vars/wnd24.yaml +++ /dev/null @@ -1,29 +0,0 @@ ---- -ansible_host: "27.131.160.106" -container_ip: "192.168.69.34" -ansible_port: "2334" -host_name: "wnd24.rotko.net" -host_timezone: "Asia/Bangkok" -netif: '{"net0":"name=eth0,gw={{ default_nat_network_forward_cidr.split("/")[0] }},ip={{ default_host_ip }}/16,bridge={{ default_nat_device }}"}' -role: "polkadot" -pinned_service: True - -default_telemetry_name: "Rotko Networks - {{ host_name.split('.')[0] }} {{ default_node_type | capitalize }}" -default_public_dns: "{{ host_name }}" -default_public_dns_lb: "westend.rotko.net" -default_public_dns_ibp: "rpc.ibp.network" -default_public_dns_dotters: "rpc.dotters.network" -default_ibp_repository: "git@github.com:GATOTECH-LTD/ibp-ssl" -default_dotters_repository: "git@github.com:senseless/dotters-ssl" -default_network: "westend" -default_node_type: "endpoint" -default_pruning: "archive" -default_database: paritydb -default_syncmode: full -default_p2p_port: 33334 -default_p2p_port_ws: 34334 -default_p2p_port_wss: 35334 -default_rpc_port: 9334 -default_secure_rpc_port: 42334 -default_prom_port: 7334 -zabbix_ext_port: 10334 diff --git a/inventory b/inventory index 6b9b188..e54cdea 100644 --- a/inventory +++ b/inventory @@ -28,6 +28,14 @@ kbr13 wmint14 wbr13 wch13 +mint23 +pbr23 +pch23 +mine24 +kbr24 +wmint23 +wbr23 +wch23 mint26 pbr26 pch26 @@ -42,27 +50,23 @@ enc14 enc26 [polkadot] -ksm01 dot01 -ksm02 dot02 -dot23 -ksm23 -wnd23 -dot26 -ksm26 -wnd26 -dot14 -dot24 +ksm01 +ksm02 ksm04 +pso06 +dot14 ksm14 -ksm24 wnd14 -wnd24 -pso01 -pso02 -pso06 pso16 +dot23 +dot26 +ksm23 +ksm24 +ksm26 +wnd23 +wnd26 pso26 [proxmox_hosts] diff --git a/roles/proxmox_setup_nodes/tasks/main.yaml b/roles/proxmox_setup_nodes/tasks/main.yaml index b5e8572..d2cec89 100644 --- a/roles/proxmox_setup_nodes/tasks/main.yaml +++ b/roles/proxmox_setup_nodes/tasks/main.yaml @@ -1,59 +1,54 @@ -# Standards: 0.2 + # Standards: 0.2 --- - name: Create predefined containers community.general.proxmox: + api_user: "{{ api_user }}" + api_password: "{{ api_password }}" api_host: "{{ proxmox_defaults.api_host }}" - api_user: "{{ proxmox_defaults.api_user }}" - api_password: "{{ proxmox_defaults.api_password | default(omit) }}" - api_token_id: "{{ proxmox_defaults.api_token_id | default(omit) }}" - api_token_secret: "{{ proxmox_defaults.api_token_secret | default(omit) }}" - node: "{{ item.proxmox_config.node }}" - password: "{{ item.proxmox_config.password }}" - hostname: "{{ item.proxmox_config.hostname }}" - ostemplate: "{{ item.proxmox_config.ostemplate }}" - disk: "{{ item.proxmox_config.disk | default(omit) }}" - cores: "{{ item.proxmox_config.cores | default(omit) }}" - memory: "{{ item.proxmox_config.memory | default(omit) }}" - swap: "{{ item.proxmox_config.swap | default(omit) }}" - netif: "{{ item.proxmox_config.netif | default(omit) }}" - features: "{{ item.proxmox_config.features | to_json | default(omit) }}" - onboot: "{{ item.proxmox_config.onboot | default(omit) }}" - unprivileged: "{{ item.proxmox_config.unprivileged | default(omit) }}" vmid: "{{ item.proxmox_config.vmid }}" - state: "{{ item.proxmox_config.state | default('present') }}" + hostname: "{{ item.proxmox_config.hostname }}" + template: "{{ item.proxmox_config.ostemplate }}" + netif: "{{ item.proxmox_config.netif }}" + cores: "{{ item.proxmox_config.cores }}" + memory: "{{ item.proxmox_config.memory }}" + swap: "{{ item.proxmox_config.swap }}" + password: "{{ item.proxmox_config.password }}" + disk: "{{ item.proxmox_config.disk }}" + mounts: "{{ item.proxmox_config.mounts }}" + onboot: "{{ item.proxmox_config.onboot }}" + unprivileged: "{{ item.proxmox_config.unprivileged }}" + validate_certs: "{{ item.proxmox_config.validate_certs }}" + description: "{{ item.proxmox_config.description }}" + state: "{{ item.proxmox_config.state }}" + features: "{{ item.proxmox_config.features }}" loop: "{{ lxc_nodes }}" when: lxc_nodes is defined register: container_creation_result - no_log: True # Adjust based on your security policies -- name: Start predefined nodes if not already started +- name: Start predefined nodes community.general.proxmox: + api_user: "{{ api_user }}" + api_password: "{{ api_password }}" api_host: "{{ proxmox_defaults.api_host }}" - api_user: "{{ proxmox_defaults.api_user }}" - api_password: "{{ proxmox_defaults.api_password | default(omit) }}" - api_token_id: "{{ proxmox_defaults.api_token_id | default(omit) }}" - api_token_secret: "{{ proxmox_defaults.api_token_secret | default(omit) }}" - node: "{{ item.proxmox_config.node }}" vmid: "{{ item.proxmox_config.vmid }}" state: 'started' loop: "{{ lxc_nodes }}" when: - lxc_nodes is defined - - item.proxmox_config.state == 'present' + - "'state' in item.proxmox_config" + - "item.proxmox_config['state'] == 'present'" register: container_start_result - no_log: True # Adjust based on your security policies - - # - name: Create predefined containers - # community.general.proxmox: "{{ proxmox_defaults | combine(item.proxmox_config) }}" - # loop: "{{ lxc_nodes }}" - # when: lxc_nodes is defined - # register: container_creation_result - # - # - name: Start predefined nodes - # community.general.proxmox: "{{ proxmox_defaults | combine({'vmid': item.proxmox_config['vmid'], 'state': 'started'}) }}" - # loop: "{{ lxc_nodes }}" - # when: - # - lxc_nodes is defined - # - item.proxmox_config['state'] == 'present' - # register: container_start_result +# - name: Create predefined containers +# community.general.proxmox: "{{ proxmox_defaults | combine(item.proxmox_config) }}" +# loop: "{{ lxc_nodes }}" +# when: lxc_nodes is defined +# register: container_creation_result +# +# - name: Start predefined nodes +# community.general.proxmox: "{{ proxmox_defaults | combine({'vmid': item.proxmox_config['vmid'], 'state': 'started'}) }}" +# loop: "{{ lxc_nodes }}" +# when: +# - lxc_nodes is defined +# - item.proxmox_config['state'] == 'present' +# register: container_start_result diff --git a/roles/setup_install_nginx/tasks/main.yaml b/roles/setup_install_nginx/tasks/main.yaml index d6a0d9e..9793e02 100644 --- a/roles/setup_install_nginx/tasks/main.yaml +++ b/roles/setup_install_nginx/tasks/main.yaml @@ -12,8 +12,9 @@ - name: Check certbot plugins ansible.builtin.command: - cmd: certbot plugins || true + cmd: certbot plugins register: certbot_plugins_output + failed_when: False changed_when: False - name: Install certbot_dns_porkbun plugin if absent @@ -34,7 +35,7 @@ -d "{{ default_public_dns }}" register: certbot_result changed_when: "'Congratulations' in certbot_result.stdout" - no_log: True + no_log: False - name: Reload nginx service ansible.builtin.service: @@ -111,7 +112,3 @@ dest: "/etc/nginx/sites-enabled/{{ default_public_dns }}" state: link notify: Reload nginx - -# - name: Include loadbalancer tasks for endpoints -# ansible.builtin.import_tasks: loadbalancer.yaml -# when: default_node_type == 'endpoint' diff --git a/roles/setup_install_prometheus/tasks/main.yaml b/roles/setup_install_prometheus/tasks/main.yaml index 1e5dc7b..054de7d 100644 --- a/roles/setup_install_prometheus/tasks/main.yaml +++ b/roles/setup_install_prometheus/tasks/main.yaml @@ -19,6 +19,7 @@ cmd: prometheus --version | grep prometheus | awk '{print substr($3, 0, length($3))}' register: prometheus_installed changed_when: False + failed_when: False - name: Import Prometheus tasks ansible.builtin.import_tasks: "prometheus-tasks.yaml"