Core components Flashcards

1
Q

Inventories

A
how Ansible can locate and run against multiple systems.
Inventories are list of hosts
Can be formatted in ini or yaml
1. ini
mail.example.com
[webservers]
rale.example.com
dale.example.com
[dbservers]
db[1:4].example.com
  1. ## yamlall:
    hosts:
    mail.example.com:
    children:
    webservers:
    hosts:
    rail.example.com:
    dale.example.com:
    dbservers:
    hosts:
    db[1:4].example.com:
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Modules

A

Tools for particular tasks

Modules take parameters and return json response

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

Variables

A

Should contain letters, numbers and underscores
Should start with letter
Can be scoped by a group, host, playbook

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

Facts

A

Provide certain info about a given target host
Facts are discovered by Ansible aoutomatically when it reaches out to a host
Facts gathering can be disabled
ansible -i ansible/inventory.yaml host6.example.com -m setup
=> output will be collection of facts represented

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

Plays

A

To map a group of hosts to some well-defined roles

A play may use one or more modules to achieve a desired state on a group of hosts

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

Playbooks

A

Series of plays

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

Config files

A

Locations in order processing:

  1. ANSIBLE_CONFIG (an env var)
  2. ansible.cfg (in the current dir)
  3. .ansible.cfg (in home dir hidden file)
  4. /etc/ansible/ansible.cfg (master config)

Some commonly used settings:
ansible_managed
forks
inventory

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