CLI

# fallback: install required python2 over SSH on remote machine
ansible example.com -i inventory -u root -m raw -a "apt-get update && apt-get install -y python-minimal"

# Ad-hoc commands
ansible all -i inventory.list -l localhost -u root -m ping
ansible all -s -m shell -a "hostname -f"
ansible all -s -m apt -a 'pkg=nginx state=installed update_cache=true'

# uptime
ansible all -i inventories/dev -l www -u root -a uptime

ansible all -m shell -a "apt-get update"
ansible www.example.com -m setup
ansible all -m setup -i inventory/example.com -u root > /tmp/example.com.inventory.$(da

Brother MFC-1910W

Install printer
<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/hardware/install.brother-mfc-1910w.sh";
echo "wget $URL -O - | bash -";
echo "

";
$c = curl_init();
curl_setopt($c, CURLOPT_URL, $URL);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
echo htmlspecialchars(curl_exec($c));
curl_close($c);
echo "

";
?>

Check for newer DEB packages
http://support.brother.com/g/b/downloadlist.aspx?c=as_ot&lang=en&prod=mfc1910w_eu_as&os=128

ansible.yml

cat < /etc/ansible/test.yml
---
- hosts: all
tasks:
- debug: msg="{{ ansible_user_id }}@{{ inventory_hostname }}"
EOF

---
- hosts:
srv.example.com
remote_user: ubuntu
become: yes
tasks:
- name: Update all packages
apt:
update_cache: yes
upgrade: dist

- name: Show command output
command: id
register: out
- debug: var=out.stdout_lines

- name: print to stdout
command: id
register: print
- debug: msg="{{ print.stdout }}"
- debug: msg="{{ print.stderr }}"

- hosts: all
# p

Icinga CLI

schedule a service check
HOST_NAME=www.example.com
SERVICE_NAME=APT
/usr/bin/printf "[%lu] SCHEDULE_FORCED_SVC_CHECK;%s;%s;%s\n" $(date +%s) "${HOST_NAME}" "${SERVICE_NAME}" $(date +%s) | tee -a "${NAGIOS_CMD_SOCKET}"

schedule a host check
NAGIOS_CMD_SOCKET=/var/lib/icinga/rw/icinga.cmd
/usr/bin/printf "[%lu] SCHEDULE_HOST_CHECK;%s;%s\n" \
$(date +%s) \
"host_name" \
$(date +%s) | tee -a $NAGIOS_CMD_SOCKET

iDRAC (DELL)

user: dell
pass: calvin

Key mapping for console redirection
Use the <1> key sequence for
Use the <2> key sequence for (System Setup)
Use the <3> key sequence for
Use the <0> key sequence for (Lifecycle Controller)
Use the key sequence for (Boot Manager)
Use the <@> key sequence for (PXE Boot)

Management
# install ipmitool package on client (OPTIONAL)
sudo apt-get install -y ipmitool

# connect over SOL (Serial over LAN)
ipmitool -I lanplus -H -U -P sol acti