Skip to content

Commit

Permalink
Add tags to select includes and tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
fullyint committed Dec 30, 2015
1 parent 1337fcf commit 4b874eb
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 19 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### HEAD
* Add tags to select includes and tasks ([#453](https://github.com/roots/trellis/pull/453))
* Improve Git deploy implementation via `git archive` ([#451](https://github.com/roots/trellis/pull/451))
* Replace strip_www with optional redirect to www/non-www ([#452](https://github.com/roots/trellis/pull/452))
* Accommodate file encryption via ansible vault ([#317](https://github.com/roots/trellis/pull/317))
Expand Down
4 changes: 2 additions & 2 deletions roles/deploy/tasks/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- include: "{{ deploy_build_before | default('../hooks/example.yml') }}"
- include: "{{ deploy_build_before | default('../hooks/example.yml') }} tags=deploy-build-before"

- name: Copy project templates
template:
Expand All @@ -19,4 +19,4 @@
with_items: project_folder_paths.results
when: item.stat.exists

- include: "{{ deploy_build_after | default('../hooks/example.yml') }}"
- include: "{{ deploy_build_after | default('../hooks/example.yml') }} tags=deploy-build-after"
4 changes: 2 additions & 2 deletions roles/deploy/tasks/finalize.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
- include: "{{ deploy_finalize_before | default('../hooks/example.yml') }}"
- include: "{{ deploy_finalize_before | default('../hooks/example.yml') }} tags=deploy-finalize-before"

- name: Finalize the deploy
deploy_helper:
path: "{{ project_root }}"
release: "{{ deploy_helper.new_release }}"
state: finalize

- include: "{{ deploy_finalize_after | default('../hooks/example.yml') }}"
- include: "{{ deploy_finalize_after | default('../hooks/example.yml') }} tags=deploy-finalize-after"

- debug:
msg: "{{ project_version }}@{{ git_commit.after | truncate(7, True, '') }} deployed as release {{ deploy_helper.new_release }}"
4 changes: 2 additions & 2 deletions roles/deploy/tasks/initialize.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
- include: "{{ deploy_initialize_before | default('../hooks/example.yml') }}"
- include: "{{ deploy_initialize_before | default('../hooks/example.yml') }} tags=deploy-initialize-before"

- name: Initialize
deploy_helper:
path: "{{ project_root }}"
state: present

- include: "{{ deploy_initialize_after | default('../hooks/example.yml') }}"
- include: "{{ deploy_initialize_after | default('../hooks/example.yml') }} tags=deploy-initialize-after"
4 changes: 2 additions & 2 deletions roles/deploy/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
- include: "{{ deploy_before | default('../hooks/example.yml') }}"
- include: "{{ deploy_before | default('../hooks/example.yml') }} tags=deploy-before"
- include: initialize.yml
- include: update.yml
- include: prepare.yml
- include: build.yml
- include: share.yml
- include: finalize.yml
- include: "{{ deploy_after | default('../hooks/example.yml') }}"
- include: "{{ deploy_after | default('../hooks/example.yml') }} tags=deploy-after"
4 changes: 2 additions & 2 deletions roles/deploy/tasks/prepare.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- include: "{{ deploy_prepare_before | default('../hooks/example.yml') }}"
- include: "{{ deploy_prepare_before | default('../hooks/example.yml') }} tags=deploy-prepare-before"

- name: write unfinished file
file:
Expand Down Expand Up @@ -34,4 +34,4 @@
chdir: "{{ project_source_path }}"
when: project_subtree_path != 'False'

- include: "{{ deploy_prepare_after | default('../hooks/example.yml') }}"
- include: "{{ deploy_prepare_after | default('../hooks/example.yml') }} tags=deploy-prepare-after"
4 changes: 2 additions & 2 deletions roles/deploy/tasks/share.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- include: "{{ deploy_share_before | default('../hooks/example.yml') }}"
- include: "{{ deploy_share_before | default('../hooks/example.yml') }} tags=deploy-share-before"

- name: Ensure shared sources are present
file:
Expand All @@ -21,4 +21,4 @@
state: link
with_items: project_shared_children

- include: "{{ deploy_share_after | default('../hooks/example.yml') }}"
- include: "{{ deploy_share_after | default('../hooks/example.yml') }} tags=deploy-share-after"
4 changes: 2 additions & 2 deletions roles/deploy/tasks/update.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- include: "{{ deploy_update_before | default('../hooks/example.yml') }}"
- include: "{{ deploy_update_before | default('../hooks/example.yml') }} tags=deploy-update-before"

- name: Check whether project source path is a git repo
stat:
Expand Down Expand Up @@ -28,4 +28,4 @@
accept_hostkey: yes
register: git_commit

- include: "{{ deploy_update_after | default('../hooks/example.yml') }}"
- include: "{{ deploy_update_after | default('../hooks/example.yml') }} tags=deploy-update-after"
1 change: 1 addition & 0 deletions roles/nginx/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
chdir: "{{ nginx_path }}/ssl"
creates: "{{ nginx_path }}/ssl/dhparams.pem"
notify: reload nginx
tags: [diffie-hellman]

- name: Grab h5bp/server-configs-nginx
git:
Expand Down
2 changes: 1 addition & 1 deletion roles/wordpress-install/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- include: directories.yml
- include: directories.yml tags=wordpress-install-directories

- name: Create .env file
template: src="env.j2"
Expand Down
6 changes: 3 additions & 3 deletions roles/wordpress-setup/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- include: database.yml
- include: self-signed-certificate.yml
- include: nginx.yml
- include: database.yml tags=wordpress-setup-database
- include: self-signed-certificate.yml tags=wordpress-setup-self-signed-certificate
- include: nginx.yml tags=wordpress-setup-nginx

- name: Create web root
file:
Expand Down
2 changes: 1 addition & 1 deletion server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- { role: swapfile, swapfile_size: 1GB, tags: [swapfile] }
- { role: fail2ban, tags: [fail2ban] }
- { role: ferm, tags: [ferm] }
- { role: ntp }
- { role: ntp, tags: [ntp] }
- { role: users, tags: [users] }
- { role: sshd, tags: [sshd] }
- { role: mariadb, tags: [mariadb], when: not mysql_remote_database }
Expand Down
1 change: 1 addition & 0 deletions variable-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
Environment missing. Use `-e` to define `env`:
ansible-playbook {{ playbook }} -e {{ extra_vars_command }}
when: env is not defined
tags: [variable-check]

0 comments on commit 4b874eb

Please sign in to comment.