forked from notthebee/infra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up APT execution, add SSH pipelining, Add an hd-idle role inste…
…ad of hdparm
- Loading branch information
Showing
13 changed files
with
85 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
[defaults] | ||
INVENTORY = hosts | ||
vault_password_file = pass.sh | ||
interpreter_python = python3 | ||
ansible_python_interpreter=/usr/bin/python3 | ||
|
||
[ssh_connection] | ||
pipelining = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
- name: Check if hd-idle is installed | ||
shell: | ||
cmd: which hd-idle | ||
ignore_errors: true | ||
register: hdidle | ||
changed_when: hdidle.rc != 0 | ||
|
||
- name: Install hd-idle | ||
when: hdidle.rc != 0 | ||
block: | ||
|
||
- name: Create the temporary directory | ||
file: | ||
path: /tmp/hd-idle | ||
state: directory | ||
|
||
- name: Install github3 module | ||
pip: | ||
name: github3.py | ||
|
||
- name: Get the latest release version | ||
github_release: | ||
user: adelolmo | ||
repo: hd-idle | ||
action: latest_release | ||
register: release | ||
|
||
- name: print | ||
debug: | ||
var: release | ||
|
||
- name: Grab the latest amd64 deb package | ||
get_url: | ||
url: "https://github.com/adelolmo/hd-idle/releases/download/{{ release['tag'] }}/hd-idle_{{ release['tag'] | regex_replace('^v','') }}_amd64.deb" | ||
dest: /tmp/hd-idle | ||
|
||
- name: Install the deb package | ||
shell: | ||
cmd: cd /tmp/hd-idle && dpkg -y -i hd-idle*.deb | ||
|
||
- name: Install the hd-idle configuration file | ||
template: | ||
src: hd-idle.default.j2 | ||
dest: /etc/default/hd-idle | ||
|
||
- name: Make sure that hd-idle is started and enabled on boot | ||
systemd: | ||
name: hd-idle | ||
state: started | ||
enabled: yes | ||
masked: no | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
START_HD_IDLE=true | ||
HD_IDLE_OPTS="-i {{ spindown_time }} -l /var/log/hd-idle.log" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
--- | ||
- name: Install required system packages | ||
apt: | ||
name: "{{ item }}" | ||
name: "mergerfs" | ||
state: latest | ||
update_cache: yes | ||
with_items: | ||
- 'mergerfs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters