forked from geerlingguy/drupal-vm
-
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.
Merge pull request geerlingguy#2162 from oxyc/vagrant-fix-nfs
Issue geerlingguy#2154: Add vagrant-nfs-fix role to fix NFS timeout issues on macOS
- Loading branch information
Showing
8 changed files
with
82 additions
and
0 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
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,29 @@ | ||
# Drupal VM Vagrant NFS Fix Role | ||
|
||
This role exists to fix [issue #2154](https://github.com/geerlingguy/drupal-vm/issues/2154). | ||
|
||
## Requirements | ||
|
||
This role is meant to be run in Drupal VM. | ||
|
||
## Role Variables | ||
|
||
Available variables are listed below: | ||
|
||
```yaml | ||
vagrant_nfs_fix_keepalive_file: "/vagrant/.vagrant-nfs-fix-keepalive.tmp" | ||
``` | ||
Path to the keepalive file that we'll be `touch`ed every 30 seconds to keep NFS from timing out. | ||
|
||
## Dependencies | ||
|
||
None. | ||
|
||
## License | ||
|
||
MIT / BSD | ||
|
||
## Author Information | ||
|
||
This role was created in 2021 by [Oskar Schöldström](http://oxy.fi) and [Jeff Geerling](https://www.jeffgeerling.com/) (author of [Ansible for DevOps](https://www.ansiblefordevops.com/)). |
2 changes: 2 additions & 0 deletions
2
provisioning/roles/drupalvm.vagrant-nfs-fix/defaults/main.yml
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 @@ | ||
--- | ||
vagrant_nfs_fix_keepalive_file: "/vagrant/.vagrant-nfs-fix-keepalive.tmp" |
22 changes: 22 additions & 0 deletions
22
provisioning/roles/drupalvm.vagrant-nfs-fix/tasks/main.yml
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,22 @@ | ||
--- | ||
- name: Copy Vagrant NFS fix script into place. | ||
template: | ||
src: vagrant-nfs-fix.j2 | ||
dest: /usr/sbin/vagrant-nfs-fix | ||
owner: root | ||
group: root | ||
mode: 0755 | ||
|
||
- name: Copy Vagrant NFS fix systemd unit file into place. | ||
template: | ||
src: vagrant-nfs-fix.unit.j2 | ||
dest: /etc/systemd/system/vagrant-nfs-fix.service | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
|
||
- name: Configure the NFS fix service. | ||
service: | ||
name: vagrant-nfs-fix | ||
state: started | ||
enabled: true |
8 changes: 8 additions & 0 deletions
8
provisioning/roles/drupalvm.vagrant-nfs-fix/templates/vagrant-nfs-fix.j2
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,8 @@ | ||
#!/bin/sh | ||
|
||
while true; do | ||
touch {{ vagrant_nfs_fix_keepalive_file }} | ||
sleep 1 | ||
rm {{ vagrant_nfs_fix_keepalive_file }} | ||
sleep 30 | ||
done |
12 changes: 12 additions & 0 deletions
12
provisioning/roles/drupalvm.vagrant-nfs-fix/templates/vagrant-nfs-fix.unit.j2
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,12 @@ | ||
[Unit] | ||
Description=Workaround for vagrant NFS inactivity bug | ||
StartLimitIntervalSec=0 | ||
|
||
[Service] | ||
Type=simple | ||
Restart=always | ||
RestartSec=1 | ||
ExecStart=/usr/sbin/vagrant-nfs-fix | ||
|
||
[Install] | ||
WantedBy=multi-user.target |