One to read: Testing Ansible roles with Molecule

One to read: “Testing Ansible roles with Molecule”

This is a good brief summary of Molecule – the default testing product for Ansible (it’s now a product that the Ansible project maintains). This post also makes reference to TestInfra which is another project I need to look in to.

TestInfra really is the more interesting piece (although Molecule is interesting too), because it’s how you check exactly what is on a host. Here’s an example snippet of code (from the front page of that site’s documentation):

def test_passwd_file(host):
    passwd = host.file("/etc/passwd")
    assert passwd.contains("root")
    assert passwd.user == "root"
    assert passwd.group == "root"
    assert passwd.mode == 0o644


def test_nginx_is_installed(host):
    nginx = host.package("nginx")
    assert nginx.is_installed
    assert nginx.version.startswith("1.2")


def test_nginx_running_and_enabled(host):
    nginx = host.service("nginx")
    assert nginx.is_running
    assert nginx.is_enabled

See how easily this clearly defines what your server should look like – it’s got a file called /etc/passwd owned by root with specific permissions, and that the file contains the word root in it, likewise there is a package called nginx installed at version 1.2 and also it’s running and enabled… all good stuff, particularly from an infrastructure-as-code perspective. Now, I just need to go away and test this stuff with more diverse backgrounds than just a stock Ubuntu machine :)

One to read: The Marketing Ivory Tower Trap cartoon | Marketoonist | Tom Fishburne

One to read: “The Marketing Ivory Tower Trap cartoon | Marketoonist | Tom Fishburne”

As marketers, it’s easy to lose touch with what consumers and customers actually experience with our brands. In the bubble of our marketing offices, writing strategy decks and brand architecture documents, we sometimes over-inflate the role our brands play in peoples’ lives.

via The Marketing Ivory Tower Trap cartoon | Marketoonist | Tom Fishburne

I find that most brands are like this nowadays…

 

 

This was automatically posted from my RSS Reader, and may be edited later to add commentary.