1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_iperf.git synced 2024-08-16 13:09:49 +02:00

create iperf user/group and install it

This commit is contained in:
L3D 2021-08-18 15:52:25 +02:00
parent 48a53282f3
commit f7d13643c6
Signed by: l3d
GPG key ID: CD08445BFF4313D1
4 changed files with 50 additions and 1 deletions

View file

@ -1,3 +1,17 @@
---
# run systemd service with an iperf3 server (Y/n)
iperf__systemd_enable: true
iperf__packages:
- iperf3
# change state to latest for upgrading iperf
iperf__package_state: 'present'
# some variables for user setup
iperf__user: 'iperf'
iperf__group: 'iperf'
# should we do a version check? (recomended)
submodules_versioncheck: false

14
tasks/install.yml Normal file
View file

@ -0,0 +1,14 @@
---
- name: update repo-cache for debian/ubuntu
become: true
ansible.builtin.apt:
update_cache: true
cache_valid_time: 3600
when:
- ansible_pkg_mgr == "apt"
- name: install iperf
become: true
ansible.builtin.package:
name: "{{ iperf__packages }}"
state: "{{ iperf__package_state }}"

View file

@ -1,3 +1,10 @@
---
- include_tasks: versioncheck.yml
- name: optionally run versionscheck
ansible.builtin.include_tasks: versioncheck.yml
when: submodules_versioncheck|bool
- name: install iperf
ansible.builtin.include_tasks: install.yml
- name: create iperf user
ansible.builtin.include_tasks: user.yml

14
tasks/user.yml Normal file
View file

@ -0,0 +1,14 @@
---
- name: "Create {{ iperf__group }} Group"
become: true
ansible.builtin.group:
name: "{{ iperf__user }}"
system: true
state: "present"
- name: "Create {{ iperf__user }} user"
become: true
ansible.builtin.user:
name: "{{ iperf__user }}"
comment: "Iperf user"
shell: '/sbin/nologin'