fixsess and logic for web ide
ci-agent / build (push) Failing after 2m42s

This commit is contained in:
d3m0k1d
2026-04-04 23:56:28 +03:00
parent 1e4e65bb84
commit b516a54c17
17 changed files with 1792 additions and 113 deletions
+23 -33
View File
@@ -1,6 +1,8 @@
package ansible
// BinaryDeployPlaybook returns the Ansible playbook for binary deployment
// BinaryDeployPlaybook returns the Ansible playbook for binary deployment.
// Downloads the agent binary, writes config, and starts it directly (no systemd).
// systemd unit is managed separately (e.g. via goreleaser .deb/.rpm packages).
const BinaryDeployPlaybook = `---
- name: Deploy HellreigN Agent (Binary)
hosts: all
@@ -11,7 +13,6 @@ const BinaryDeployPlaybook = `---
backend_url: "{{ backend_url }}"
install_dir: /opt/hellreign
bin_name: hellreign-agent
service_name: hellreign-agent
cert_dir: "{{ install_dir }}/certs"
tasks:
@@ -37,45 +38,29 @@ const BinaryDeployPlaybook = `---
copy:
content: |
backend_url: "{{ backend_url }}"
grpc_url: "{{ grpc_url | default('localhost:9001') }}"
label: "{{ agent_label }}"
registration_token: "{{ agent_token }}"
cert_dir: "{{ cert_dir }}"
services:
- name: system
type: journald
dest: "{{ install_dir }}/config.yml"
mode: '0644'
- name: Create systemd service file
copy:
content: |
[Unit]
Description=HellreigN Agent
After=network.target
[Service]
Type=simple
ExecStart={{ install_dir }}/{{ bin_name }}
Restart=always
RestartSec=5
Environment=CONFIG_FILE={{ install_dir }}/config.yml
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
dest: /etc/systemd/system/{{ service_name }}.service
mode: '0644'
- name: Reload systemd daemon
systemd:
daemon_reload: yes
- name: Enable and start HellreigN Agent service
systemd:
name: "{{ service_name }}"
enabled: yes
state: started
- name: Start HellreigN Agent
shell: |
nohup {{ install_dir }}/{{ bin_name }} > /dev/null 2>&1 &
echo $!
args:
executable: /bin/bash
environment:
CONFIG_FILE: "{{ install_dir }}/config.yml"
register: agent_pid
changed_when: true
`
// DockerDeployPlaybook returns the Ansible playbook for Docker deployment
// DockerDeployPlaybook returns the Ansible playbook for Docker deployment.
const DockerDeployPlaybook = `---
- name: Deploy HellreigN Agent (Docker)
hosts: all
@@ -84,6 +69,7 @@ const DockerDeployPlaybook = `---
agent_label: "{{ agent_label }}"
agent_token: "{{ agent_token }}"
backend_url: "{{ backend_url }}"
grpc_url: "{{ grpc_url | default('localhost:9001') }}"
container_name: hellreign-agent-{{ agent_label }}
image: "gitea.d3m0k1d.ru/d3m0k1d/hellreign-agent:latest"
cert_dir: /etc/hellreign-agent/certs
@@ -117,9 +103,13 @@ const DockerDeployPlaybook = `---
copy:
content: |
backend_url: "{{ backend_url }}"
grpc_url: "{{ grpc_url }}"
label: "{{ agent_label }}"
registration_token: "{{ agent_token }}"
cert_dir: "{{ cert_dir }}"
services:
- name: system
type: journald
dest: "{{ cert_dir }}/config.yml"
mode: '0644'