Browse Source
This makes it possible to run a deployment as opposed to a 'setup' play where all the necessary prerequisites are arranged on the server. We don't need to do that each time. Closes decentral1se/xppl#4. Might help decentral1se/xppl#2.ansible-setup-and-deploy
Luke Murphy
5 years ago
4 changed files with 42 additions and 9 deletions
@ -1,14 +1,27 @@ |
|||||
# XPPL Ansible Automation |
# XPPL Ansible Automation |
||||
|
|
||||
An automated deployment for the XPPL. |
An automated deployment for the XPPL. If you're running these scripts, you'll |
||||
|
need SSH access and Sudo permissions on the machines. It is already running |
||||
|
deployments for: |
||||
|
|
||||
## Run It |
* [books.vvvvvvaria.org](https://books.vvvvvvaria.org/) |
||||
|
|
||||
You'll need to have SSH and Sudo access to [varia.zone] first. |
## Prerequisites |
||||
|
|
||||
|
You'll need to install [Ansible](https://docs.ansible.com). |
||||
|
|
||||
```bash |
```bash |
||||
$ sudo apt install -y ansible |
$ sudo apt install -y ansible |
||||
$ ansible-playbook --ask-become-pass plays/main.yml |
|
||||
``` |
``` |
||||
|
|
||||
[varia.zone]: https://varia.zone/ |
## Setup a New XPPL |
||||
|
|
||||
|
```bash |
||||
|
$ ansible-playbook --limit varia-zone --ask-become-pass plays/setup.yml |
||||
|
``` |
||||
|
|
||||
|
## Deploy a New XPPL Version |
||||
|
|
||||
|
```bash |
||||
|
$ ansible-playbook --limit varia-zone --ask-become-pass plays/deploy.yml |
||||
|
``` |
||||
|
@ -1,2 +1,2 @@ |
|||||
[varia-zone] |
[managed] |
||||
varia.zone ansible_ssh_port=12345 |
varia.zone ansible_ssh_port=12345 |
||||
|
@ -0,0 +1,20 @@ |
|||||
|
--- |
||||
|
|
||||
|
- hosts: managed |
||||
|
pre_tasks: |
||||
|
- name: Shutdown the running XPPL for the deployment. |
||||
|
become: true |
||||
|
supervisorctl: |
||||
|
name: 'xppl:' |
||||
|
state: stopped |
||||
|
roles: |
||||
|
- role: git # Clone the project source |
||||
|
- role: pipenv # Install Python dependencies |
||||
|
- role: env # Configure the application environment |
||||
|
- role: nginx # Setup the Nginx configuration |
||||
|
post_tasks: |
||||
|
- name: Start back up the XPPL after the deployment. |
||||
|
become: true |
||||
|
supervisorctl: |
||||
|
name: 'xppl:' |
||||
|
state: stopped |
@ -1,11 +1,11 @@ |
|||||
--- |
--- |
||||
|
|
||||
- hosts: varia-zone |
- hosts: managed |
||||
roles: |
roles: |
||||
- role: perms # Setup users and groups |
- role: perms # Setup users and groups |
||||
- role: git # Clone the project source |
- role: git # Clone the project source |
||||
- role: pipenv # Install Python dependencies |
- role: pipenv # Install Python dependencies |
||||
- role: env # Configure application environment |
- role: env # Configure the application environment |
||||
- role: rqlite # Install RQLite |
- role: rqlite # Install RQLite |
||||
- role: supervisor # Setup managed processes |
- role: supervisor # Setup managed processes |
||||
- role: nginx # Setup Nginx configuration |
- role: nginx # Setup the Nginx configuration |
Loading…
Reference in new issue