Skip to content
This repository has been archived by the owner on Jun 25, 2023. It is now read-only.

Commit

Permalink
Add unattended_dl_limit variable to limit bandwidth (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
BarbzYHOOL authored and jnv committed May 21, 2018
1 parent 92b7081 commit fccc588
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ On some hosts you may find that the unattended-upgrade's cronfile `/etc/cron.dai
* Default: `1800` (30 minutes)
* `unattended_dpkg_options`: Array of dpkg command-line options used during unattended-upgrades runs, e.g. `["--force-confdef"]`, `["--force-confold"]`
* Default: `[]`
* `unattended_dl_limit`: Limit the download speed in kb/sec using apt bandwidth limit feature.
* Default: disabled

## Origins Patterns

Expand Down
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,7 @@ unattended_dpkg_options: []
# unattended_dpkg_options:
# - "--force-confdef"
# - "--force-confold"


# Use apt bandwidth limit feature, this example limits the download speed to 70kb/sec
#unattended_dl_limit: 70
4 changes: 3 additions & 1 deletion templates/unattended-upgrades.j2
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Dpkg::Options {
};
{% endif %}

{% if unattended_dl_limit is defined %}
// Use apt bandwidth limit feature, this example limits the download
// speed to 70kb/sec
//Acquire::http::Dl-Limit "70";
Acquire::http::Dl-Limit "{{ unattended_dl_limit }}";
{% endif %}

3 comments on commit fccc588

@BarbzYHOOL
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just commenting here, but do you use others' roles jnv?? because this role is the only one I find really useful, every other role I rewrite it myself.

@jnv
Copy link
Owner

@jnv jnv commented on fccc588 Jun 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BarbzYHOOL Honestly, I don't do ops as much as I used to, so I don't even use this role. 😄
Anyway I am glad this role is useful for you, I really appreciate your comment!

@BarbzYHOOL
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, and thank you for that role!

Please sign in to comment.