Troubleshooting Ansible Flashcards

1
Q

Como

Se encuentra la ruta de log de ansible

A

ansible-config dump| grep -i log

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

Como se establece la ruta de log

A

En archivo ansible.cfg

log_path=logs/ansible.log

mkdir -v logs
touch logs/ansible.log

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

Como se colocan diferentes grados de debug en ansible

A

ansible-playbook -vvvv play.yml

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

Como le decimos al ansible control node que mantenga los Python scripts a ejecutar en los hosts

A

export ANSIBLE_KEEP_REMOTES_FILES=1

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

Como se agrega verbose de 4 a un playbook com debug module

A
  • shell: /usr/bin/uptime
    register: result
  • debug:
    var: result
    verbosity: 4
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Como se ejecuta un playbook en pasos

A

ansible-playbook NAME —step

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

Como se puede iniciar en una tarea en específico

A

ansible-playbook intranet.yml —start-at-task=“firewalld enabled and running”

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

Como se realiza un smoke test de ansible

A

ansible-playbook NAME.yml —check

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

Como se realiza un smoke test desde playbook

A

tasks:
- name: task always in check mode
shell: uname -a
check-mode: yes

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

Para que sirve —diff en ansible

A

Te dice que cambios se harían en tus nodos manejados en uso con tus templares

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

Como funciona el módulo script

A

Si retorna 0 continúa y es correcto de lo contrario significa error

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

Como válidas con el

Módulo assert

A

tasks:

- name: check if file exists
   stat:  
       path: /var/run/app.lock
    register: lock

- name: 
   assert:  
      that:  
         - not lock.stat.exists
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Como se válida con respecto a una url

A
tasks:
    - uri: http://api.myapp.com
           return_content: yes
       register: apiresponse
    - fail:
       msg: ‘versión was not provided’
       When: “‘version’ not in apiresponse.content”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Como funciona el módulo Ping

A

ansible host -m ping

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