Ansible Redfish module

# redfish_facts module
Documentation: https://docs.ansible.com/ansible/latest/modules/redfish_facts_module.html
Git: https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/remote_management/redfish/redfish_facts.py
local: /usr/lib/python2.7/dist-packages/ansible/modules/remote_management/redfish/redfish_facts.py
 
# redfish_utils library
Git: https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/redfish_utils.py
local: /usr/lib/python2.7/dist-packages/ansible/module_utils/redfish_utils.py
 
 
#!/usr/bin/env ansible-playbook
 
---
- hosts: localhost
  vars:

Migrate LXC container to LXD (with ZFS storage)

CONTAINER_NAME=www

lxc-stop -n ${CONTAINER_NAME}
lxc launch ubuntu:18.04 ${CONTAINER_NAME} -c security.privileged=true
lxc stop ${CONTAINER_NAME}
lxc config set ${CONTAINER_NAME} boot.autostart true
zfs mount tank/lxd/containers/${CONTAINER_NAME}
mv /var/lib/lxd/containers/${CONTAINER_NAME}/rootfs{,.org}
rsync -av --numeric-ids /var/lib/lxc/${CONTAINER_NAME}/rootfs /var/lib/lxd/containers/${CONTAINER_NAME}/
mv /var/lib/lxd/containers/${CONTAINER_NAME}/rootfs/dev{,.org}

OpenStack: Octavia LoadBalancer

Create Amphora image
apt install -y python-pip git qemu qemu-utils debootstrap kpartx
pip install diskimage-builder
git clone https://review.openstack.org/p/openstack/octavia
cd octavia
./diskimage-create/diskimage-create.sh

Upload Amphora image
openstack image create --container-format bare --disk-format qcow2 --private --file amphora-x64-haproxy.qcow2 --tag amphora amphora
openstack image set --protected amphora
openstack image list --long

Configure OpenStack

OpenStack: Horizon

Configure start page
# /etc/kolla/horizon/custom_local_settings
# /etc/kolla/config/dev/horizon/custom_local_settings (kolla-ansible override)
HORIZON_CONFIG["user_home"] = "/project"

Links
https://docs.openstack.org/horizon/latest/contributor/ref/horizon.html
https://docs.openstack.org/mitaka/config-reference/dashboard/config-options.html

iLO - IPMI on HP servers

Ansilbe hpilo_facts
http://docs.ansible.com/ansible/latest/hpilo_facts_module.html
https://downloads.linux.hpe.com/SDR/keys.html

Latest firmware
http://pingtool.org/latest-hp-ilo-firmwares/
https://support.hpe.com/hpesc/public/home/driverHome?sp4ts.oid=1009143853
# download "RECOMMENDED * Online ROM Flash Component for Linux - HPE Integrated Lights-Out"

# flash iLo firmware (local)
yes | ./CP036949.scexe

# remote iLo firmware flash (broken)
./CP036949.scexe --unpack=/tmp

Nginx (proxy) Docker container

Create required directories
mkdir -p /etc/docker/nginx/{conf.d,html}

Configure nginx as webserver
cat < /etc/docker/nginx/conf.d/default.conf
server {
listen 80;
server_name _;

root /usr/share/nginx/html;
index index.html index.htm;
}
EOF

Configure nginx as proxy
cat < /etc/docker/nginx/conf.d/proxy.conf
server {
listen 80;
server_name foo.example.com;

location / {
proxy_pass http://localhost:8080/;
}
}
EOF

Create container

Roundcube Docker container

Start container
docker run --name=roundcube \
-e ROUNDCUBEMAIL_DEFAULT_HOST=imap.example.com \
-e ROUNDCUBEMAIL_SMTP_SERVER=smtp.example.com \
-e ROUNDCUBEMAIL_SMTP_PORT=993 \
-p 8080:80 \
-d roundcube/roundcubemail

# UI
http://SERVER_IP:8080/

Links
https://hub.docker.com/r/roundcube/roundcubemail/

netdata

Docker
docker run -d --name=netdata \
-p 8080:19999 \
-v /proc:/host/proc:ro \
-v /sys:/host/sys:ro \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
--cap-add SYS_PTRACE \
--security-opt apparmor=unconfined \
netdata/netdata

# URL
http://SERVER_IP:8080

Links
https://github.com/netdata/netdata

OpenStack: Cleanup project

# Delete VM
openstack server list --project=test-project --os-cloud=dev
openstack server delete test-project-vm

# Delete floating IP
openstack floating ip list --project=test-project --os-cloud=dev
openstack floating ip delete 1.2.3.4

# Delete router
openstack router list --project=test-project --os-cloud=dev
openstack subnet list --project=test-project --os-cloud=dev
openstack router remove subnet test-project-router test-project-subnet
openstack router delete test-project-router

# Delete subnet
openstack subnet list --project=test-project --os-cloud=dev

Syndicate content