Geek · Things I've Learned

Ansible: Roles, Role Dependencies, and Variables

I just spent some time banging my head against Ansible, and thought I’d share in case anyone else runs across it: I have a Firefox role that allows you to define a Firefox profile with various plugins, config settings, and the like. And I have a work-from-home (WFH) role that, among other things, sets up… Continue reading Ansible: Roles, Role Dependencies, and Variables

Geek · Things I've Learned

Ansible: Running Commands in Dry-Run Mode in Check Mode

Say you have an Ansible playbook that invokes a command. Normally, that command executes when you run ansible normally, and doesn’t execute at all when you run ansible in check mode. But a lot of commands, like rsync have a -n or –dry-run argument that shows what would be done, without actually making any changes. So it… Continue reading Ansible: Running Commands in Dry-Run Mode in Check Mode

Geek

Disk Hack

One of the things I enjoy about Unix system administration is the McGyver aspect of it: when something goes pear-shaped, and your preferred tools aren’t available because they’re on the disk that just died, or on the other side of the pile of smoking ashes that used to be a router, you have to figure… Continue reading Disk Hack

Hacking · Things I've Learned

Bourne Shell Introspection

So I was thinking about how to refactor our custom Linux and Solaris init scripts at work. The way FreeBSD does it is to have the scripts in /etc/rc.d define variables with the commands to execute, e.g., start_cmd=’/usr/sbin/foobard’ stop_cmd=’kill `cat /var/run/foobar.pid`’ run_rc_command “$1″ where $1 is “start”, “stop”, or whatever, and run_rc_command is a function… Continue reading Bourne Shell Introspection