Skip to content

Commit

Permalink
Trellis: Revise how ansible-playbook cmd specifies env
Browse files Browse the repository at this point in the history
  • Loading branch information
fullyint committed Nov 23, 2015
1 parent 98d560b commit 2e57ba3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions trellis/deploys.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Deploy with a single command: `./deploy.sh <environment> <domain>`

`deploy.sh` is a very simple Bash script which just runs the actual `ansible-playbook` command which can be a little annoying to type out.

The actual command looks like this: `ansible-playbook -i hosts/<environment> deploy.yml --extra-vars="site=<domain>"`.
The actual command looks like this: `ansible-playbook deploy.yml -e "site=<domain> env=<environment>"`.

You can always use this command itself since it can take any additional `ansible-playbook` options.

Expand Down Expand Up @@ -143,9 +143,9 @@ Deploy command:

Or alternatively:
```
ansible-playbook -i hosts/production deploy.yml --extra-vars="site-mysite.com"
ansible-playbook deploy.yml -e "site=mysite.com env=production"
```

## Rollbacks

To rollback a deploy, run `ansible-playbook -i hosts/<environment> rollback.yml --extra-vars="site=<domain>"`
To rollback a deploy, run `ansible-playbook rollback.yml -e "site=<domain> env=<environment>"`
2 changes: 1 addition & 1 deletion trellis/remote-server-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ Setting up remote servers (staging/production) is similar to the [local developm
2. Add your server IP/hostnames to `hosts/<environment>`.
3. Specify public SSH keys for `users` in `group_vars/all/users.yml`. See the [SSH Keys docs](https://roots.io/trellis/docs/ssh-keys/).
4. Consider setting `sshd_permit_root_login: false` in `group_vars/all/security.yml`. See the [Security docs](https://roots.io/trellis/docs/security/).
5. Run `ansible-playbook -i hosts/<environment> server.yml`.
5. Run `ansible-playbook server.yml -e env=<environment>`.
2 changes: 1 addition & 1 deletion trellis/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ When you set `sshd_permit_root_login: false` and run the `server.yml` playbook,

With `root` login disabled, the `admin_user` will need to run commands using `sudo` with a password, so you will need to add the option [`--ask-become-pass`](http://docs.ansible.com/ansible/become.html#new-ansible-variables) when running `server.yml`.
```
ansible-playbook -i hosts/production server.yml --ask-become-pass
ansible-playbook server.yml -e env=production --ask-become-pass
```
This prompts you to enter the sudoer password described in the "Admin User Sudoer Password" section below. See the [SSH Keys docs](https://roots.io/trellis/docs/ssh-keys/) for more information about Trellis SSH users.

Expand Down

0 comments on commit 2e57ba3

Please sign in to comment.