Skip to content

Commit 211f89e

Browse files
authored
Merge pull request #3 from Trozz/master
merge upstream
2 parents 904ae90 + 1fc3f6c commit 211f89e

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ nebula_version: 1.5.0
55
# force overwrite
66
nebula_force_install: false
77

8+
# location of the nebula binaries
9+
nebula_bin_directory: /bin
10+
811
# this will cause net.ipv4.ip_forward to be set to 1 to allow unsafe routes
912
enable_ip_forward: false
1013

tasks/main.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,51 @@
88
notify:
99
- Restart_nebula
1010

11+
- name: Ensure nebula bin directory exists
12+
file:
13+
path: "{{ nebula_bin_directory }}"
14+
state: directory
15+
1116
- name: Download release from Github (x86)
1217
unarchive:
1318
src: https://github.com/slackhq/nebula/releases/download/v{{ nebula_version }}/nebula-{{ ansible_system|lower }}-amd64.tar.gz
14-
dest: /bin
19+
dest: "{{ nebula_bin_directory }}"
1520
remote_src: yes
1621
mode: 0755
17-
creates: "{{ '/bin/nebula' if nebula_force_install == false else '' }}"
22+
creates: "{{ (nebula_bin_directory + '/nebula') if nebula_force_install == false else '' }}"
1823
when: ansible_architecture == "x86_64"
1924

2025
- name: Download release from Github (arm64)
2126
unarchive:
2227
src: https://github.com/slackhq/nebula/releases/download/v{{ nebula_version }}/nebula-{{ ansible_system|lower }}-arm64.tar.gz
23-
dest: /bin
28+
dest: "{{ nebula_bin_directory }}"
2429
remote_src: yes
2530
mode: 0755
26-
creates: "{{ '/bin/nebula' if nebula_force_install == false else '' }}"
31+
creates: "{{ (nebula_bin_directory + '/nebula') if nebula_force_install == false else '' }}"
2732
when: ansible_architecture == "armv64" or ansible_architecture == "aarch64"
2833

2934
- name: Download release from Github (arm7)
3035
unarchive:
3136
src: https://github.com/slackhq/nebula/releases/download/v{{ nebula_version }}/nebula-{{ ansible_system|lower }}-arm-7.tar.gz
32-
dest: /bin
37+
dest: "{{ nebula_bin_directory }}"
3338
remote_src: yes
3439
mode: 0755
35-
creates: "{{ '/bin/nebula' if nebula_force_install == false else '' }}"
40+
creates: "{{ (nebula_bin_directory + '/nebula') if nebula_force_install == false else '' }}"
3641
when: ansible_architecture == "armv7l"
3742

3843
- name: Set correct user and group on the nebula binary
3944
ansible.builtin.file:
40-
path: /bin/nebula
45+
path: "{{ nebula_bin_directory }}/nebula"
4146
owner: root
4247
group: root
43-
mode: "0750"
48+
mode: '0750'
49+
50+
- name: Set correct user and group on the nebula-cert binary
51+
ansible.builtin.file:
52+
path: "{{ nebula_bin_directory }}/nebula-cert"
53+
owner: root
54+
group: root
55+
mode: '0750'
4456

4557
- name: Create configuration directory
4658
file:
@@ -60,7 +72,7 @@
6072
- Restart_nebula
6173

6274
- name: Verify configuration
63-
ansible.builtin.command: /bin/nebula -test -config /etc/nebula/config.yaml 1>/dev/null
75+
ansible.builtin.command: "{{ nebula_bin_directory }}/nebula -test -config /etc/nebula/config.yaml 1>/dev/null"
6476
changed_when: false
6577

6678
- name: Deploy systemd template

templates/nebula.service.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SyslogIdentifier=nebula
88
StandardOutput=syslog
99
StandardError=syslog
1010
ExecReload=/bin/kill -HUP $MAINPID
11-
ExecStart=/bin/nebula -config /etc/nebula/config.yaml
11+
ExecStart={{ nebula_bin_directory }}/nebula -config /etc/nebula/config.yaml
1212
Restart=always
1313

1414
[Install]

0 commit comments

Comments
 (0)