6th exercise: use facts

This commit is contained in:
Cedric Girard 2018-08-01 15:25:44 +02:00
parent efb254f2c5
commit d4525cdb07
3 changed files with 26 additions and 0 deletions

11
60.Facts/60.Facts.md Normal file
View File

@ -0,0 +1,11 @@
# 60 - Facts
This exercise makes you use facts to adapt content
## Playbook modification
Improve the playbook you created in the previous step to use the FQDN (*Fully Qualified Domain Name*) gathered as a fact instead of the inventory hostname.
## 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`

View File

@ -0,0 +1,10 @@
- hosts: lab
gather_facts: true
tasks:
- name: Deploy MOTD
template:
src: template/motd.j2
dest: /etc/motd
become: true
# vim: set ft=yaml sw=2 et:

View File

@ -0,0 +1,5 @@
/-----------------------------
Welcome to the ansible managed host: {{ ansible_fqdn }}
Please use Ansible playbooks instead of doing manual modifications on the system.
-----------------------------/