-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update handling of deployment / provision scripts for app servers
- Loading branch information
1 parent
1b33087
commit aad7bc7
Showing
9 changed files
with
134 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
# shared steps for provisioning boxes, deploying and controlling | ||
# how web workers and queue workers are scaled | ||
- name: Set up script for running workers and gunicorn, via supervisor in project | ||
ansible.builtin.template: | ||
src: "{{ item.src }}" | ||
dest: "{{ item.dest }}" | ||
owner: deploy | ||
group: deploy | ||
mode: "0755" | ||
loop: | ||
- { | ||
src: "run_worker.sh.j2", | ||
dest: "{{ project_root }}/current/run_worker.sh", | ||
} | ||
- { | ||
src: "run_gunicorn.sh.j2", | ||
dest: "{{ project_root }}/current/run_gunicorn.sh", | ||
} | ||
become: true | ||
tags: | ||
- supervisor | ||
- config | ||
|
||
- name: Set up supervisor entries for workers and web | ||
ansible.builtin.template: | ||
src: "{{ item.src }}" | ||
dest: "{{ item.dest }}" | ||
owner: deploy | ||
group: deploy | ||
mode: "0755" | ||
loop: | ||
- { | ||
src: "supervisor.gunicorn.conf.j2", | ||
dest: "/etc/supervisor/conf.d/{{ supervisor_gunicorn_app }}.conf", | ||
} | ||
- { | ||
src: "supervisor.worker.conf.j2", | ||
dest: "/etc/supervisor/conf.d/{{ supervisor_worker_job }}.conf", | ||
} | ||
become: true | ||
tags: | ||
- supervisor | ||
- config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
- name: Control how many processes we are running without redeploying the TGWF django apps | ||
hosts: | ||
# - app1.thegreenwebfoundation.org | ||
# - app2.thegreenwebfoundation.org | ||
- app3.thegreenwebfoundation.org | ||
- app4.thegreenwebfoundation.org | ||
remote_user: "deploy" | ||
become: false | ||
|
||
vars: | ||
# see vars in the inventory yaml files | ||
# use one of: started, restarted, stopped | ||
preferred_state: started | ||
|
||
tasks: | ||
- name: Set up process management with supervisor | ||
ansible.builtin.include_tasks: "_set_up_process_mgmt.yml" | ||
tags: | ||
- supervisor | ||
|
||
- name: Update django apps using supervisor | ||
ansible.builtin.supervisorctl: | ||
name: "{{ supervisor_gunicorn_app }}:" | ||
state: "{{ preferred_state }}" | ||
become: true | ||
tags: | ||
- supervisor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters