Skip to content

Commit

Permalink
mvp-1-no (EticaAI/aguia-pescadora#26): reorganizado para potencialmen…
Browse files Browse the repository at this point in the history
…te ter exemplo de mais de um nó, mesmo sem kubernetes
  • Loading branch information
fititnt committed Jul 4, 2019
1 parent 57966bd commit 7847a4e
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 31 deletions.
2 changes: 1 addition & 1 deletion 1-node-tsuru-autossl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- name: "localhost: tsuru client? docker? docker-machine?"
hosts: localhost
roles:
- can-localhost-setup-remote-tsuru
- tsuru-installer
# - { role: 1-node-tsuru-autossl, tsuru_initialization_only: yes }

- name: "Águia Pescadora PaaS Tudo-Em-Um-Nó (Tsuru PaaS, Minio, AutoSSL via OpenResty)"
Expand Down
55 changes: 53 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ git clone https://github.com/EticaAI/aguia-pescadora-ansible-playbooks.git .
ansible-playbook 1-node-tsuru-autossl.yml -e paas_host=example.com
```

<!--
Exemplo com 3 nós:
ansible-playbook 1-node-tsuru-autossl.yml -e paas_host=example.com
Exemplo que estou testando:
ansible-playbook -i inventory/1-node-exemplo/inventory.ini 1-node-tsuru-autossl.yml
-->

> - Tsuru URLs:
> - https://tsuru.example.com
> - https://tsuru-dashboard.example.com
Expand All @@ -49,7 +58,10 @@ ansible-playbook 1-node-tsuru-autossl.yml -e paas_host=example.com
- [Seu computador local](#seu-computador-local)
- [Instalação do Ansible](#instalação-do-ansible)
- [Servidores remotos](#servidores-remotos)
- [Veja também](#veja-também)
- [Sobre este Ansible Playbook](#sobre-este-ansible-playbook)
- [Roles](#roles)
- [paas-host](#paas-host)
- [tsuru-installer](#tsuru-installer)
- [Referências sobre a pilha de soluções da Águia Pescadora](#referências-sobre-a-pilha-de-soluções-da-águia-pescadora)
- [Ansible](#ansible)
- [Documentação Ansible-BR](#documentação-ansible-br)
Expand Down Expand Up @@ -131,7 +143,46 @@ servidores remotos estarão com pacotes instalados e prontos para uso inicial**.
- Caso opte por instalar com o 1-node.yml o `tsuru-client` requer que a
chave privada usada no momento da instalação seja sem senha.

# Veja também
## Sobre este Ansible Playbook

### Roles

<!--
#### common
- [common](roles/common/README.md)
-->

#### paas-host

- [paas-host](roles/paas-host/README.md)

`paas-host` é a função responsável por preparar a(s) VPSs para fazer
terminação TLS (isto é, servir o primeiro acesso HTTPS) que chegam no servidor.
Usa o [OpenResty](https://github.com/openresty/openresty) +
[GUI/lua-resty-auto-ssl](https://github.com/GUI/lua-resty-auto-ssl).

#### tsuru-installer

- [tsuru-installer](roles/tsuru-installer/README.md)

Oferece uma versão mais limitada do que o fantástico
[Tsuru Installer](https://docs.tsuru.io/stable/installing/using-tsuru-installer.html)
automatizaria por você.

A função dele é criar na pasta [tsuru-initialization-configs](tsuru-initialization-configs/)
os arquivos de configuração que são parâmetros usados na chamada
`tsuru install-create -c install-config.yml -e install-compose.yml`. Caso você
não tenha o [Docker](https://docs.docker.com/install/),
[Docker Machine](https://docs.docker.com/machine/install-machine/) e o
[Tsuru Client](https://tsuru-client.readthedocs.io/en/latest/installing.html)
irá alertar.

<!--
As principais diferenças entre a documentação padrão do Tsuru são:
1. Gera arquivos de configuração
-->

## Referências sobre a pilha de soluções da Águia Pescadora

Expand Down
5 changes: 4 additions & 1 deletion inventory/1-node-exemplo/inventory.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[all]
aguia-pescadora-foxtrot.etica.ai
aguia-pescadora-foxtrot.etica.ai

[all:vars]
tsuru_cluster_name="aguia-pescadora-exemplo"
1 change: 1 addition & 0 deletions inventory/3-node-example/inventory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#...
6 changes: 0 additions & 6 deletions roles/paas-host/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,3 @@

- name: Requerimentos do Tsuru caso seja instalado diretamente na VPS
include: tsuru-requeriments-if-direct-on-vps.yml

- name: Prepara arquivos que serão usados pelo Tsuru para instalar na VPS remota (install-compose.yml e install-config.yml)
include: tsuru-prepare-configs.yml

- name: Instalação do Tsuru
include: tsuru-install.yml
6 changes: 6 additions & 0 deletions roles/tsuru-installer/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@
register: result3
changed_when: false
ignore_errors: false

- name: Prepara arquivos que serão usados pelo Tsuru para instalar na VPS remota (install-compose.yml e install-config.yml)
include: tsuru-prepare-configs.yml

- name: Instalação do Tsuru
include: tsuru-install.yml
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,39 @@

- name: "tsuru-init: install-compose.yml 1"
template:
src: roles/1-node-tsuru-autossl/templates/tsuru-initialization/install-compose.yml.j2
dest: /install-compose.yml
owner: root
group: root
mode: '0600'
src: "{{role_path}}/templates/1-node/install-compose.yml.j2"
dest: "{{ playbook_dir }}/tsuru-initialization-configs/install-compose.yml"
#owner: root
#group: root
#mode: '0600'
#variable_start_string: "{##"
#variable_end_string: "##}"

- name: "tsuru-init: install-compose.yml 2"
fetch:
src: /install-compose.yml
dest: "{{ playbook_dir }}/tsuru-initialization-configs/"
#flat: yes
#- name: "tsuru-init: install-compose.yml 2"
# fetch:
# src: /install-compose.yml
# dest: "{{ playbook_dir }}/tsuru-initialization-configs/"
# flat: yes

- name: "tsuru-init: install-config.yml 1"
template:
src: roles/1-node-tsuru-autossl/templates/tsuru-initialization/install-config.yml.j2
dest: /install-config.yml
owner: root
group: root
mode: '0600'
src: "{{role_path}}/templates/1-node/install-config.yml.j2"
dest: "{{ playbook_dir }}/tsuru-initialization-configs//install-config.yml"
#owner: root
#group: root
#mode: '0600'
#variable_start_string: "{##"
#variable_end_string: "##}"

- name: "tsuru-init: install-config.yml 2"
fetch:
src: /install-config.yml
dest: "{{ playbook_dir }}/tsuru-initialization-configs/"
#flat: yes
#- name: "tsuru-init: install-config.yml 2"
# fetch:
# src: /install-config.yml
# dest: "{{ playbook_dir }}/tsuru-initialization-configs/"
# flat: yes

#- name: install-config.yml.j2(tsuru-init)
# template:
# src: roles/1-node-tsuru-autossl/templates/tsuru-initialization/install-config.yml.j2
# src: roles/tsuru-installertemplates/tsuru-initialization/install-config.yml.j2
# dest: /root/temp-tsuru-init/
# owner: root
# group: root
Expand Down

0 comments on commit 7847a4e

Please sign in to comment.