Add 57 new questions and exercises

This commit is contained in:
abregman
2021-08-13 09:23:50 +03:00
parent 6e01886e6b
commit 3b05d95256
27 changed files with 1981 additions and 242 deletions

View File

@ -0,0 +1,6 @@
## Ansible - My First Playbook
1. Write a playbook that will:
a. Install the package zlib
b. Create the file `/tmp/some_file`
2. Run the playbook on a remote host

View File

@ -0,0 +1,3 @@
## Ansible - My First Task
1. Write a task to create the directory /tmp/new_directory

View File

@ -0,0 +1,28 @@
## My first playbook - Solution
1. `vi first_playbook.yml`
```
- name: Install zlib and create a file
hosts: some_remote_host
tasks:
- name: Install zlib
package:
name: zlib
state: present
become: yes
- name: Create the file /tmp/some_file
path: '/tmp/some_file'
state: touch
```
2. First, edit the inventory file: `vi /etc/ansible/hosts`
```
[some_remote_host]
some.remoted.host.com
```
Run the playbook
`ansible-playbook first_playbook.yml`

View File

@ -0,0 +1,8 @@
## My First Task - Solution
```
- name: Create a new directory
file:
path: "/tmp/new_directory"
state: directory
```