2018-08-02 11:46:44 +02:00
|
|
|
# 2 - First Playbook
|
2018-07-30 14:12:49 +02:00
|
|
|
|
|
|
|
This exercise makes you write your first playbook from scratch. The playbook copy a file to several hosts.
|
|
|
|
|
|
|
|
## Playbook Creation
|
|
|
|
Create a new playbook, named `copy_file.yml`. This playbook must follow the given specs:
|
|
|
|
* Run on host group `lab`
|
|
|
|
* Copy the provided file `myFile.txt` in the `/tmp` folder of each host in the group
|
|
|
|
* Must use the `copy` module
|
|
|
|
|
|
|
|
## Validation
|
|
|
|
Run the playbook and make needed changes until your playbook run as needed.
|
|
|
|
|
|
|
|
To validate, run the following command. It should return an `ok` state for each host in the `lab` group:
|
|
|
|
```bash
|
|
|
|
ansible-playbook -i ../hosts solution/validate.yml
|
|
|
|
```
|
|
|
|
|
|
|
|
There is a working playbook in `solution/solution.yml`
|
|
|
|
|