# SSH Error: Permission denied (publickey,password) - DigitalOcean

**URL:** https://discourse.roots.io/t/ssh-error-permission-denied-publickey-password-digitalocean/3591
**Category:** bedrock
**Tags:** deploys
**Created:** 2015-04-23T17:42:47Z
**Posts:** 36

## Post 1 by @daniel — 2015-04-23T17:42:47Z

Hi there, the team has been trying to wrap our heads around this new workflow with deployment using bedrock-ansible and we are hitting a few snags, but we have been able to resolve most of the issues up until now.

We have Bedrock completely setup locally and we are now ready to deploy to our DigitalOcean droplet. But when we attempt to run the following: ./deploy.sh staging [example.com](http://example.com) we receive the following error:

```
PLAY [Deploy WP site] *********************************************************

GATHERING FACTS ***************************************************************
fatal: [example.example.co] => SSH Error: Permission denied (publickey,password).
while connecting to 45.55. ***.*** :22
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.

TASK: [deploy | Initialize] ***************************************************
FATAL: no hosts matched or all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
       to retry, use: --limit @/Users/myname/deploy.retry

example.example.co : ok=0 changed=0 unreachable=1 failed=0
```

I get the same error when trying the manual ansible-playbook command.

Here’s the group\_vars/staging file:

```
mysql_root_password: stagingpw

wordpress_sites:
  example.com:
site_hosts:
  - example.example.co
local_path: '../example.com' # path targeting local Bedrock project directory (relative to Ansible root)
repo: git@bitbucket.org:myuser/bedrock.git
multisite:
  enabled: false
  subdomains: false
ssl:
 enabled: false
system_cron: true
env:
  wp_home: http://example.example.co
  wp_siteurl: http://example.example.co/wp
  wp_env: staging
  db_name: example_staging
  db_user: example_dbuser
  db_password: example_dbpassword
  auth_key: "generateme"
  auth_salt: "generateme"
  logged_in_key: "generateme"
  logged_in_salt: "generateme"
  nonce_key: "generateme"
  nonce_salt: "generateme"
  secure_auth_key: "generateme"
  secure_auth_salt: "generateme"
```

And my hosts/staging file:

```
[web]
example.example.co

[staging:children]
web
```

Currently DigitalOcean is setup as Ubuntu LEMP on 14.04. I can ssh into [root@example.co](mailto:root@example.co) with no problem.

The local dev seems to be loading the Sage theme and environment just fine. Just have no idea how this whole deployment process is supposed to go.

Any help would be greatly appreciated.

---

## Post 2 by @fullyint — 2015-04-23T18:02:23Z

The [`deploy.yml` playbook](https://github.com/roots/bedrock-ansible/blob/7d5502dfe6cfa1f331f9cb8fdb5a6162c219bb2d/deploy.yml#L4) will try to ssh connect as whatever user you’ve set for [`web_user` in `group_vars/all`](https://github.com/roots/bedrock-ansible/blob/7d5502dfe6cfa1f331f9cb8fdb5a6162c219bb2d/group_vars/all#L15).

And, that user will need to be listed as an [`authorized` user in a `github_ssh_keys`](https://github.com/roots/bedrock-ansible/wiki/SSH-Keys#web) list that you could add to one of your `group_vars` files (here’s an [example](https://github.com/roots/roots-example-project.com/blob/91af1b7fb681bb4d6b6bc1d87dd5061f64178db9/ansible/group_vars/production#L3-9)).

My first guess is that you haven’t yet defined `github_ssh_keys`. If that’s it, after you define them, you’ll need to re-run `server.yml` before trying to deploy again. You can make `server.yml` run only the `github_ssh_keys` role by specifying `--tags`:

`ansible-playbook -i hosts/staging server.yml --tags "github-ssh-keys"`

---

## Post 3 by @daniel — 2015-04-23T18:09:53Z

Thanks very much for the quick response!

I’ve added the following to my group\_vars/staging file:

```
github_ssh_keys:
- username: firstlastname

authorized:
- "{{ web_user }}"
```

But I am still getting that same message. I’m using BitBucket does that matter?

---

## Post 4 by @fullyint — 2015-04-23T18:17:10Z

That’s not quite formed in a way that will work. Try this:

```
github_ssh_keys:
  - username: firstlastname
    authorized:
      - "{{ web_user }}"
```

and `firstlastname` will need to be your actual github user name so `server.yml` can go fetch your public key from [https://github.com/firstlastname.keys](https://github.com/firstlastname.keys) like [this](https://github.com/roots/bedrock-ansible/blob/373fe77e90e5208fc96a9def301bb9e17b66f2ac/roles/github-ssh-keys/tasks/main.yml#L3)

You’ll also need to re-run the `server.yml` playbook as I added (edited) into my comment above.

Bitbucket can work and we’ll see if you’re set up correctly for it once the `deploy.yml` playbook manages to connect to your staging server first.

---

## Post 5 by @daniel — 2015-04-23T18:36:53Z

After updating the hosts/staging file and then running: ansible-playbook -i hosts/staging server.yml --tags “github-ssh-keys”, I got this:

```
PLAY [WordPress Server: Install LEMP Stack with PHP 5.6 and MariaDB MySQL] ****

GATHERING FACTS ***************************************************************
ok: [example.example.co]

TASK: [github-ssh-keys | Get GitHub SSH keys] *********************************
ok: [example.example.co -> 127.0.0.1] => (item={'username': 'example', 'authorized': [u'web']})

TASK: [github-ssh-keys | Add SSH keys] ****************************************
ok: [example.example.co] => (item=({'username': 'example'}, u'web'))

PLAY RECAP ********************************************************************
example.example.co : ok=3 changed=0 unreachable=0 failed=0
```

When trying to deploy again (./deploy.sh staging [example.com](http://example.com)) I still get the same error.

---

## Post 6 by @fullyint — 2015-04-23T18:55:03Z

> `(item={'username': 'example', 'authorized': [u'web']})`.

You don’t have `username: example` in your `github_ssh_keys` do you? Maybe you just edited the actual username for privacy.

The username must be your actual github username so that `server.yml` can fetch your public ssh key from github ([https://github.com/myusername.keys](https://github.com/myusername.keys)) and load it on the server for the `web_user` (e.g., `web`) so that when Ansible on your local machine tries to connect as `web_user` your personal local private key will grant you access as `web_user`.

To ramble more, this setup assumes that the public key available at your username on github will correspond to the private key on your machine. If not, you’ll need to manually add a public key for `web_user` (on remote server). I suppose you could change `web_user` to whatever user you connected as for `server.yml`, but I recommend trying to get the other approach working instead.

If you’ve done all the stuff above, a helpful diagnostic would be to know whether or not manually ssh-ing into the server as `web_user` allows you to connect, e.g.,  
`ssh web@example.example.co`

---

## Post 7 by @daniel — 2015-04-23T19:13:17Z

Sorry if that was confusing but here’s the actual info:

```
github_ssh_keys:
 - username: newbird
authorized:
  - "{{ web_user }}"
```

I just tried to manually ssh into DO using ssh [web@example.example.co](mailto:web@example.example.co) and it’s asking me for a password. I don’t have a root password setup on this server, just an ssh key. Should I add a root password?

---

## Post 8 by @fullyint — 2015-04-23T19:31:25Z

You’ll need to be using passwordless ssh keys so that your `web_user` can connect non-interactively (Ansible doesn’t accommodate a password prompt.) But, maybe you have passwordless ssh set up and the remote is asking for a password as a fallback because no key is found (?? I’m no ssh expert).

I still suspect your `github_ssh_keys` formatting could be the problem, failing to load up your public key for `web_user`. Notice the indentation. Each line is indented two spaces more than the line above. I haven’t tested whether it fails using your format, but the exact format may be required for the yaml parsing to work.

```
github_ssh_keys:
  - username: newbird
    authorized:
      - "{{ web_user }}"
```

If that formatting doesn’t resolve it, another helpful diagnostic would be to ssh into the server and check whether your public key appears for `web_user`, e.g., in the file at `/home/web/.ssh/authorized_keys`  
If the key is not there, the problem is still in the `github_ssh_keys` role of `server.yml`.

---

## Post 10 by @daniel — 2015-04-23T19:48:54Z

All of the keys seem to be showing in that file. I even just deleted everything in this file and re-ran the: ansible-playbook -i hosts/staging server.yml --tags “github-ssh-keys” command which re-populated this file. Still no luck. Looks like the formatting wasn’t effecting it.

Does this “web\_user” user need to be added to DigitalOcean?

---

## Post 11 by @fullyint — 2015-04-23T19:58:22Z

Strange.  
You shouldn’t need to add `web_user` to DigitalOcean. The [`users` role](https://github.com/roots/bedrock-ansible/blob/373fe77e90e5208fc96a9def301bb9e17b66f2ac/roles/users/tasks/main.yml) will set up the `web_user`.

How are you ssh-ing currently (when ssh works)? Like this?  
`ssh root@example.example.co`

Do you have to type a password when you ssh in? I’m guessing not, but if you do have to type password, then you still need to set up passwordless ssh keys.

You might try wiping and rebuilding the droplet, just to be certain everything is fresh, and to give `web_user` another shot at successful setup.

---

## Post 12 by @daniel — 2015-04-23T20:03:32Z

When I log in with [root@example.example.co](mailto:root@example.example.co) it lets me right in without asking for a password. I will try to spin up a new droplet and start from scratch. Thanks so much for all of your help!

---

## Post 14 by @daniel — 2015-04-23T21:06:22Z

I started over completely and ended up with the same error.  
Here’s what I did:

**Local Machine**

mkdir newdir  
cd newdir  
git clone [https://github.com/roots/bedrock-ansible.git](https://github.com/roots/bedrock-ansible.git)  
ansible-galaxy install -r requirements.yml -p vendor/roles  
cd …/  
mkdir bedrock  
cd bedrock  
git clone [https://github.com/roots/bedrock.git](https://github.com/roots/bedrock.git) .  
cd …/bedrock-ansible  
vi group\_vars/development

```
mysql_root_password: devpw

web_user: vagrant

wordpress_sites:
  bedrock.com:
      site_hosts:
      - bedrock.dev
local_path: '../bedrock' # path targeting local Bedrock project directory (relative to Ansible root)
repo: git@bitbucket.org:newbird/bedrock.git
site_install: true
site_title: Example Site
admin_user: admin
admin_password: admin
admin_email: admin@example.dev
multisite:
  enabled: false
  subdomains: false
ssl:
 enabled: false
system_cron: true
env:
  wp_home: http://bedrock.dev
  wp_siteurl: http://bedrock.dev/wp
  wp_env: development
  db_name: example_dev2
  db_user: example_dbuser2
  db_password: example_dbpassword2

php_error_reporting: 'E_ALL'
php_display_errors: 'On'
php_display_startup_errors: 'On'
php_track_errors: 'On'
php_mysqlnd_collect_memory_statistics: 'On'
php_opcache_enable: 0

xdebug_install: false
```

vagrant up

(everything seemed to be running fine up until the last task which threw this error:

```
TASK: [php | Start php5-fpm service] ******************************************
failed: [default] => {"failed": true}

FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
```

vi group\_vars/all

```
hhvm: true
```

cd …/  
vi Vagrantfile

```
config.vm.synced_folder local_site_path(site), nfs_path(name), type: 'nfs'
config.bindfs.bind_folder nfs_path(name), remote_site_path(name), u: 'vagrant', g: 'www-data', :'create-as-user' => true, :perms => "u=rwx:g=rwx:o=rx", :'create-with-perms' => "u=rwx:g=rwx:o=rx", :'chown-ignore' => true, :'chgrp-ignore' => true, :'chmod-ignore' => true
```

vangrant reload

* * *

**DigitalOcean**

Created a Droplet with Ubuntu 14.04 x64  
Selected my SSH Key  
Create Droplet

* * *

**Local Machine**

vi group\_vars/staging

```
mysql_root_password: stagingpw

github_ssh_keys:
  - username: newbird
    authorized:
      - "{{ web_user }}"

wordpress_sites:
  bedrock.com:
    site_hosts:
  - 45.55.241.241
local_path: '../bedrock' # path targeting local Bedrock project directory (relative to Ansible root)
repo: git@bitbucket.org:newbird/bedrock.git
multisite:
  enabled: false
  subdomains: false
ssl:
 enabled: false
system_cron: true
env:
  wp_home: http://45.55.241.241
  wp_siteurl: http://45.55.241.241/wp
  wp_env: staging
  db_name: example_staging
  db_user: example_dbuser
  db_password: example_dbpassword
  auth_key: "generateme"
  auth_salt: "generateme"
  logged_in_key: "generateme"
  logged_in_salt: "generateme"
  nonce_key: "generateme"
  nonce_salt: "generateme"
  secure_auth_key: "generateme"
  secure_auth_salt: "generateme"
```

vi hosts/staging

```
[web]
45.55.241.241

[staging:children]
web
```

ansible-playbook -i hosts/staging server.yml

./deploy.sh staging [bedrock.com](http://bedrock.com)

and I still get this:

```
PLAY [Deploy WP site] *********************************************************

GATHERING FACTS ***************************************************************
fatal: [45.55.241.241] => SSH Error: Permission denied (publickey,password).
while connecting to 45.55.241.241:22
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.

TASK: [deploy | Initialize] ***************************************************
FATAL: no hosts matched or all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
       to retry, use: --limit @/Users/daniel/deploy.retry

45.55.241.241 : ok=0 changed=0 unreachable=1 failed=0
```

Phew, so, I’m kind of at a lose right now. See anything out of the ordinary?

---

## Post 15 by @fullyint — 2015-04-23T21:27:29Z

At first glance I don’t see what’s causing the problem.

- Does manual ssh as `web@45.55.241.241` still fail? If so, could `/var/log/auth.log` (on remote) shed light? Afraid I’m taking stabs in the dark.
- Are you on Windows?

I haven’t tracked the hhvm stuff. I don’t know why the “Start php5-fpm service” task would fail for you unless `hhvm: true`. I haven’t needed that on my setup (OS X). Sad to say I’m running out of ideas. Might have to call in the smart guys.

---

## Post 16 by @daniel — 2015-04-23T21:52:02Z

[web@45.55.241.241](mailto:web@45.55.241.241) asks me for a password, even though the server is set to use SSH keys. So, I’m not quite sure what the password might be.

Maybe you’re right, maybe it’s time to give Roots a call. Either way, thanks so much for your dilligent attempts to help me today. I hope the rest of your week goes well!

---

## Post 17 by @kalenjohnson — 2015-04-23T21:57:58Z

Do you have the correct SSH key set up on Github?

---

## Post 18 by @daniel — 2015-04-23T21:59:22Z

Hello Kalen!

I deleted all existing keys on Github and added a new one that was copied using:  
pbcopy \< ~/.ssh/id\_rsa.pub

---

## Post 19 by @kalenjohnson — 2015-04-23T22:14:06Z

Ok good. That’s the key that will be used on the provisioned server which allows the `web` user to SSH and do the work.

---

## Post 20 by @swalkinshaw — 2015-04-23T22:18:10Z

Does `ssh -T git@github.com` work without errors?

If your SSH key works you should see:

> Hi username! You’ve successfully authenticated, but GitHub does not provide shell access.

If it doesn’t work to connect to GitHub, it won’t work on your DO server either.

Also make sure ssh-agent is running: `eval "$(ssh-agent -s)"`

[Connecting to GitHub with SSH - GitHub Docs](https://help.github.com/articles/generating-ssh-keys/) has more info.

---

## Post 21 by @swalkinshaw — 2015-04-23T22:22:13Z

I should note further that Ansible/deploys aren’t doing anything special in this regard. There may be a problem with your keys on GitHub so you can always try to manually copy your local key to the server for the `web` user and see if that works. Getting the key added is only a one time process.

Digital Ocean has some good articles on it:

> **[How To Configure SSH Key-Based Authentication on a Linux Server | DigitalOcean](https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server)**
>
> SSH, or secure shell, is the most common way of administering remote Linux servers. Although the daemon allows password-based authentication, exposing a password-protected account to the network can open up your server to brute-force attacks. In this

> **[How To Set Up SSH Keys | DigitalOcean](https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2)**
>
> SSH keys provide a more secure way of logging into a virtual private server with SSH than using a password alone. With SSH keys, users can log into a server without a password. This tutorial explains how to generate, use, and upload an SSH Key Pair.

---

## Post 22 by @daniel — 2015-04-23T23:55:47Z

Hey Scott,

Thanks for the input. I ran: ssh -T [git@github.com](mailto:git@github.com) and received:

> Hi Newbird! You’ve successfully authenticated, but GitHub does not provide shell access.

then eval “$(ssh-agent -s)” and received:

> Agent pid 62256

So I think I’m good on that front.

---

## Post 23 by @fullyint — 2015-04-24T00:08:42Z

Mind running the deploy command one more time with `-vvvv` and pasting the full output?  
`ansible-playbook -i hosts/staging deploy.yml --extra-vars "site=bedrock.com" -vvvv`

---

## Post 24 by @daniel — 2015-04-24T00:22:56Z

> [@swalkinshaw](#):
>
> [How To Configure SSH Key-Based Authentication on a Linux Server | DigitalOcean](https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server)

I followed the walkthrough on this site to manually add my ssh key using:

> ssh-copy-id [web@45.55.241.241](mailto:web@45.55.241.241)

(I had to first reset my password for the web user on the server as I had no idea what this was set to)

That got me passed the SSH Key issue but now I have a new issue :confused:

> failed: [45.55.241.241] =\> (item={‘path’: ‘web/app/uploads’, ‘src’: ‘uploads’}) =\> {“failed”: true, “item”: {“path”: “web/app/uploads”, “src”: “uploads”}, “path”: “/srv/www/bedrock.com/releases/20150423201953/web/app/uploads”, “state”: “absent”}  
> msg: Error while linking: [Errno 2] No such file or directory

> FATAL: all hosts have already failed – aborting

---

## Post 25 by @daniel — 2015-04-24T00:27:08Z

@fullyint - Here’s the full output:

> ansible-playbook -i hosts/staging deploy.yml --extra-vars “[site=bedrock.com](http://site=bedrock.com)” -vvvv

> PLAY [Deploy WP site] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

> GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \<45.55.241.241\> ESTABLISH CONNECTION FOR USER: web  
> \<45.55.241.241\> REMOTE\_MODULE setup  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1429835239.46-169090882513492 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1429835239.46-169090882513492 && echo $HOME/.ansible/tmp/ansible-tmp-1429835239.46-169090882513492’  
> \<45.55.241.241\> PUT /var/folders/xy/1kc57lfs7rn18nrjdpypxmxh0000gn/T/tmpyp4J\_m TO /home/web/.ansible/tmp/ansible-tmp-1429835239.46-169090882513492/setup  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /usr/bin/python /home/web/.ansible/tmp/ansible-tmp-1429835239.46-169090882513492/setup; rm -rf /home/web/.ansible/tmp/ansible-tmp-1429835239.46-169090882513492/ \>/dev/null 2\>&1’  
> ok: [45.55.241.241]

> TASK: [deploy | Initialize] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \<45.55.241.241\> ESTABLISH CONNECTION FOR USER: web  
> \<45.55.241.241\> REMOTE\_MODULE deploy\_helper path=“/srv/www/bedrock.com” state=present  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1429835244.12-66544580754692 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1429835244.12-66544580754692 && echo $HOME/.ansible/tmp/ansible-tmp-1429835244.12-66544580754692’  
> \<45.55.241.241\> PUT /var/folders/xy/1kc57lfs7rn18nrjdpypxmxh0000gn/T/tmpOn7LyJ TO /home/web/.ansible/tmp/ansible-tmp-1429835244.12-66544580754692/deploy\_helper  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /usr/bin/python /home/web/.ansible/tmp/ansible-tmp-1429835244.12-66544580754692/deploy\_helper; rm -rf /home/web/.ansible/tmp/ansible-tmp-1429835244.12-66544580754692/ \>/dev/null 2\>&1’  
> ok: [45.55.241.241] =\> {“ansible\_facts”: {“deploy\_helper”: {“current\_path”: “/srv/www/bedrock.com/current”, “new\_release”: “20150423202404”, “new\_release\_path”: “/srv/www/bedrock.com/releases/20150423202404”, “previous\_release”: null, “previous\_release\_path”: null, “project\_path”: “/srv/www/bedrock.com”, “releases\_path”: “/srv/www/bedrock.com/releases”, “shared\_path”: “/srv/www/bedrock.com/shared”, “unfinished\_filename”: “DEPLOY\_UNFINISHED”}}, “changed”: false, “state”: “present”}

> TASK: [deploy | Clone project files] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \<45.55.241.241\> ESTABLISH CONNECTION FOR USER: web  
> \<45.55.241.241\> REMOTE\_MODULE git repo= dest=“/srv/www/bedrock.com/shared/source” version=“master” accept\_hostkey=yes  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1429835245.16-120691099126435 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1429835245.16-120691099126435 && echo $HOME/.ansible/tmp/ansible-tmp-1429835245.16-120691099126435’  
> \<45.55.241.241\> PUT /var/folders/xy/1kc57lfs7rn18nrjdpypxmxh0000gn/T/tmpMTIAwe TO /home/web/.ansible/tmp/ansible-tmp-1429835245.16-120691099126435/git  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /usr/bin/python /home/web/.ansible/tmp/ansible-tmp-1429835245.16-120691099126435/git; rm -rf /home/web/.ansible/tmp/ansible-tmp-1429835245.16-120691099126435/ \>/dev/null 2\>&1’  
> ok: [45.55.241.241] =\> {“after”: “248546384754f1ae13f72f1a1ec243eaf81d0a87”, “before”: “248546384754f1ae13f72f1a1ec243eaf81d0a87”, “changed”: false}

> TASK: [deploy | write unfinished file] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \<45.55.241.241\> ESTABLISH CONNECTION FOR USER: web  
> \<45.55.241.241\> REMOTE\_MODULE file path=“/srv/www/bedrock.com/shared/source/DEPLOY\_UNFINISHED” state=touch  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1429835251.95-128102627804567 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1429835251.95-128102627804567 && echo $HOME/.ansible/tmp/ansible-tmp-1429835251.95-128102627804567’  
> \<45.55.241.241\> PUT /var/folders/xy/1kc57lfs7rn18nrjdpypxmxh0000gn/T/tmpx9VJ3h TO /home/web/.ansible/tmp/ansible-tmp-1429835251.95-128102627804567/file  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /usr/bin/python /home/web/.ansible/tmp/ansible-tmp-1429835251.95-128102627804567/file; rm -rf /home/web/.ansible/tmp/ansible-tmp-1429835251.95-128102627804567/ \>/dev/null 2\>&1’  
> changed: [45.55.241.241] =\> {“changed”: true, “dest”: “/srv/www/bedrock.com/shared/source/DEPLOY\_UNFINISHED”, “gid”: 33, “group”: “www-data”, “mode”: “0644”, “owner”: “web”, “size”: 0, “state”: “file”, “uid”: 1000}

> TASK: [deploy | Copy files to new build dir] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \<45.55.241.241\> ESTABLISH CONNECTION FOR USER: web  
> \<45.55.241.241\> REMOTE\_MODULE command cp -pr /srv/www/bedrock.com/shared/source /srv/www/bedrock.com/releases/20150423202404  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1429835253.01-187975690550935 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1429835253.01-187975690550935 && echo $HOME/.ansible/tmp/ansible-tmp-1429835253.01-187975690550935’  
> \<45.55.241.241\> PUT /var/folders/xy/1kc57lfs7rn18nrjdpypxmxh0000gn/T/tmpkBRrW2 TO /home/web/.ansible/tmp/ansible-tmp-1429835253.01-187975690550935/command  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /usr/bin/python /home/web/.ansible/tmp/ansible-tmp-1429835253.01-187975690550935/command; rm -rf /home/web/.ansible/tmp/ansible-tmp-1429835253.01-187975690550935/ \>/dev/null 2\>&1’  
> changed: [45.55.241.241] =\> {“changed”: true, “cmd”: [“cp”, “-pr”, “/srv/www/bedrock.com/shared/source”, “/srv/www/bedrock.com/releases/20150423202404”], “delta”: “0:00:00.020942”, “end”: “2015-04-23 20:24:13.824129”, “rc”: 0, “start”: “2015-04-23 20:24:13.803187”, “stderr”: “”, “stdout”: “”, “warnings”: }

> TASK: [deploy | Move project subtree into root folder] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> skipping: [45.55.241.241]

> TASK: [deploy | Remove unwanted files/folders from new release] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \<45.55.241.241\> ESTABLISH CONNECTION FOR USER: web  
> \<45.55.241.241\> REMOTE\_MODULE file path=“/srv/www/bedrock.com/releases/20150423202404/.git” state=absent  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1429835254.09-133873997428035 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1429835254.09-133873997428035 && echo $HOME/.ansible/tmp/ansible-tmp-1429835254.09-133873997428035’  
> \<45.55.241.241\> PUT /var/folders/xy/1kc57lfs7rn18nrjdpypxmxh0000gn/T/tmpaLXVw0 TO /home/web/.ansible/tmp/ansible-tmp-1429835254.09-133873997428035/file  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /usr/bin/python /home/web/.ansible/tmp/ansible-tmp-1429835254.09-133873997428035/file; rm -rf /home/web/.ansible/tmp/ansible-tmp-1429835254.09-133873997428035/ \>/dev/null 2\>&1’  
> changed: [45.55.241.241] =\> (item=.git) =\> {“changed”: true, “item”: “.git”, “path”: “/srv/www/bedrock.com/releases/20150423202404/.git”, “state”: “absent”}

> TASK: [deploy | Run pre\_build\_commands\_local on Ansible host] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> skipping: [45.55.241.241]

> TASK: [deploy | Copy project local files] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> skipping: [45.55.241.241]

> TASK: [deploy | Copy project templates] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \<45.55.241.241\> ESTABLISH CONNECTION FOR USER: web  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1429835255.09-529137414642 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1429835255.09-529137414642 && echo $HOME/.ansible/tmp/ansible-tmp-1429835255.09-529137414642’  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘rc=flag; [-r /srv/www/bedrock.com/releases/20150423202404/.env] || rc=2; [-f /srv/www/bedrock.com/releases/20150423202404/.env] || rc=1; [-d /srv/www/bedrock.com/releases/20150423202404/.env] && rc=3; python -V 2\>/dev/null || rc=4; [x"$rc" != “xflag”] && echo "${rc} “/srv/www/bedrock.com/releases/20150423202404/.env && exit 0; (python -c '”’“'import hashlib; BLOCKSIZE = 65536; hasher = hashlib.sha1(); afile = open(”‘"’“‘/srv/www/bedrock.com/releases/20150423202404/.env’”‘"’“, “rb”) buf = afile.read(BLOCKSIZE) while len(buf) \> 0: hasher.update(buf) buf = afile.read(BLOCKSIZE) afile.close() print(hasher.hexdigest())'”‘"’ 2\>/dev/null) || (python -c ‘"’“'import sha; BLOCKSIZE = 65536; hasher = sha.sha(); afile = open(”‘"’“‘/srv/www/bedrock.com/releases/20150423202404/.env’”‘"’“, “rb”) buf = afile.read(BLOCKSIZE) while len(buf) \> 0: hasher.update(buf) buf = afile.read(BLOCKSIZE) afile.close() print(hasher.hexdigest())'”‘"’ 2\>/dev/null) || (echo ‘"’“'0 '”‘"’/srv/www/bedrock.com/releases/20150423202404/.env)’  
> \<45.55.241.241\> PUT /var/folders/xy/1kc57lfs7rn18nrjdpypxmxh0000gn/T/tmpUMJrOe TO /home/web/.ansible/tmp/ansible-tmp-1429835255.09-529137414642/source  
> \<45.55.241.241\> PUT /var/folders/xy/1kc57lfs7rn18nrjdpypxmxh0000gn/T/tmpbLrlUm TO /home/web/.ansible/tmp/ansible-tmp-1429835255.09-529137414642/copy  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /usr/bin/python /home/web/.ansible/tmp/ansible-tmp-1429835255.09-529137414642/copy; rm -rf /home/web/.ansible/tmp/ansible-tmp-1429835255.09-529137414642/ \>/dev/null 2\>&1’  
> changed: [45.55.241.241] =\> (item={‘dest’: ‘.env’, ‘src’: ‘roles/deploy/templates/env.j2’, ‘name’: ‘.env config’}) =\> {“changed”: true, “checksum”: “4ec357d01f1c372b44fb51d9071708ff628c2cf9”, “dest”: “/srv/www/bedrock.com/releases/20150423202404/.env”, “gid”: 33, “group”: “www-data”, “item”: {“dest”: “.env”, “name”: “.env config”, “src”: “roles/deploy/templates/env.j2”}, “md5sum”: “1f3c5af870c3fdb143511dbe15cd4e45”, “mode”: “0644”, “owner”: “web”, “size”: 347, “src”: “/home/web/.ansible/tmp/ansible-tmp-1429835255.09-529137414642/source”, “state”: “file”, “uid”: 1000}

> TASK: [deploy | Run pre\_build\_commands in the new\_release\_path] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> skipping: [45.55.241.241]

> TASK: [deploy | Check if project folders exist] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \<45.55.241.241\> ESTABLISH CONNECTION FOR USER: web  
> \<45.55.241.241\> REMOTE\_MODULE stat path=“/srv/www/bedrock.com/current/vendor”  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1429835256.76-125569270747672 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1429835256.76-125569270747672 && echo $HOME/.ansible/tmp/ansible-tmp-1429835256.76-125569270747672’  
> \<45.55.241.241\> PUT /var/folders/xy/1kc57lfs7rn18nrjdpypxmxh0000gn/T/tmpOOiDvK TO /home/web/.ansible/tmp/ansible-tmp-1429835256.76-125569270747672/stat  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /usr/bin/python /home/web/.ansible/tmp/ansible-tmp-1429835256.76-125569270747672/stat; rm -rf /home/web/.ansible/tmp/ansible-tmp-1429835256.76-125569270747672/ \>/dev/null 2\>&1’  
> ok: [45.55.241.241] =\> (item=vendor) =\> {“changed”: false, “item”: “vendor”, “stat”: {“exists”: false}}

> TASK: [deploy | Copy project folders] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> skipping: [45.55.241.241] =\> (item={‘invocation’: {‘module\_name’: u’stat’, ‘module\_args’: u’path=“/srv/www/bedrock.com/current/vendor”‘}, ‘item’: ‘vendor’, u’stat’: {u’exists’: False}, u’changed’: False})

> TASK: [deploy | Ensure shared sources are present] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \<45.55.241.241\> ESTABLISH CONNECTION FOR USER: web  
> \<45.55.241.241\> REMOTE\_MODULE file path=“/srv/www/bedrock.com/shared/uploads” state=“directory”  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1429835257.72-183071889507253 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1429835257.72-183071889507253 && echo $HOME/.ansible/tmp/ansible-tmp-1429835257.72-183071889507253’  
> \<45.55.241.241\> PUT /var/folders/xy/1kc57lfs7rn18nrjdpypxmxh0000gn/T/tmpWpeu6y TO /home/web/.ansible/tmp/ansible-tmp-1429835257.72-183071889507253/file  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /usr/bin/python /home/web/.ansible/tmp/ansible-tmp-1429835257.72-183071889507253/file; rm -rf /home/web/.ansible/tmp/ansible-tmp-1429835257.72-183071889507253/ \>/dev/null 2\>&1’  
> ok: [45.55.241.241] =\> (item={‘path’: ‘web/app/uploads’, ‘src’: ‘uploads’}) =\> {“changed”: false, “gid”: 33, “group”: “www-data”, “item”: {“path”: “web/app/uploads”, “src”: “uploads”}, “mode”: “0755”, “owner”: “web”, “path”: “/srv/www/bedrock.com/shared/uploads”, “size”: 4096, “state”: “directory”, “uid”: 1000}

> TASK: [deploy | Ensure shared paths are absent] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \<45.55.241.241\> ESTABLISH CONNECTION FOR USER: web  
> \<45.55.241.241\> REMOTE\_MODULE file path=“/srv/www/bedrock.com/releases/20150423202404/web/app/uploads” state=absent  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1429835258.76-200400019701731 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1429835258.76-200400019701731 && echo $HOME/.ansible/tmp/ansible-tmp-1429835258.76-200400019701731’  
> \<45.55.241.241\> PUT /var/folders/xy/1kc57lfs7rn18nrjdpypxmxh0000gn/T/tmp5u0uyr TO /home/web/.ansible/tmp/ansible-tmp-1429835258.76-200400019701731/file  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /usr/bin/python /home/web/.ansible/tmp/ansible-tmp-1429835258.76-200400019701731/file; rm -rf /home/web/.ansible/tmp/ansible-tmp-1429835258.76-200400019701731/ \>/dev/null 2\>&1’  
> ok: [45.55.241.241] =\> (item={‘path’: ‘web/app/uploads’, ‘src’: ‘uploads’}) =\> {“changed”: false, “item”: {“path”: “web/app/uploads”, “src”: “uploads”}, “path”: “/srv/www/bedrock.com/releases/20150423202404/web/app/uploads”, “state”: “absent”}

> TASK: [deploy | Create shared symlinks] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> \<45.55.241.241\> ESTABLISH CONNECTION FOR USER: web  
> \<45.55.241.241\> REMOTE\_MODULE file path=“/srv/www/bedrock.com/releases/20150423202404/web/app/uploads” src=“/srv/www/bedrock.com/shared/uploads” state=link  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1429835259.8-233836316771629 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1429835259.8-233836316771629 && echo $HOME/.ansible/tmp/ansible-tmp-1429835259.8-233836316771629’  
> \<45.55.241.241\> PUT /var/folders/xy/1kc57lfs7rn18nrjdpypxmxh0000gn/T/tmpxkJXPk TO /home/web/.ansible/tmp/ansible-tmp-1429835259.8-233836316771629/file  
> \<45.55.241.241\> EXEC ssh -C -tt -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/danielbell/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=web -o ConnectTimeout=10 45.55.241.241 /bin/sh -c ‘LANG=en\_US.UTF-8 LC\_CTYPE=en\_US.UTF-8 /usr/bin/python /home/web/.ansible/tmp/ansible-tmp-1429835259.8-233836316771629/file; rm -rf /home/web/.ansible/tmp/ansible-tmp-1429835259.8-233836316771629/ \>/dev/null 2\>&1’  
> failed: [45.55.241.241] =\> (item={‘path’: ‘web/app/uploads’, ‘src’: ‘uploads’}) =\> {“failed”: true, “item”: {“path”: “web/app/uploads”, “src”: “uploads”}, “path”: “/srv/www/bedrock.com/releases/20150423202404/web/app/uploads”, “state”: “absent”}  
> msg: Error while linking: [Errno 2] No such file or directory

> FATAL: all hosts have already failed – aborting

> PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> to retry, use: --limit @/Users/danielbell/deploy.retry

> 45.55.241.241 : ok=11 changed=4 unreachable=0 failed=1

---

## Post 26 by @daniel — 2015-04-24T01:41:31Z

Going to open up a new topic with this new issue. I guess I’ll consider this solved for now even though I foresee this becoming a hassle. I’ll see if the rest of the team runs into the same issue before I worry about it too much.

Thanks again for all your help!

---

## Post 27 by @swalkinshaw — 2015-04-24T01:42:48Z

What’s your folder structure of the repository you deployed like? Is Bedrock the root folder? Or a sub-folder like we have here: [https://github.com/roots/roots-example-project.com](https://github.com/roots/roots-example-project.com)

If so, you need to set `subtree` like [here](https://github.com/roots/roots-example-project.com/blob/6544992942a1db590347d52c5d2b8c2457fc65cf/ansible/group_vars/production#L30)

---

## Post 28 by @daniel — 2015-04-24T01:51:11Z

Ok, that deffinetly sounds like it could be part of the issue. However when I add that like so:

> local\_path: ‘…/bedrock’ # path targeting local Bedrock project directory (relative to Ansible root)  
> repo: [git@bitbucket.org](mailto:git@bitbucket.org):newbird/bedrock.git  
> subtree: bedrock  
> multisite:  
> enabled: false  
> subdomains: false

and then try to deploy again, I get this:

> TASK: [deploy | Move project subtree into root folder] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> fatal: [45.55.241.241] =\> error while evaluating conditional: bedrock

---

## Post 29 by @swalkinshaw — 2015-04-24T01:57:33Z

What version of Ansible are you running?

---

## Post 30 by @timichango — 2015-04-24T11:01:52Z

Stupid question (just because I’m on the cusp of jumping into the same challenge getting this configured as well, and I’m watching with great interest), but… why is the `github_ssh_keys` list thusly named?

How does github factor into the deployment at all if my/whomever’s project isn’t hosted on github?

And doesn’t the bedrock-ansible deployment use the local dev files to produce and transmit the deployment to staging/prod (or if I don’t even have a github account)?

How can we simply reference an ssh key that exists on our local machine to authenticate the deployment?

---

## Post 31 by @daniel — 2015-04-24T12:22:50Z

I believe I have the most recent version considering I just installed this 3 days ago. But, just in case, how do I check which version I am currently using?

---

## Post 32 by @darjanpanic — 2015-04-25T16:09:37Z

@timichango I think github ssh is used so the production server can clone the github repo etc. It’s like a 3 way communication, between

local \<-\> production server \<-\> github repo (and github \<-\> local of course)

So in a way all 3 need to be connected with ssh keys. For some of the above errors, i had to login to the DO droplet (after provision) as “web” user and create a SSH key for him and add it to github. And then try the deploy.

Although i get he same error: **error while evaluating conditional** at end.

---

## Post 33 by @fullyint — 2015-04-25T17:12:53Z

Here’s my understanding. Corrections welcome.

**Q.** How does ‘root’ connect to remote (e.g., to run `server.yml` playbook)?  
**A.** ‘root’ uses pub key you added when initially spinning up DO droplet

**Q.** How does ‘web’ user connect to remote (e.g., to run `deploy.yml` playbook)?  
**A.** ‘web’ user uses pub key added to remote for ‘web’ user.

**Q.** Wait, how was a pub key added to remote for ‘web’ user?  
**A.** If you defined the `github_ssh_keys` dictionary, the `server.yml` playbook used that info to retrieve the public key from github and load it on your remote for ‘web’ to use.

**Q.** Why not just have bedrock-ansible copy up my pub key instead going to github to get it?  
**A.** It’s a mere convenience, but also, what if you want to add a pub key for ‘randomguy’ user so he can deploy too, but you don’t have that key on your local machine? Just add randomguy’s github username to the `github_ssh_keys` list and bedrock-ansible will get it for you (courtesy of the exceptionally intelligent @austinpray [here](https://github.com/roots/bedrock-ansible/issues/10#issuecomment-53359638)).

**Q.** Err… but if I don’t have my pub key on github and don’t want to add it… how do I get a pub key on remote server for ‘web’ user to use?  
**A.** Manually load up your pub key on the remote for ‘web’ user (e.g., after running `server.yml`. Lots of searchable info out there on how.

**Q.** How does my remote server make the connection to a private repo (github or other) to clone/install?  
**A.** `github_ssh_keys` actually doesn’t have anything to do with this. You should have [SSH Forwarding](https://developer.github.com/guides/using-ssh-agent-forwarding/) set up, which allows the remote server to use your local machine’s credentials to connect to the private repo.

**Q.** So, what’s with the name `github_ssh_keys` again?  
**A.** It’s not that you use these keys to connect to a github repo (`deploy.yml` will use ssh forwarding to connect to private repo). Rather, bedrock-ansible will conveniently fetch any pub **ssh keys** from **github** that you specify, then load them on the server for users to use (like for ‘web’ user).

**Q.** I want more of this ssh stuff. MORE!  
**A.** see the [SSH Keys wiki](https://github.com/roots/bedrock-ansible/wiki/SSH-Keys)

**Q.** So, how do I get some files on the server if I don’t want to have the server clone them from a repo?  
**A.** Check out how bedrock-ansible makes it possible to [sync files from your local machine](https://github.com/roots/bedrock-ansible/blob/62fbf956618d17753dfdcf449bc33ad4a6c22bac/roles/deploy/defaults/main.yml#L30-L37) upon each deployment.

**Q.** How do I check my Ansible version?  
**A.** Lots of searchable info on this out there.

@darjanpanic Regarding “error while evaluating conditional”, I suspect your `group_vars/<environment>` files may be missing the ssl enabled false info like [this](https://github.com/roots/bedrock-ansible/blob/62fbf956618d17753dfdcf449bc33ad4a6c22bac/group_vars/production#L12-13), but not sure without more details. If the problem persists, you could start a new thread.

Let’s put any new specific and focused questions in new threads.

---

## Post 34 by @swalkinshaw — 2015-04-25T20:10:30Z

Added these to our Wiki page: [https://github.com/roots/bedrock-ansible/wiki/SSH-Keys](https://github.com/roots/bedrock-ansible/wiki/SSH-Keys)

---

## Post 35 by @fullyint — 2015-04-26T14:53:05Z

> [@timichango](#):
>
> How can we simply reference an ssh key that exists on our local machine to authenticate the deployment?

@timichango I’d recommend adding your key to github and using bedrock-ansible’s defaults for loading up your key. That way you wouldn’t have to maintain an alteration to bedrock-ansible’s roles.

But Ansible’s [authorized\_key module](http://docs.ansible.com/authorized_key_module.html) makes it easy to load a key from your local machine to the server. If I were doing it, I’d add a task at the end of [`roles/users/tasks/main.yml`](https://github.com/roots/bedrock-ansible/blob/373fe77e90e5208fc96a9def301bb9e17b66f2ac/roles/users/tasks/main.yml):

```
- name: Add SSH key for web user
  authorized_key: user="{{ web_user }}" key="{{ lookup('file', '/local/path/to/public/key/id_rsa.pub') }}"
```

(wish those lines weren’t wrapping)

---

## Post 36 by @evanfuture — 2015-04-27T10:33:48Z

I’m having the same issue. The problem I’ve noticed is with the port :22. I’ve created the secure admin sudo user and password and can login to the droplet just fine with an ssh command. But if I try to ssh into the server:22, it tells me “Could not resolve hostname **.** _.__._\*:22: nodename nor servname provided, or not known”

Could this have to do with it?
