Skip to content

James Carr - Rants and Musings of an Agile Developer
Syndicate content James Carr - Medium
Random observations in technology, parenthood and life - Medium
Updated: 4 hours 36 min ago

A Read-Eval-Print Loop for Ansible

Thu, 02/23/2017 - 04:40

One must have tool for any language is the availability of a REPL to quickly check out the syntax of an API or test out an idea really quick. Ansible is no different, especially since sometimes you might have a very long running playbook and it may be difficult to wait for it to run before discovering you had the syntax for something off at the end.

Luckily, ansible comes with the lesser known ansible-console command. You can use this to execute any one of the modules included in ansible to roughly test something out and can run it against a local or remote host.

vagrant@monitor:~$ ansible-console localhost
[WARNING]: Host file not found: /etc/ansible/hosts
[WARNING]: provided hosts list is empty, only localhost is available
Welcome to the ansible console.
Type help or ? to list commands.
vagrant@localhost (1)[f:5]$ setup
# very long json of facts omitted
vagrant@localhost (1)[f:5]$ debug msg=”distribution version reversed is {{ ansible_distribution_version | reverse }}”
localhost | SUCCESS => {
“msg”: “distribution version reversed is 40.41”
}

You can also run ad-hoc commands on the machine through it as well.

vagrant@localhost (1)[f:5]$ ls /tmp
localhost | SUCCESS | rc=0 >>
ansible_busvWC
vagrant-ansible
vagrant-shell

This also doubles as an easy cheap REPL for jinja2 as well if you need to test some jinja2 syntax out.

A Read-Eval-Print Loop for Ansible was originally published in James Carr on Medium, where people are continuing the conversation by highlighting and responding to this story.

Categories: Blogs

Let America Be America Again

Thu, 02/02/2017 - 17:06

With this month being Black History Month as well as today being Langston Hughes’ birthday I thought it’d be appropriate to share one of his greatest poems that is as relevant now as it was then.

I first read this during my freshmen year in college (amongst the rest of his poetry) and the passages below really hooked me in.

Say, who are you that mumbles in the dark?
And who are you that draws your veil across the stars?I am the poor white, fooled and pushed apart,
I am the Negro bearing slavery’s scars.
I am the red man driven from the land,
I am the immigrant clutching the hope I seek — 
And finding only the same old stupid plan
Of dog eat dog, of mighty crush the weak.I am the young man, full of strength and hope,
Tangled in that ancient endless chain
Of profit, power, gain, of grab the land!
Of grab the gold! Of grab the ways of satisfying need!
Of work the men! Of take the pay!
Of owning everything for one’s own greed!I am the farmer, bondsman to the soil.
I am the worker sold to the machine.
I am the Negro, servant to you all.
I am the people, humble, hungry, mean — 
Hungry yet today despite the dream.
Beaten yet today — O, Pioneers!
I am the man who never got ahead,
The poorest worker bartered through the years.

Enjoy!

Let America Be America Again

Let America Be America Again was originally published in James Carr on Medium, where people are continuing the conversation by highlighting and responding to this story.

Categories: Blogs