Schedule Boot And Process Flashcards

1
Q

Como funciona el módulo at

A
  • name: remove temp user
    at:
    command: userdel -r tempuser
    count: 20
    units: minutes
    unique: yes

script: execute script
state: present/ absent
unique: yes

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

Como funciona el cron module

A
  • name: name
    cron:
    name: “Flush Bolt”
    user: “root”
    minute: 45
    hour: 11
    job: “php ./app/nut cache:clear”

special_time: reboot, yearly, annually, monthly, weekly, daily, hourly
state: absent, present
cron_file: null
Backup: yes/no

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

Cuando se prefiere systemd vs service module

A

Cuando se realizan modificaciones a los servicios o init files por lo que se requieren modificaciones extra

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

Como se usa systemd module

A
  • daemon_reexec
  • daemon_reload
  • enabled
  • force
  • masked
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Como

Se usa el reboot module

A
  • name: “Reboot after patching”
    reboot:
    reboot_timeout: 180
  • name: force a quick reboot
    reboot:
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Como se usa el wait for module

A

wait_for:

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

Como
Se usa el
Shell
Module shell

A

shell: cat {{ myfile|quote }}

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

Como se usa el command module

A
  • name: this command
    command: /absolute/path/script_logs.py args1 args2
    args:
    chdir : scripts/
    creates: /path/to/script
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Como se obtiene el ambiente de ansible en facts

A
—-
- name: webservers 
   vars: 
       local_shell: “ {{ ansible_dev }}”
   tasks:
      - name: printing all the environment variables
         debug: 
            msg: “{{ local_shell }}”

U obtener por variable

{{ lookup(‘env’,’USER’,’HOME’, ‘SHELL’ }}”

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

Ejemplo de tarea de cron

A
  • name: cron tab
    cron:
    name: add date and time to a file
    minute: “*/2”
    hour: 9-16
    weekday: 1-5
    user: devops
    job: date&raquo_space; /home/devops/my_date_time_cron_job
    cron_file: add-date-time
    state: present
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Como se crea una liga suave de un archivo

A
  • name: default boot target
    file:
    src: /usr/lib/systemd/system/graphical.target
    dest: /etc/systemd/system/default.target
    state: link
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Como se usa el lvol module

A
  • name: resize volume group
    lvg:
    vg: vg1
    pvs: /dev/vdb1, /dev/vdc1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Como funciona el lvol para crear logical volumes

A
- name: Create logical Volume
   lvol:
       vg: vg1 
       lv: lv1
       size: 2g
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Como funciona el mount module

A
  • name: create xfs filesystem
    filesystem:
    fstype: xfs
    dev: /dev/vdb1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Como se mounta un dispositivo por uid

A
  • name:
    mount:
    path: /data
    src: UUID=hejdjdieodbz
    fstype: xfs
    state: present
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Como se monta un nfs con mount module

A
  • name: Montar nfs

mount: name=/nfsshare src=172.25.250.100:/share fstype=nfs opts=defaults,nobootwait dump=0 passno=2 state=mounted

17
Q

Crear swap con módulos

A
  • name: Create new swap VG
    lvg: vg=vgswap pvs=/dev/vda1 state=present
  • name: Create new swap LV
    lvol: vg=vgswap lv=lvswap size=10g
  • name: Format swap LV
    command: mkswap /dev/vgswap/lvswap
    when: ansible_swaptotal_mb < 128
  • name: Activate swap LV
    command: swapon /dev/vgswap/lvswap
    when: ansible_swaptotal_mb < 128
18
Q

Como se establece un filtro para obtener solo ansible_mounts de los facts de ansible

A

ansible webservers -m setup -a ‘filter=ansible_mounts’

19
Q

Como se llama el fact que contiene información de logical

Volúmens

A

ansible all -m setup -a “filter=ansible_lvm”