Skip to content

Commit 352ec00

Browse files
authored
Merge pull request MichaelCade#427 from manuelver/feature/translateES-17
2 parents 7fb35d9 + 02a405e commit 352ec00

20 files changed

Lines changed: 751 additions & 746 deletions

2022/es/Days/day66.md

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
## Ansible Playbooks (Continued)
1+
## Ansible Playbooks (Continuación)
22

3-
In our last section, we started with creating our small lab using a Vagrantfile to deploy 4 machines and we used the Linux machine we created in that section as our ansible control system.
3+
En nuestra última sección, comenzamos creando nuestro pequeño laboratorio utilizando un archivo Vagrantfile para implementar 4 máquinas, y utilizamos la máquina Linux que creamos en esa sección como nuestro sistema de control de Ansible.
44

5-
We also ran through a few scenarios of playbooks and at the end we had a playbook that made our web01 and web02 individual web servers.
5+
También ejecutamos algunos escenarios de playbooks y al final teníamos un playbook que convertía nuestros servidores web individuales web01 y web02.
66

77
![](Images/Day66_config1.png)
88

9-
### Keeping things tidy
9+
### Manteniendo las cosas ordenadas
1010

11-
Before we get into further automation and deployment we should cover the ability to keep our playbook lean and tidy and how we can separate our tasks and handlers into subfolders.
11+
Antes de adentrarnos en la automatización y el despliegue, debemos cubrir la capacidad de mantener nuestro playbook limpio y ordenado, y cómo podemos separar nuestras tareas y handlers en subcarpetas.
12+
13+
Vamos a copiar nuestras tareas en sus archivos dentro de una carpeta.
1214

13-
we are going to copy our tasks into their file within a folder.
1415

1516
```Yaml
1617
- name: ensure apache is at the latest version
@@ -35,7 +36,7 @@ we are going to copy our tasks into their file within a folder.
3536
state: started
3637
```
3738
38-
and the same for the handlers.
39+
Y lo mismo para los handlers
3940
4041
```Yaml
4142
- name: restart apache
@@ -44,37 +45,37 @@ and the same for the handlers.
4445
state: restarted
4546
```
4647
47-
then within our playbook now named `playbook2.yml` we point to these files. All of which can be found at [ansible-scenario2](Days/../Configmgmt/ansible-scenario2/)
48+
Luego, en nuestro playbook, que ahora se llama playbook2.yml, nos referimos a estos archivos. Todos ellos se pueden encontrar en [ansible-scenario2](Days/../Configmgmt/ansible-scenario2/)
4849
49-
You can test this on your control machine. If you have copied the files from the repository you should have noticed something changed in the "write a basic index.html file"
50+
Puedes probar esto en tu máquina de control. Si has copiado los archivos del repositorio, deberías haber notado un cambio en "escribir un archivo "index.html" básico".
5051
5152
![](Images/Day66_config2.png)
5253
53-
Let's find out what simple change I made. Using `curl web01:8000`
54+
Veamos qué cambio simple hice. Usando `curl web01:8000`
5455

5556
![](Images/Day66_config3.png)
5657

57-
We have just tidied up our playbook and started to separate areas that could make a playbook very overwhelming at scale.
58+
Acabamos de organizar nuestro playbook y comenzamos a separar áreas que podrían hacer que un playbook sea muy abrumador a gran escala.
5859

59-
### Roles and Ansible Galaxy
60+
### Roles y Ansible Galaxy
6061

61-
At the moment we have deployed 4 VMs and we have configured 2 of these VMs as our webservers but we have some more specific functions namely, a database server and a loadbalancer or proxy. For us to do this and tidy up our repository, we can use roles within Ansible.
62+
En este momento, hemos implementado 4 máquinas virtuales y hemos configurado 2 de ellas como nuestros servidores web, pero tenemos algunas funciones más específicas, como un servidor de base de datos y un equilibrador de carga o proxy. Para hacer esto y organizar nuestro repositorio, podemos usar roles en Ansible.
6263

63-
To do this we will use the `ansible-galaxy` command which is there to manage ansible roles in shared repositories.
64+
Para hacer esto, utilizaremos el comando `ansible-galaxy`, que sirve para gestionar roles de Ansible en repositorios compartidos.
6465

6566
![](Images/Day66_config4.png)
6667

67-
We are going to use `ansible-galaxy` to create a role for apache2 which is where we are going to put our specifics for our webservers.
68+
Vamos a utilizar `ansible-galaxy` para crear un rol para Apache2, donde colocaremos nuestras especificaciones para nuestros servidores web.
6869

6970
![](Images/Day66_config5.png)
7071

71-
The above command `ansible-galaxy init roles/apache2` will create the folder structure that we have shown above. Our next step is we need to move our existing tasks and templates to the relevant folders in the new structure.
72+
El comando anterior `ansible-galaxy init roles/apache2` creará la estructura de carpetas que se muestra arriba. Nuestro siguiente paso es mover nuestras tareas y plantillas existentes a las carpetas relevantes en la nueva estructura.
7273

7374
![](Images/Day66_config6.png)
7475

75-
Copy and paste are easy to move those files but we also need to make a change to the tasks/main.yml so that we point this to the apache2_install.yml.
76+
Copiar y pegar es fácil para mover esos archivos, pero también necesitamos hacer un cambio en tasks/main.yml para que apunte a apache2_install.yml.
7677

77-
We also need to change our playbook now to refer to our new role. In the playbook1.yml and playbook2.yml we determine our tasks and handlers in different ways as we changed these between the two versions. We need to change our playbook to use this role as per below:
78+
También necesitamos cambiar nuestro playbook para que haga referencia a nuestro nuevo rol. En playbook1.yml y playbook2.yml, determinamos nuestras tareas y handlers de diferentes maneras, ya que los cambiamos entre las dos versiones. Necesitamos cambiar nuestro playbook para usar este rol de la siguiente manera:
7879

7980
```Yaml
8081
- hosts: webservers
@@ -89,32 +90,33 @@ We also need to change our playbook now to refer to our new role. In the playboo
8990

9091
![](Images/Day66_config7.png)
9192

92-
We can now run our playbook again this time with the new playbook name `ansible-playbook playbook3.yml` you will notice the depreciation, we can fix that next.
93+
Ahora podemos ejecutar nuestro playbook nuevamente, esta vez con el nuevo nombre de playbook `ansible-playbook playbook3.yml`. Notarás la advertencia de depreciación, podemos solucionarlo después.
9394

9495
![](Images/Day66_config8.png)
9596

96-
Ok, the depreciation although our playbook ran we should fix our ways now, to do that I have changed the include option in the tasks/main.yml to now be import_tasks as per below.
97+
Ok, a pesar de la advertencia de depreciación, nuestro playbook se ejecutó, pero ahora debemos corregir nuestros métodos. Para hacerlo, he cambiado la opción de inclusión (include) en tasks/main.yml para que ahora sea import_tasks, como se muestra a continuación.
9798

9899
![](Images/Day66_config9.png)
99100

100-
You can find these files in the [ansible-scenario3](Days/Configmgmt/ansible-scenario3)
101+
Puedes encontrar estos archivos en [ansible-scenario3](Days/Configmgmt/ansible-scenario3)
101102

102-
We are also going to create a few more roles whilst using `ansible-galaxy` we are going to create:
103+
También vamos a crear algunos roles más mientras usamos ansible-galaxy, vamos a crear:
103104

104-
- common = for all of our servers (`ansible-galaxy init roles/common`)
105-
- nginx = for our loadbalancer (`ansible-galaxy init roles/nginx`)
105+
- common = para todos nuestros servidores (`ansible-galaxy init roles/common`)
106+
- nginx = para nuestro equilibrador de carga (`ansible-galaxy init roles/nginx`)
106107

107108
![](Images/Day66_config10.png)
108109

109-
I am going to leave this one here and in the next session, we will start working on those other nodes we have deployed but have not done anything with yet.
110+
Voy a dejarlo aquí y en la próxima sesión, comenzaremos a trabajar en esos otros nodos que hemos implementado pero aún no hemos hecho nada con ellos.
110111

111-
## Resources
112+
## Recursos
112113

113114
- [What is Ansible](https://www.youtube.com/watch?v=1id6ERvfozo)
114115
- [Ansible 101 - Episode 1 - Introduction to Ansible](https://www.youtube.com/watch?v=goclfp6a2IQ)
115116
- [NetworkChuck - You need to learn Ansible right now!](https://www.youtube.com/watch?v=5hycyr-8EKs&t=955s)
116117
- [Your complete guide to Ansible](https://www.youtube.com/playlist?list=PLnFWJCugpwfzTlIJ-JtuATD2MBBD7_m3u)
118+
- [Chef vs Puppet vs Ansible vs Saltstack](https://vergaracarmona.es/chef-vs-puppet-vs-ansible-vs-saltstack/)
117119

118-
This final playlist listed above is where a lot of the code and ideas came from for this section, a great resource and walkthrough in video format.
120+
La última lista de reproducción mencionada anteriormente es de donde provienen gran parte del código e ideas de esta sección, es un recurso excelente con una guía en formato de video.
119121

120-
See you on [Day 67](day67.md)
122+
Nos vemos en el [Día 67](day67.md)

2022/es/Days/day67.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
## Using Roles & Deploying a Loadbalancer
1+
## Uso de Roles e Implementación de un Balanceador de Carga
22

3-
In the last session, we covered roles and used the `ansible-galaxy` command to help create our folder structures for some roles that we are going to use. We finished up with a much tidier working repository for our configuration code as everything is hidden away in our role folders.
3+
En la última sesión, cubrimos los roles y utilizamos el comando `ansible-galaxy` para crear las estructuras de carpetas para algunos roles que vamos a utilizar. Terminamos con un repositorio de trabajo mucho más ordenado para nuestro código de configuración, ya que todo está oculto en nuestras carpetas de roles.
44

5-
However, we have only used the apache2 role and have a working playbook3.yaml to handle our webservers.
5+
Sin embargo, solo hemos utilizado el rol apache2 y tenemos un playbook3.yaml funcional para manejar nuestros servidores web.
66

7-
At this point if you have only used `vagrant up web01 web02` now is the time to run `vagrant up loadbalancer` this will bring up another Ubuntu system that we will use as our Load Balancer/Proxy.
7+
En este momento, si solo has ejecutado `vagrant up web01 web02`, es hora de ejecutar `vagrant up loadbalancer`. Esto iniciará otro sistema Ubuntu que utilizaremos como nuestro balanceador de carga/proxy.
88

9-
We have already defined this new machine in our host's file, but we do not have the ssh key configured until it is available, so we need to also run `ssh-copy-id loadbalancer` when the system is up and ready.
9+
Ya hemos definido esta nueva máquina en nuestro archivo de hosts, pero no tenemos configurada la clave SSH hasta que esté disponible, así que también necesitamos ejecutar `ssh-copy-id loadbalancer` cuando el sistema esté listo.
1010

11-
### Common role
11+
### Rol common
1212

13-
I created at the end of yesterday's session the role of `common`, common will be used across all of our servers whereas the other roles are specific to use cases, now the applications I am going to install are as common as spurious and I cannot see many reasons for this to be the case but it shows the objective. In our common role folder structure, navigate to the tasks folder and you will have a main.yml. In this YAML, we need to point this to our install_tools.yml file and we do this by adding a line `- import_tasks: install_tools.yml` this used to be `include` but this is going to be depreciated soon enough so we are using import_tasks.
13+
Al final de la sesión de ayer, creé el rol common, que se utilizará en todos nuestros servidores, mientras que los otros roles son específicos para casos de uso. Ahora, las aplicaciones que voy a instalar son tan comunes como espurias y no veo muchas razones para que esto sea así, pero esto muestra el objetivo. En la estructura de carpetas del rol common, navega hasta la carpeta tasks y tendrás un archivo main.yml. En este archivo YAML, debemos apuntar a nuestro archivo install_tools.yml y lo hacemos agregando la línea `- import_tasks: install_tools.yml`. Anteriormente, esto se hacía con `include`, pero esto se depreciará lo suficiente pronto, por lo que estamos usando import_tasks.
1414

1515
```Yaml
1616
- name: "Install Common packages"
@@ -21,7 +21,7 @@ I created at the end of yesterday's session the role of `common`, common will be
2121
- figlet
2222
```
2323
24-
In our playbook, we then add in the common role for each host block.
24+
En nuestro playbook, luego agregamos el rol common para cada bloque de host.
2525
2626
```Yaml
2727
- hosts: webservers
@@ -37,11 +37,11 @@ In our playbook, we then add in the common role for each host block.
3737
3838
### nginx
3939
40-
The next phase is for us to install and configure nginx on our loadbalancer VM. Like the common folder structure, we have the nginx based on the last session.
40+
La siguiente fase es instalar y configurar nginx en nuestra máquina de balanceo de carga (loadbalancer). Al igual que la estructura de carpetas common, tenemos la carpeta nginx basada en la sesión anterior.
4141
42-
First of all, we are going to add a host block to our playbook. This block will include our common role and then our new nginx role.
42+
Primero, vamos a agregar un bloque de host a nuestro playbook. Este bloque incluirá nuestro rol common y luego nuestro nuevo rol nginx.
4343
44-
The playbook can be found here. [playbook4.yml](Days/../Configmgmt/ansible-scenario4/playbook4.yml)
44+
El playbook se puede encontrar aquí: [playbook4.yml](Days/../Configmgmt/ansible-scenario4/playbook4.yml)
4545
4646
```Yaml
4747
- hosts: webservers
@@ -61,23 +61,23 @@ The playbook can be found here. [playbook4.yml](Days/../Configmgmt/ansible-scena
6161
- nginx
6262
```
6363
64-
For this to mean anything, we have to define the tasks that we wish to run, in the same way, we will modify the main.yml in tasks to point to two files this time, one for installation and one for configuration.
64+
Para que esto signifique algo, debemos definir las tareas que deseamos ejecutar. De la misma manera, modificaremos el archivo main.yml en tasks para que apunte a dos archivos en esta ocasión, uno para la instalación y otro para la configuración.
6565
66-
There are some other files that I have modified based on the outcome we desire, take a look in the folder [ansible-scenario4](Days/Configmgmt/ansible-scenario4) for all the files changed. You should check the folders tasks, handlers and templates in the nginx folder and you will find those additional changes and files.
66+
Hay algunos otros archivos que he modificado en función del resultado que deseamos. Echa un vistazo a la carpeta [ansible-scenario4](Days/Configmgmt/ansible-scenario4) para ver todos los archivos modificados. Debes revisar las carpetas tasks, handlers y templates en la carpeta nginx, y encontrarás esos cambios y archivos adicionales.
6767
68-
### Run the updated playbook
68+
### Ejecutar el playbook actualizado
6969
70-
Since yesterday we have added the common role which will now install some packages on our system and then we have also added our nginx role which includes installation and configuration.
70+
Desde ayer, hemos agregado el rol common, que ahora instalará algunos paquetes en nuestro sistema, y también hemos agregado nuestro rol nginx, que incluye la instalación y configuración.
7171
72-
Let's run our playbook4.yml using the `ansible-playbook playbook4.yml`
72+
Ejecutemos nuestro playbook4.yml usando `ansible-playbook playbook4.yml`
7373

7474
![](Images/Day67_config1.png)
7575

76-
Now that we have our webservers and loadbalancer configured we should now be able to go to http://192.168.169.134/ which is the IP address of our loadbalancer.
76+
Ahora que hemos configurado nuestros servidores web y nuestro balanceador de carga, deberíamos poder acceder a http://192.168.169.134/, que es la dirección IP de nuestro balanceador de carga.
7777

7878
![](Images/Day67_config2.png)
7979

80-
If you are following along and you do not have this state then it could be down to the server IP addresses you have in your environment. The file can be found in `templates\mysite.j2` and looks similar to the below: You would need to update with your web server IP addresses.
80+
Si estás siguiendo los pasos y no tienes este resultado, podría deberse a las direcciones IP de los servidores que tienes en tu entorno. El archivo se puede encontrar en `templates\mysite.j2` y se ve similar al siguiente: Debes actualizarlo con las direcciones IP de tus servidores web.
8181

8282
```J2
8383
upstream webservers {
@@ -94,19 +94,20 @@ If you are following along and you do not have this state then it could be down
9494
}
9595
```
9696

97-
I am pretty confident that what we have installed is all good but let's use an ad-hoc command using ansible to check these common tools installation.
97+
Estoy bastante seguro de que lo que hemos instalado está todo bien, pero vamos a usar un comando ad-hoc con ansible para verificar la instalación de estas herramientas comunes.
9898

9999
`ansible loadbalancer -m command -a neofetch`
100100

101101
![](Images/Day67_config3.png)
102102

103-
## Resources
103+
## Recursos
104104

105105
- [What is Ansible](https://www.youtube.com/watch?v=1id6ERvfozo)
106106
- [Ansible 101 - Episode 1 - Introduction to Ansible](https://www.youtube.com/watch?v=goclfp6a2IQ)
107107
- [NetworkChuck - You need to learn Ansible right now!](https://www.youtube.com/watch?v=5hycyr-8EKs&t=955s)
108108
- [Your complete guide to Ansible](https://www.youtube.com/playlist?list=PLnFWJCugpwfzTlIJ-JtuATD2MBBD7_m3u)
109+
- [Chef vs Puppet vs Ansible vs Saltstack](https://vergaracarmona.es/chef-vs-puppet-vs-ansible-vs-saltstack/)
109110

110-
This final playlist listed above is where a lot of the code and ideas came from for this section, a great resource and walkthrough in video format.
111+
La lista de reproducción final mencionada anteriormente es de donde proviene gran parte del código y las ideas para esta sección, es un recurso excelente y una guía en formato de video.
111112

112-
See you on [Day 68](day68.md)
113+
Nos vemos en el [Día 68](day68.md)

0 commit comments

Comments
 (0)