Ansible tidbit: can I use the environment parameter on a block?

Ansible - environment variable in block

I’ve noticed that when trying to look for Ansible-specific issues or questions, the official documentation usually comes up first, even if it doesn’t answer the question at all. So I’ve decided to write a blog post each time I’ve had to spend time finding an answer to my own question.

To see my other tidbits, just check the Ansible tidbits category.

So… Can I use the environment parameter on an Ansible block?

Answer: Yes. You can totally do this:

tasks:
  - name: Run these tasks with these environment variables
    environment:
      SOME_ENVIRONMENT_VARIABLE: some value

    block:
      - name: some task that uses the env var
        ...

Each task in the block will see and use your environment variables just fine.

There’s not really anything more to say, but really, do you need any more information than this? 🙂

[Unfinished] SpheRun game launcher

SpheRun0.1-02

2013

SpheRun binaries

An old launcher GUI for a game engine called Sphere. Made using NW.js, which uses the Node API to allow people to create desktop applications using web technology. I never finished it, but it was a nice exercise in HTML, CSS and general GUI design.

Looking back at it, I realize how much I’ve grown in making appealing graphical designs… Practice makes perfect, I suppose!