System Roles Flashcards

1
Q

Como se declara el folder de un rol

A

user.role

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

Ejemplos de rutas dentro de un folder de rol

A
defaults
    main.yml
files
handlers 
    main.yml
meta
    main.yml
tasks 
    main.yml
templates
tests 
    inventory
    test.yml
vars:
    main.yaml
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Como se define un role

En un playbook

A

—-

  • hosts: remote.example.com
    roles:
    - role1
    - role2
    var1: val1
    var2: val2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Ejemplo de pretasks y post task en un role

A
  • name: play
    hosts: remote.example.com
    pre_tasks:
    - debug:
    msg: ‘pre task’
    notify: my handler
    roles:
    - role1
    tasks:
    - debug:
    msg: ‘ first task ‘
    notify: my handlerpost_task:
      debug:  
          msg: ‘ post task ‘
      notify: my handler
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Cuales son los rhel System roles

A
rhel-system-roles.kdump
rhel-system-roles.network
rhel-system-roles.postfix
rhel-system-roles.selinux 
rhel-system-roles.timesync
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Como

Se instalan los system roles

A

yum install them-system-roles

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

En qué ruta se almacenan los system roles de ansible

A

/usr/share/ansible/roles

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

Comenta system roles por estado

A

kdump, Network, selinux, timesync - fully supported

Postfix - Tecnology preview

firewall, tuned - development

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

Donde está la documentación. De los roles

A

/usr/share/doc

Paquete rhel-system-roles/timesync/README.md

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

A qué inventarios se aplica group_vars

A

Al especificado por el archivo en este caso all

group_vars/all/timesync.yml

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

Como puedo ver un ejemplar de timezone role en la documentación

A

ansible-doc timezone| grep -A 4 “EXAMPLES”

  • name: set timezone
    timezone:
    name: Asia/Tokyo
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Como se muestran donde están los roles creados

A

ansible-config dump| grep -i roles

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

Cual es el comando para operaciones de roles

A

ansible-galaxy

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

Como se listan los roles

A

ansible-galaxy list

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

Como se crea un role

A

ansible-galaxy init user.gitlab

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

Como se despliega un role con ansible

A

ansible-galaxy install -r roles/requirements.yml -p roles

17
Q

Ejemplo de requirements.yml

A
  • src: geerlinguy.redis
    version: “1.5.0”
    name: redis_prod
18
Q

Ejemplos de repositorios

A

from git ssh

  • src: git@gitlab.com:guardianproject-ops/ansible-nginx-acme.git
    scm: git
    version: master
    name: nginx-acme-ssh
# from https 
- src: https://gitlab.com/guardianprojecr-ops/ansible-nginx-acme.git 
   scm: git
   versión: 56e00a54
   name: nginx-acme

from tar ball

  • src: file:///opt/local/roles/myrole.tar
    name: myrole
19
Q

Como se remueve un role con ansible galaxy

A

ansible-galaxy list

ansible-galaxy remove geeerlikgguy.ssh-chroot-jail

20
Q

Como se despliegan todos los roles con ansible galaxy

A

ansible-galaxy list -p roles

21
Q

Cual es el directorio de ansible-galaxy

A

HOME/role-galaxy/roles/student.bash_env

22
Q

Como se instala el role con ansible galaxy

A

ansible-galaxy install -r roles/requirements.yml -p roles

23
Q

Como se sobre escribe un role utilizando el mismo archivo requirements

A

ansible-galaxy install -r roles/requirements.yml —force -p roles