49 lines
1.1 KiB
YAML
49 lines
1.1 KiB
YAML
- name: Create config directory
|
|
ansible.builtin.file:
|
|
path: /etc/jagacloud
|
|
state: directory
|
|
mode: '0755'
|
|
|
|
- name: Place sample agent config
|
|
ansible.builtin.copy:
|
|
dest: /etc/jagacloud/agent.yaml
|
|
content: |
|
|
listen_addr: ":8000"
|
|
libvirt_uri: "qemu:///system"
|
|
lxc_path: "/etc/jagacloud/lxc"
|
|
podman_socket: "/run/podman/podman.sock"
|
|
auth_token: "changeme"
|
|
|
|
- name: Install node-agent binary (placeholder)
|
|
ansible.builtin.copy:
|
|
src: files/node-agent
|
|
dest: /usr/local/bin/node-agent
|
|
mode: '0755'
|
|
ignore_errors: true
|
|
|
|
- name: Install systemd unit
|
|
ansible.builtin.copy:
|
|
dest: /etc/systemd/system/node-agent.service
|
|
content: |
|
|
[Unit]
|
|
Description=Jagacloud Node Agent
|
|
After=network-online.target
|
|
|
|
[Service]
|
|
ExecStart=/usr/local/bin/node-agent
|
|
Restart=on-failure
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
|
|
- name: Reload systemd
|
|
ansible.builtin.systemd:
|
|
daemon_reload: yes
|
|
|
|
- name: Enable and start node-agent
|
|
ansible.builtin.systemd:
|
|
name: node-agent
|
|
state: started
|
|
enabled: yes
|
|
ignore_errors: true
|