Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ openwisp2_wireguard_ssl_state: "California"
openwisp2_wireguard_ssl_locality: "San Francisco"
openwisp2_wireguard_ssl_organization: "IT dep."
openwisp2_wireguard_ssl_common_name: "{{ inventory_hostname }}"

openwisp_group: "openwisp"
openwisp_user: "openwisp"
1 change: 0 additions & 1 deletion files/sudoers.d/openwisp

This file was deleted.

8 changes: 8 additions & 0 deletions molecule/local/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ platforms:
cgroupns_mode: host
privileged: true
pre_build_image: true
- name: "openwisp2-debian13"
image: "geerlingguy/docker-debian13-ansible:latest"
command: ${MOLECULE_DOCKER_COMMAND:-""}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
cgroupns_mode: host
privileged: true
pre_build_image: true
# TODO: Add platforms for RHEL 7 and 8
provisioner:
name: ansible
Expand Down
2 changes: 1 addition & 1 deletion tasks/complete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- name: Run update_wireguard.sh check_config as openwisp user
become: true
become_user: openwisp
become_user: "{{ openwisp_user }}"
command: "{{ openwisp2_wireguard_path }}/update_wireguard.sh check_config"
# Skip this task during molecule tests: the OpenWISP Controller is not available
# inside the test container, so update_wireguard.sh would fail when attempting
Expand Down
8 changes: 4 additions & 4 deletions tasks/user_management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
name: "{{ openwisp_user }}"
shell: /sbin/nologin
state: present
group: openwisp
group: "{{ openwisp_user }}"

- name: Add sudo permissions for Wireguard and Network Manager commands
ansible.builtin.copy:
src: "sudoers.d/{{ openwisp_group }}"
dest: /etc/sudoers.d/openwisp
ansible.builtin.template:
src: "sudoers.d/openwisp_user"
dest: /etc/sudoers.d/{{ openwisp_group }}
mode: 0440
1 change: 1 addition & 0 deletions templates/sudoers.d/openwisp_user
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
%{{ openwisp_group }} ALL = NOPASSWD: /usr/bin/wg-quick, /usr/bin/wg, /usr/bin/nmcli, /usr/bin/ip, /usr/sbin/bridge
3 changes: 1 addition & 2 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
virtualenv_path: "{{ openwisp2_wireguard_path }}/env"
openwisp_group: "openwisp"
openwisp_user: "openwisp"

Loading