Transscript Hostname into banner teskt into motd
roles:
- ansible-hostname-aschii
There are three varibles that can be set
- env - for environemnt (testing, develop, Pre-prod and Prod
- warn - a Warning messages
- note - What does this server do eg. This is a Jenkins/Travis server
Using the Vagrantfile to test, this is the inventory file generated
# Generated by Vagrant
figlet_cen ansible_host=192.168.121.19 ansible_port=22 ansible_user='vagrant' ansible_ssh_private_key_file='/home/sifungurux/Projekts/ansible-hostname-aschii/tests/.vagrant/machines/figlet_cen/libvirt/private_key' note='This is s figlet server running CentOS'
[PRODUCTION]
figlet_cen
[PRODUCTION:vars]
env=PRE-PRODUCTION
warn=This is a pre-prod server - Think about what you are doing and BE CAREFULL
Result
➜ vagrant ssh
Last login: Sat Mar 3 20:01:03 2018 from 192.168.121.1
__ _ _ _ ____ _
/ _(_) __ _| | ___| |_ / ___|___ _ __ | |_ ___ ___
| |_| |/ _` | |/ _ \ __|____| | / _ \ '_ \| __/ _ \/ __|
| _| | (_| | | __/ ||_____| |__| __/ | | | || (_) \__ \
|_| |_|\__, |_|\___|\__| \____\___|_| |_|\__\___/|___/
|___/
################################################################################################################
PRE-PRODUCTION - This is a pre-prod server - Think about what you are doing and BE CAREFULL
################################################################################################################
Remember the size of the warn. It can mess of the dynamic motd. Is not vertical flexible.