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:
parent
48a53282f3
commit
f7d13643c6
4 changed files with 50 additions and 1 deletions
|
@ -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)
|
# should we do a version check? (recomended)
|
||||||
submodules_versioncheck: false
|
submodules_versioncheck: false
|
||||||
|
|
14
tasks/install.yml
Normal file
14
tasks/install.yml
Normal 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 }}"
|
|
@ -1,3 +1,10 @@
|
||||||
---
|
---
|
||||||
- include_tasks: versioncheck.yml
|
- name: optionally run versionscheck
|
||||||
|
ansible.builtin.include_tasks: versioncheck.yml
|
||||||
when: submodules_versioncheck|bool
|
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
14
tasks/user.yml
Normal 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'
|
Loading…
Reference in a new issue