During my last Ansible training the students needed to create some
Ansible templates for them selfs. As I do not want to run a testing
template against some, or all, machines under Ansible control I created
a small Ansible playbook to test templates.
---
#
# This playbook renders a template and shows the results
# Run this playbook with:
#
# ansible-playbook -e templ=<name of the template> template_test.yml
#
- hosts: localhost
become: false
connection: local
tasks:
- fail:
msg: "Bailing out. The play requires a template name (templ=...)"
when: templ is undefined
- name: do template
template:
src: "{{ templ }}"
dest: "/tmp/{{ templ }}"
- name: get template
command: cat "/tmp/{{ templ }}"
register: tmplt
- name: show template
debug:
msg: "{{ tmplt.stdout.split('\n') }}"
- name: remove template
file:
path: "/tmp/{{ templ }}"
state: absent
[Read More]Ansible @ Loadays
Posted on April 5, 2014
(Last modified on August 22, 2024)
| 1 minutes
| 132 words
| Ton Kersten
Last Saturday I attended Loadays in Antwerp,
Belgium.
After listening to Jan Piet Mens’s talk about Ansible, I was up for it.
At 11:30 sharp, I started my own presentation for an almost packed room.
It’s called Ansible, why and how I use it and you can find it on
SpeackerDeck.
It was a lovely talk, with a very knowledgeable crowd.
Please, have a look at it and if you have any questions, let me know.
[Read More]Ansible @ CfgMgmtCamp
Posted on February 5, 2014
(Last modified on August 22, 2024)
| 1 minutes
| 173 words
| Ton Kersten
Last couple of days I attended Configuration
Managememt Camp in Ghent, Belgium. On Monday morning we started of with
presentations of Mark Burgess (CFEngine), Luke Kanies (Puppet) and Adam
Jacob (Chef). Good talks about the future of things.
After lunch it got nerdy ans I joined the Ansible room, to see how
things went and at 17:00 I started my own presentation for a completely
packed room. It’s called `Ansible, why and how I use it' and you can
find it on
SpeackerDeck.
[Read More]Ansible Day in Antwerp
Posted on June 29, 2013
(Last modified on August 22, 2024)
| 2 minutes
| 287 words
| Ton Kersten
Today I’m attending the first full day
Ansible configuration meeting. This meeting
is in Antwerp, Belgium, a drive of almost 2 hours. Thanks to Multi Mho
(Maurice Verheesen) I didn’t need to drive, he wanted to try out his
nice, new car. It drives perfectly and we arrived about 30 minutes
early.
For a first meeting of a new tool there where a lot of attendants,
amongst others (and I don’t want to forget anybody, so I won’t even try
to give a complete list), but below are the people I think that where
there.
[Read More]Ansible issue playbook
Posted on November 23, 2012
(Last modified on August 22, 2024)
| 2 minutes
| 306 words
| Ton Kersten
Playing with Ansible I did get the idea to make a
nice welcome message when you log in to a server. This message needs to
be placed in a file, which is configured in /etc/ssh/sshd_config
with
the banner
option. I call this file /etc/issue
.
Of course I want to deploy this file with Ansible, so I first defined
an entry in the hosts
file. This looks like this:
# Settings for master
[master]
master
# Variables for master
[master:vars]
location=cow shed
room=ESX5i
issueremarks=This is the master Ansible server. Please be carefull!!
[Read More]