ansible-labs/050.Template/050.Template.md
2018-08-02 11:46:44 +02:00

25 lines
940 B
Markdown

# 5 - Template
This playbook makes you use Jinja templating to deploy custom motd.
## Template and Playbook Creation
First write a Jinja template file following the given specs:
* Contains the following content:
```
/-----------------------------
Welcome to the ansible managed host: <hostname>
Please use Ansible playbooks instead of doing manual modifications on the system.
-----------------------------/
```
* Ensure that you use the correct Jinja mechanism to allow replacement of `<hostname` by the corresponding value from the inventory (IP address is OK, depending of your host file).
Then write a playbook following the given specs:
* Run on host group `lab`
* Deploys the instantiated Jinja template file previously created to `/etc/motd`
## Validation
Run the playbook and then try to connect to each host to validate you see the customized banner on ssh connection.
There is a working playbook in `solution/solution.yml`