Skip to content

Commit

Permalink
tldr (EticaAI/aguia-pescadora#27): 1-node-tsuru-docker renomeado para…
Browse files Browse the repository at this point in the history
… 1-node-tsuru-autossl; entre outros ajustes
  • Loading branch information
fititnt committed Jul 1, 2019
1 parent 8415d86 commit 3ae627e
Show file tree
Hide file tree
Showing 24 changed files with 46 additions and 23 deletions.
10 changes: 5 additions & 5 deletions 1-node.yml → 1-node-tsuru-autossl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
- name: Tsuru PaaS + OpenResty, 1 Nó "Tudo Em Um", Docker puro (sem Kubernetes)
hosts: all
remote_user: root
vars:
paas_host: "{{ inventory_hostname }}"
# tsuru_target: "tsuru.{{paas_host}}
# apps_domain: "app.{{paas_host}}"

roles:
- common
- 1-node-tsuru-docker
# - mysql
# - nginx
# - php-fpm
# - wordpress
- 1-node-tsuru-autossl
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@ organização em _[Etica.AI Infrastructure: Clusters & VPS](https://github.com/o
# TODO: escrever um tldr.yml (fititnt, 2019-07-01 30:57 BRT)
# @see https://github.com/EticaAI/aguia-pescadora/issues/27
git clone https://github.com/EticaAI/aguia-pescadora-ansible-playbooks.git .
ansible-playbook tldr.yml -e tsuru_host=tsuru.example.com
# http://tsuru.example.com:8080
ansible-playbook tldr.yml -e paas_host=example.com
```
**Resultado ao final do TL;DR:**
- Tsuru URLs:
- https://tsuru.example.com
- https://tsuru-dashboard.example.com
- Apps
- https://meu-app-1.app.example.com
- https://my-app2.app.example.com
- https://mi-aplicación-tre.app.example.com

---

Expand All @@ -31,7 +38,7 @@ ansible-playbook tldr.yml -e tsuru_host=tsuru.example.com
- [Ansible Playbooks da Águia Pescadora da Etica.AI](#ansible-playbooks-da-águia-pescadora-da-eticaai)
- [Como usar o aguia-pescadora-ansible-playbooks](#como-usar-o-aguia-pescadora-ansible-playbooks)
- [Executar os Playbooks](#executar-os-playbooks)
- [1-node-tsuru-docker](#1-node-tsuru-docker)
- [1-node-tsuru-autossl](#1-node-tsuru-autossl)
- [etica.dev](#eticadev)
- [Requisitos](#requisitos)
- [Seu computador local](#seu-computador-local)
Expand Down Expand Up @@ -65,19 +72,20 @@ está convertendo scripts e estratégias para o novo padrão. Pode levar um temp
até implementação desse nível de automação, porém pode ajudar em especial
reuso por colegas. Grato pela compreensão :).

#### 1-node-tsuru-docker
#### 1-node-tsuru-autossl
![Situação: Trabalho em Progresso](img/badges/status-work-in-progress.svg)
Tsuru PaaS usando docker (sem Kubernetes) com auto-SSL feita por OpenResty + Lua-Resty-autossl

_TODO: renomear role `1-node-tsuru-docker` para `1-node-tsuru-docker-resty-auto-ssl` (fititnt, 2019-07-01 06:06 BRT)_

```bash
ansible-playbook -i inventory/1-node-testserver/inventory.ini 1-node.yml
ansible-playbook -i inventory/1-node-testserver/inventory.ini 1-node-tsuru-autossl.yml
```

#### etica.dev
![Situação: Trabalho em Progresso](img/badges/status-work-in-progress.svg) Este é o playbook usado em produção no etica.dev.

Neste modelo etica.dev provavelmente estará usando Tsuru em Kubernetes em vez
de apenas docker.

```bash
ansible-playbook -i inventory/etica.dev/inventory.ini playbook.yml
```
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions roles/1-node-tsuru-autossl/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# defaults file for 1-node-tsuru-autossl

# @see https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable
paas_host: "example.com"
tsuru_target: "tsuru.{{paas_host}}"
tsuru_dashboard: "tsuru-dashboard.{{paas_host}}"
apps_domain: "app.{{paas_host}}"
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,47 @@

- name: /usr/local/openresty/nginx/html/index.html
template:
src: roles/1-node-tsuru-docker/templates/openresty/nginx/html/index.html.j2
src: roles/1-node-tsuru-autossl/templates/openresty/nginx/html/index.html.j2
dest: /usr/local/openresty/nginx/html/index.html
owner: root
group: root
mode: '0644'

- name: /usr/local/openresty/nginx/html/favicon.ico
template:
src: roles/1-node-tsuru-docker/templates/openresty/nginx/html/favicon.ico
src: roles/1-node-tsuru-autossl/templates/openresty/nginx/html/favicon.ico
dest: /usr/local/openresty/nginx/html/favicon.ico
owner: root
group: root
mode: '0644'

- name: /usr/local/openresty/nginx/html/robots.txt
template:
src: roles/1-node-tsuru-docker/templates/openresty/nginx/html/robots.txt
src: roles/1-node-tsuru-autossl/templates/openresty/nginx/html/robots.txt
dest: /usr/local/openresty/nginx/html/robots.txt
owner: root
group: root
mode: '0644'

- name: /usr/local/openresty/nginx/html/404.html
template:
src: roles/1-node-tsuru-docker/templates/openresty/nginx/html/404.html.j2
src: roles/1-node-tsuru-autossl/templates/openresty/nginx/html/404.html.j2
dest: /usr/local/openresty/nginx/html/404.html
owner: root
group: root
mode: '0644'

- name: /usr/local/openresty/nginx/html/50x.html
template:
src: roles/1-node-tsuru-docker/templates/openresty/nginx/html/50x.html.j2
src: roles/1-node-tsuru-autossl/templates/openresty/nginx/html/50x.html.j2
dest: /usr/local/openresty/nginx/html/50x.html
owner: root
group: root
mode: '0644'

- name: /usr/local/openresty/nginx/conf/nginx.conf
template:
src: roles/1-node-tsuru-docker/templates/openresty/nginx/conf/nginx.conf.j2
src: roles/1-node-tsuru-autossl/templates/openresty/nginx/conf/nginx.conf.j2
dest: /usr/local/openresty/nginx/conf/nginx.conf
owner: root
group: root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
when: is_openresty is failed

- name: "openresty: apt-key add"
apt_key:
apt_key:
url: https://openresty.org/package/pubkey.gpg
state: present
when: is_openresty is failed

- name: "openresty: add-apt-repository (...)"
apt_repository:
apt_repository:
repo: 'deb http://openresty.org/package/ubuntu bionic main'
state: present
filename: openresty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,24 @@
</head>
<body>
<h1>{{ inventory_hostname }}</h1>
<ul>
<li>Apps: <strong>https://MyApp.{{ apps_domain }}</strong></li>
<li>Tsuru target: <a href="https://{{ tsuru_target }}">https://{{ tsuru_target }}</a></li>
<li>Tsuru dashboard: <a href="https://{{ tsuru_dashboard }}">https://{{ tsuru_dashboard }}</a></li>
</ul>
<!--
<p>If you see this page, the OpenResty web platform is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="https://openresty.org/">openresty.org</a>.<br/>
Commercial support is available at
<a href="https://openresty.com/">openresty.com</a>.</p>

<p><em>Thank you for flying OpenResty.</em></p>
<p>{{ inventory_hostname }}</p>
<p>{{ tsuru_target }}</p>
<p>{{ tsuru_target }}</p>
<p>{{ apps_domain }}</p>
-->
</body>
</html>
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions roles/1-node-tsuru-docker/defaults/main.yml

This file was deleted.

0 comments on commit 3ae627e

Please sign in to comment.