1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/network/tasks/wondershaper.yml

60 lines
1.7 KiB
YAML
Raw Normal View History

2018-10-08 22:24:17 +00:00
- name: Install Wondershaper systemd unit file from template
template:
backup: yes
src: roles/network/templates/wondershaper/wondershaper.service
dest: /etc/systemd/system/wondershaper.service
# mode: '0644'
2017-05-27 18:09:50 +00:00
2018-10-08 22:24:17 +00:00
- name: Install /usr/bin/wondershaper from template
template:
backup: yes
src: roles/network/templates/wondershaper/wondershaper.j2
dest: /usr/bin/wondershaper
# owner: root
# group: root
mode: '0744'
2017-05-27 18:09:50 +00:00
2017-10-27 15:49:55 +00:00
- name: Create conf.d directory
2018-10-08 22:24:17 +00:00
file:
path: /etc/conf.d
# owner: root
# group: root
# mode: '0755'
2018-10-08 22:24:17 +00:00
state: directory
2017-05-27 18:09:50 +00:00
2018-10-08 22:24:17 +00:00
- name: Install /etc/conf.d/wondershaper.conf from template
template:
src: roles/network/templates/wondershaper/wondershaper.conf
dest: /etc/conf.d/wondershaper.conf
# owner: root
# group: root
mode: '0600'
2017-05-27 18:09:50 +00:00
- name: Create fact (symlink) /etc/ansible/facts.d/wondershaper.fact -> /etc/conf.d/wondershaper.conf
2018-10-08 22:24:17 +00:00
file:
src: /etc/conf.d/wondershaper.conf
dest: /etc/ansible/facts.d/wondershaper.fact
# owner: root
# group: root
2018-10-08 22:24:17 +00:00
state: link
2017-05-27 18:09:50 +00:00
- name: "Add 'wondershaper_installed: True' to {{ iiab_state_file }}"
lineinfile:
path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
regexp: '^wondershaper_installed'
line: 'wondershaper_installed: True'
- name: Add 'wondershaper' variable values to {{ iiab_ini_file }}
2018-10-08 22:24:17 +00:00
ini_file:
2018-10-15 10:13:57 +00:00
dest: "{{ iiab_ini_file }}"
2018-10-08 22:24:17 +00:00
section: wondershaper
option: "{{ item.option }}"
value: "{{ item.value | string }}"
2017-05-27 18:09:50 +00:00
with_items:
- option: name
value: wondershaper
- option: description
2017-10-27 15:49:55 +00:00
value: '"Wondershaper is a command line tool to set maximum transfer rates for network adapters."'
2017-05-27 18:09:50 +00:00
- option: enabled
value: "{{ wondershaper_enabled }}"