# ERROR! the role 'swapfile' was not found

**URL:** https://discourse.roots.io/t/error-the-role-swapfile-was-not-found/6774
**Category:** trellis
**Created:** 2016-05-18T23:03:14Z
**Posts:** 12

## Post 1 by @mZoo — 2016-05-18T23:03:14Z

I just grabbed the latest Trellis from the repo. Deployed successfully but now getting the above error!

---

## Post 2 by @mZoo — 2016-05-18T23:04:39Z

The reason was that I had provisioned the server, then updated the version of Trellis, replacing all but the `group_vars`, `hosts` and `.vault_pass`.

Then hadn’t run `ansible-galaxy install -r requirements.yml` to replace what I had moved to a backup location.

---

## Post 3 by @mZoo — 2016-05-18T23:19:32Z

Then I had to grant sudo NOPASSWD to , `admin` use as it seems the the original provisioning disabled that for the root user, which I think can be (unwisely) disabled in the Trellis config.

Followed this answer for quick easy approach (as opposed to using `/etc/sudoers.d` file):

> <https://askubuntu.com/questions/192050/how-to-run-sudo-command-with-no-password/443071#443071>

---

## Post 4 by @robomatic — 2018-01-19T19:37:52Z

I getting the same error with a fresh clone of the repo. It appears the role ‘swapfile’ does not exist. Does this get generated somehow? I’m trying to do a remote setup following the trellis instructions on that subject.

---

## Post 5 by @MWDelaney — 2018-01-19T19:45:20Z

Run the following command in your Trellis directory:

```
ansible-galaxy install -r requirements.yml
```

---

## Post 6 by @robomatic — 2018-01-20T01:18:56Z

Oops i see it in the docs now … [https://roots.io/trellis/docs/remote-server-setup/](https://roots.io/trellis/docs/remote-server-setup/)

Thanks for the help!

---

## Post 7 by @silumesii — 2018-07-09T14:04:54Z

I am experiencing the same error today. When running `ansible-galaxy install -r requirements.yml` I get:

> [WARNING]: - swapfile was NOT installed successfully: - sorry, tersmitten.swapfile was not found on [https://galaxy.ansible.com](https://galaxy.ansible.com).

Has `swapfile` been removed from Ansilble Galaxy?

[https://galaxy.ansible.com/tersmitten/swapfile](https://galaxy.ansible.com/tersmitten/swapfile)

---

## Post 8 by @slapnash — 2018-07-09T15:26:27Z

I’ve encountered exactly the same problem and it does look like the repository has been removed.

Is there any solution to this? Another role which would fulfil the requirements here perhaps?

---

## Post 9 by @silumesii — 2018-07-09T16:10:41Z

Managed to make things work with [Oefenweb.swapfile](https://galaxy.ansible.com/Oefenweb/swapfile) v2.0.7.

Ref:

> **[Oefenweb/ansible-swapfile](https://github.com/Oefenweb/ansible-swapfile)**
>
> ansible-swapfile - Ansible role to manage a swap file in Debian-like systems

  

> <https://github.com/Oefenweb/ansible-swapfile/issues/11>

  

> <https://github.com/roots/trellis/pull/1001>

---

## Post 10 by @flocca — 2018-07-09T17:13:35Z

With **Oefenweb.swapfile** it works, thanks!

In trellis/requirements.yml:

```
- name: swapfile 
  src: oefenweb.swapfile 
  version: v2.0.7
```

In trellis/server.yml:

```
- { role: swapfile, swapfile_size: 1GB, tags: [swapfile] }
```

---

## Post 11 by @kellymears — 2018-07-10T22:10:20Z

@silumesii @flocca You are both amazing as I am very dumb, new to trellis and would have never figured this out! Thank you :pray:t3:

---

## Post 12 by @strarsis — 2020-09-12T00:54:52Z

So the file in Trellis upstream isn’t named `requirements.yml`, but `galaxy.yml`.  
Related: [ERROR! the role 'ntp' was not found](https://discourse.roots.io/t/error-the-role-ntp-was-not-found/6260/7)
