forked from Nader-abdi/udp2raw-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.yaml
47 lines (40 loc) · 1.28 KB
/
client.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
- hosts: clients
become: true
tasks:
- name: Include variables from config file
include_vars: config.yaml
- name: Create udp2raw directory if it does not exist
ansible.builtin.file:
path: "{{ udp2raw_directory }}"
state: directory
mode: 0750
owner: ubuntu
group: ubuntu
- name: Download tar.gz file
get_url:
url: "https://github.com/wangyu-/udp2raw/releases/download/20230206.0/udp2raw_binaries.tar.gz"
dest: "{{ udp2raw_directory }}"
mode: 0640
- name: Extract udp2raw_binaries.tar.gz file
unarchive:
src: "{{ udp2raw_directory }}/udp2raw_binaries.tar.gz"
dest: "{{ udp2raw_directory }}"
remote_src: yes
- name: Add systemd unit file template
template:
src: udp2raw-client.service.j2
dest: "/etc/systemd/system/{{ udp2raw_client_systemd_file_name }}.service"
mode: 0644
owner: root
group: root
- name: Reload systemd daemon
systemd:
name: "{{ udp2raw_client_systemd_file_name }}"
daemon_reload: true
enabled: true
state: started
vars:
udp2raw_file: "udp2raw_amd64"
udp2raw_client_service_description: "udp2raw client"
udp2raw_directory: "/home/ubuntu/udp2raw"