/etc/ansible/hosts
- Read more about /etc/ansible/hosts
- Log in to post comments
<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.ansible.sh";
echo "wget -q --no-check-certificate $URL -O - | bash -";
echo "
"; $c = curl_init(); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_URL, $URL); echo htmlspecialchars(curl_exec($c)); curl_close($c); echo "
";
?>
# Ansible playbook
https://github.com/panticz/ansible/tree/master/roles/ansible
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
Release and maintenance / latest versions
# stable
https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#release-status
# devel
https://docs.ansible.com/ansible/devel/modules/list_of_all_modules.html
Ansible playbook repository
https://github.com/panticz/ansible
Install Ansible
http://www.panticz.de/install-ansible
Configuration
https://docs.ansible.com/ansible/latest/reference_appendices/config.html#ansible-configuration-settings-locations
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
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
<?php
$URL="https://raw.githubusercontent.com/panticz/installit/master/install.openra.sh";
echo "wget $URL -O - | bash -s";
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 latest version
http://www.openra.net/download/
Installation
https://certbot.eff.org/
#sudo apt-get install -y software-properties-common
#sudo add-apt-repository -y ppa:certbot/certbot
sudo apt-get update
sudo apt-get install -y certbot
# Install certbot package with Ansible:
https://github.com/panticz/ansible/tree/master/roles/certbot
# create certificate and configure nginx
certbot --nginx -d www.example.com
create wildcard certificate
DOMAIN_NAME=lxc
DOMAIN_MAC=00:00:00:ef:11:cc
DOMAIN_RAM=2Gb
DOMAIN_HDD=128Gb
xen-create-image \
--hostname=${DOMAIN_NAME} \
--dist=xenial \
--lvm=vg1 \
--fs=ext4 \
--dhcp \
--pygrub \
--mac=${DOMAIN_MAC} \
--mirror=http://archive.ubuntu.com/ubuntu \
--size=${DOMAIN_HDD} \
--memory=${DOMAIN_RAM} \
--swap=${DOMAIN_RAM} \
--genpass=0 \
--password=t00r \
--vcpus $(cat /proc/cpuinfo | grep processor | wc -l)
mv /etc/xen/${DOMAIN_NAME}.cfg /etc/xen/${DOMAIN_NAME}
ln -s /etc/xen/${DOMAIN_NAME} /etc/xen/auto/12_lxc
mou
# processing Icinga warning Json list
PASSWORD=pass1234
URL="http://monitoring.example.com/cgi-bin/icinga/status.cgi?servicestatustypes=20&noheader=1&servicestatustypes=29&sorttype=2&sortoption=3&scroll=963&jsonoutput"
wget -q --user=${USER} --password=${PASSWORD} "${URL}" -O - | jq --raw-output ' .status.service_status[] | select(.host_name | contains("integration")) | select(.status_information | contains("Apache", "Java")) | .host_name'
jq 'select(.geo != null)' all.json