part 1 Flashcards

1
Q

what is ansible?

A

Ansible is an open-source automation tool used for managing and configuring computers. In simple terms, it’s like a remote control that allows you to easily set up, manage, and deploy software on multiple machines from a single point

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

what is a configuration file in ansible?

A

In Ansible, a configuration file is a file where you specify settings and parameters to control the behavior of Ansible. This file is usually named ansible.cfg

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

what is the default location of the ansible.cfg file?

A

/etc/ansible/ansible.cfg

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

what is the hierarchy in which ansible searches for the configuration file?

A
  • ANSIBLE_CONFIG (environment variable): If the ANSIBLE_CONFIG environment variable is set, Ansible will use the file specified by this variable.
  • ansible.cfg (in the current directory): If no environment variable is set, Ansible will look for a file named ansible.cfg in the directory where the Ansible command is run.
  • .ansible.cfg (in the home directory): If no configuration file is found in the current directory, Ansible will look for a file named .ansible.cfg in the home directory of the user running the command.
  • /etc/ansible/ansible.cfg: As a last resort, Ansible will use the global configuration file located at /etc/ansible/ansible.cfg.

-

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

what is the command to view which configuration file you’re currently using?

A

ansible-config view

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

In what file does ansible store information about the target servers?

A

inventory file

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

what are variables in ansible?

A

Variables in Ansible are used to store values that can be reused throughout your playbooks, roles, and tasks.

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

what are the different ways you can define a variable?

A
  • in the inventory file
  • in a playbook
  • in a variable file
  • in roles
    etc….
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how do you use a variable in ansible?

A

{{variable name}}

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

what is this {{ }} called ?

A

jinja2 templating

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

what are the different kinds of variables in ansible?

A
  • string
  • numbers
  • boolean
  • list (holds multiple string values)
  • dictionary (holds a collection of key value pairs)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what are facts in ansible?

A

In Ansible, facts are pieces of information about the remote systems that are automatically collected by the setup module when a playbook is run.

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

what are some common facts ansible gathers about the target server?

A

network Information: IP addresses, network interfaces, etc.

System Information: Hostname, OS type, architecture, etc.

ansible_hostname
ansible_os_family
ansible_architecture
Hardware Information: CPU, memory, disks, etc.

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

all facts gathered by ansible are stored in ?

A

a variable called ansible_facts

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

what is an ansible playbook?

A

An Ansible playbook is a YAML file that defines a series of tasks to be executed on remote hosts.

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