Rundeck Ansible Plugin

https://github.com/Batix/rundeck-ansible-plugin

https://github.com/Batix/rundeck-ansible-plugin/releases/latest

wget https://github.com/Batix/rundeck-ansible-plugin/releases/download/2.0.2/ansible-plugin-2.0.2.jar -P /var/lib/rundeck/libext/

* Create a new project
http:///resources/createProject

Project Name: Ansible
Default Node Executor: "Ansible Ad-Hoc Node Executor"
Executable: /bin/bash
SSH Connection > SSH Authentication: privateKey

Default Node File Copier
SSH Connection: privateKey

apt-get install ansible

Rundeck (Job Scheduler and Runbook Automation)

Ansible role
https://github.com/panticz/ansible/tree/master/roles/rundeck
https://github.com/panticz/ansible/blob/master/rundeck.example.com.yml

# install
wget http://dl.bintray.com/rundeck/rundeck-deb/rundeck-2.7.1-1-GA.deb -P /tmp
sudo dpkg -i /tmp/rundeck-2.7.1-1-GA.deb
sudo /etc/init.d/rundeckd start

# Admin
http://localhost:4440/user/login;jsessionid=16lnsilhg9n6x38a090agwe8y
admin/admin

# configuration (global)
/etc/rundeck/framework.properties

# add user
echo "foo:bar,user,devops" >> /etc/rundeck/realm.properties

# acl

Ansible snippets

- name: set default value
  debug:
    msg: "{{ foo | default('bar') }}"
 
# check if directory exists
- block:
  - name: Remove default configuration
    file:
      state: absent
      path: /etc/icinga/objects
    when: check_path.stat.exists == false
 
  - name: Deploy configuration
    git:
      repo: git@git.example.com:foo/icinga.git
      dest: /etc/icinga/objects
      accept_hostkey: yes
    notify: icinga restart
 
  when: check_path.stat.exists == false
 
- name: Directory exists already
  debug:
    msg: "Do something else..."
  when: check_path.stat.exists

Debian / Ubuntu mass dist-upgrade with Ansible (with fallback and logging)

ansible-playbook dist-upgrade.yml -i your_inventory [-l host_name]

---
- hosts:
    all
  gather_facts: no
  vars:
    verbose: false
    log_dir: "log/dist-upgrade/{{ inventory_hostname }}"
  pre_tasks:
    - block:
        - setup:
      rescue:
        - name: "Install required python-minimal package"
          raw: "apt-get update && apt-get install -y --force-yes python-apt python-minimal"
        - setup:
  tasks:
    - name: Update packages
      apt:
        update_cache: yes
        upgrade: dist
        autoremove: yes
      register: output

    - name: Check changes
      set_fact:
        updated: true
      when: not output.stdout | search("0 upgraded, 0 newly installed")

    - name: Display changes
      debug:
        msg: "{{ output.stdout_lines }}"
      when: verbose or updated is defined

    - block:
      - name: "Create log directory"
        file:
          path: "{{ log_dir }}"
          state: directory
        changed_when: false

      - name: "Write changes to logfile"
        copy:
          content: "{{ output.stdout }}"
          dest: "{{ log_dir }}/dist-upgrade_{{ ansible_date_time.iso8601 }}.log"
        changed_when: false

      when: updated is defined
      connection: local

webix

datatable
# reload from external source
datatable1.clearAll();
datatable1.load(grida.config.url);

Webix Remote
http://docs.webix.com/desktop__webix_remote_php.html - Webix Remote with PHP

# pass paramter to remote funtion
var result = webix.remote.function1(foo, bar);

# show return value from remote function as webix message
var result = webix.remote.MyClass.select(val1);
result.then((data) => webix.message("msg:" + data));

send data
# post
webix.ajax().post("post.php", {foo:bar});

Webix Jet

ZFS filesystem on Linux

boot Ubuntu 16.04 LiveCD
terminal
sudo apt-get install -y ssh
sudo passwd ubuntu
ip a

SSH login to Ubuntu LiveCD
ssh ubuntu@

sudo su

apt-add-repository universe
apt update

apt install -y debootstrap zfs-initramfs

# rmove previous ZFS pool
zpool export rpool

DEVICES="
/dev/disk/by-id/ata-TOSHIBA_DT01ACA200_938457298
/dev/disk/by-id/ata-TOSHIBA_DT01ACA200_9D0JN9VR4
"

for DEVICE in ${DEVICES}; do
zpool labelclear -f ${DEVICE}
parted -s -- ${DEVICE} mklabel gpt
sgdisk -a1 -n2:40:2047 -t2:EF02 ${DEVICE}

DRBD


# cat /etc/drbd.d/global_common.conf
global {
usage-count yes;
}

common {
startup {
degr-wfc-timeout 0;
}

net {
cram-hmac-alg sha1;
shared-secret ****************;
}

disk {
on-io-error detach;
}
}

# cat /etc/drbd.d/r0.res
resource r0 {
on scld.sedo.de.intern {
volume 0 {
device /dev/drbd0;
disk /dev/vg0/lvol0;
flexible-meta-disk internal;
}
address 192.168.255.1:7788;
}
on ubuntu {
volume 0 {
device /dev/drbd0;
disk /dev/sda3;
flexible-meta-disk internal;
}
address 192.168.255.2:7788;
}

dnsmasq

# cat /etc/dnsmasq.conf
dhcp-authoritative
server=192.168.1.6

log-facility=/var/log/dnsmasq.log
log-queries

local=/example.com/
domain=example.com

# cat /etc/dnsmasq.conf | grep "^dhcp-host" | awk -v OFS="\t" -F "," '{print $3, $2}' | sort -k2 > /etc/hosts.pre
addn-hosts=/etc/hosts.pre

# DHCP
dhcp-range=192.168.1.150,192.168.1.200,255.255.255.0,1d
dhcp-option=option:router,192.168.1.6
dhcp-option=option:ntp-server,217.7.239.199

# PXE
dhcp-boot=pxelinux.0,srv,192.168.1.9
dhcp-boot=net:sip,http://srv/snom3x0/snom3x0.xml,srv,192.168.1.9

Syndicate content