forked from roots/trellis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.yml
33 lines (31 loc) · 1.07 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
- import_playbook: variable-check.yml
vars:
playbook: deploy.yml
- name: Test Connection
hosts: web:&{{ env }}
gather_facts: false
vars:
dynamic_user: false
roles:
- { role: connection, tags: [connection, always] }
- name: Deploy WP site
hosts: web:&{{ env }}
remote_user: "{{ web_user }}"
pre_tasks:
- name: Ensure site is valid
delegate_to: localhost
fail:
msg: "Site `{{ site | default('') }}` is not valid. Available sites to deploy: {{ wordpress_sites.keys() | join(', ') }}"
when: wordpress_sites[site | default('')] is not defined
- name: Ensure repo is valid
delegate_to: localhost
fail:
msg: |
Invalid Git repository.
Ensure that your site's `repo` variable is defined in `group_vars/{{ env }}/wordpress_sites.yml` and uses the SSH format (example: git@github.com:roots/bedrock.git)
More info:
> https://roots.io/trellis/docs/deployments/
when: project.repo is not defined or project.repo is not match("^ssh://.+@.+|.+@.+:.+")
roles:
- deploy