Ansible Flashcards

(19 cards)

1
Q

¿Dónde se guardan variables para un grupo de hosts en Ansible?

A

/etc/ansible/group_vars/<grupo></grupo>

ej: /etc/ansible/group_vars/labservers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

¿Cómo definir el usuario SSH en variables de Ansible?

A

ansible_ssh_user: root

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

¿Dónde se encuentra el archivo principal de configuración de Ansible?

A

/etc/ansible/ansible.cfg

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

¿Para qué sirve ansible.cfg?

A

Define la configuración global de Ansible.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

¿Cómo definir el inventario en ansible.cfg?

A

inventory = /etc/ansible/hosts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Formato básico de un grupo en el inventario de Ansible.

A

alias ansible_ssh_host=IP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

¿Cómo hacer un ping a todos los hosts con Ansible?

A

ansible all -m ping

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

¿Qué significa -m en Ansible?

A

Especifica el módulo que se quiere ejecutar

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

¿Cómo ejecutar un comando en todos los hosts con Ansible?

A

ansible all -a “comando”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

¿Qué módulo usa Ansible por defecto si no se especifica?

A

command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Ejemplo para ejecutar uname -a en todos los hosts.

A

ansible all -a “uname -a”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

¿Cómo ejecutar df -h usando el módulo shell?

A

ansible all -m shell -a “df -h”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

¿Para qué sirve -a en Ansible?

A

Permite pasar argumentos al módulo.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

¿Cómo instalar vim en todos los servidores con Ansible?

A

ansible all -m apt -a “name=vim”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

¿Qué módulo de Ansible se usa para instalar paquetes en Debian/Ubuntu?

A

apt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

¿Cómo crear un directorio con Ansible?

A

ansible all -m file -a “dest=/var/www/prueba state=directory mode=644”

17
Q

¿Qué módulo de Ansible gestiona archivos y directorios?

18
Q

¿Cómo ejecutar un playbook en Ansible?

A

ansible-playbook apache.yml

19
Q

¿Para qué sirve ansible-playbook?

A

Ejecuta playbooks de automatización en los servidores.