Skip to content

Commit 4e05b9d

Browse files
author
abregman
committed
Add a couple of Ansible questions
1 parent ee6c25e commit 4e05b9d

File tree

1 file changed

+52
-4
lines changed

1 file changed

+52
-4
lines changed

README.md

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,6 +2109,11 @@ Ansible is:
21092109
* Agent-less
21102110
* Minimal run requirements (Python & SSH) and simple to use
21112111
* Default mode is "push" (it supports also pull)
2112+
* Focus on simpleness and ease-of-use
2113+
</b></details>
2114+
2115+
<details>
2116+
<summary>What kind of automation you wouldn't do with Ansible and why?</summary><br><b>
21122117
</b></details>
21132118

21142119
<details>
@@ -2118,6 +2123,7 @@ An inventory file defines hosts and/or groups of hosts on which Ansible tasks ex
21182123

21192124
An example of inventory file:
21202125

2126+
```
21212127
192.168.1.2
21222128
192.168.1.3
21232129
192.168.1.4
@@ -2126,6 +2132,7 @@ An example of inventory file:
21262132
190.40.2.20
21272133
190.40.2.21
21282134
190.40.2.22
2135+
```
21292136
</b></details>
21302137

21312138
<details>
@@ -2138,7 +2145,10 @@ spun up and shut down, without you tracking every change in these sources.
21382145
</b></details>
21392146

21402147
<details>
2141-
<summary>You want to run Ansible playbook only on specific minor version of your OS, how would you achieve that?</summary><br><b>
2148+
<summary>How do you list all modules and how can you see details on a specific module?</summary><br><br>
2149+
2150+
1. Ansible online docs
2151+
2. `ansible-doc -l` for list of modules and `ansible [module_name]` for detailed information on a specific module
21422152
</b></details>
21432153

21442154
<details>
@@ -2147,11 +2157,15 @@ spun up and shut down, without you tracking every change in these sources.
21472157
```
21482158
- name: Create a new directory
21492159
file:
2150-
path: "/tmp/new_directory"
2151-
state: directory
2160+
path: "/tmp/new_directory"
2161+
state: directory
21522162
```
21532163
</b></details>
21542164

2165+
<details>
2166+
<summary>You want to run Ansible playbook only on specific minor version of your OS, how would you achieve that?</summary><br><b>
2167+
</b></details>
2168+
21552169
<details>
21562170
<summary>What would be the result of the following play?</summary><br><b>
21572171

@@ -2169,10 +2183,28 @@ spun up and shut down, without you tracking every change in these sources.
21692183
When given a written code, always inspect it thoroughly. If your answer is “this will fail” then you are right. We are using a fact (ansible_hostname), which is a gathered piece of information from the host we are running on. But in this case, we disabled facts gathering (gather_facts: no) so the variable would be undefined which will result in failure.
21702184
</b></details>
21712185

2186+
<details>
2187+
<summary>What would be the result of running the following task?
2188+
2189+
```
2190+
- hosts: localhost
2191+
tasks:
2192+
- name: Install zlib
2193+
package:
2194+
name: zlib
2195+
state: present
2196+
```
2197+
</summary><br><b>
2198+
</b></details>
2199+
21722200
<details>
21732201
<summary>Which Ansible best practices are you familiar with?. Name at least three</summary><br><b>
21742202
</b></details>
21752203

2204+
<details>
2205+
<summary>Explain the directory layout of an Ansible role</summary><br><b>
2206+
</b></details>
2207+
21762208
<details>
21772209
<summary>Write a playbook to install ‘zlib’ and ‘vim’ on all hosts if the file ‘/tmp/mario’ exists on the system.</summary><br><b>
21782210

@@ -2263,7 +2295,19 @@ A full list can be found at the link above. Also, note there is a significant di
22632295
</b></details>
22642296

22652297
<details>
2266-
<summary>What is ansible-pull? How it’s different compared to ansible-playbook?</summary><br><b>
2298+
<summary>What is ansible-pull? How is it different from how ansible-playbook works?</summary><br><b>
2299+
</b></details>
2300+
2301+
<details>
2302+
<summary>What is Ansible Vault?</summary><br><b>
2303+
</b></details>
2304+
2305+
<details>
2306+
<summary>Demonstrate each of the following with Ansible:
2307+
2308+
* Conditionals
2309+
* Loops
2310+
</summary><br><b>
22672311
</b></details>
22682312

22692313
<a name="ansible-advanced"></a>
@@ -2282,6 +2326,10 @@ def cap(self, string):
22822326
</code>
22832327
</b></details>
22842328

2329+
<details>
2330+
<summary>You would like to run a task only if previous task changed anything. How would you achieve that?</summary><br><b>
2331+
</b></details>
2332+
22852333
<details>
22862334
<summary>How do you test your Ansible based projects?</summary><br><b>
22872335
</b></details>

0 commit comments

Comments
 (0)