fedora 29 and lxc

sudo dnf install lxc lxc-templates
sudo vim /etc/sysconfig/lxc-net

USE_LXC_BRIDGE="true"

sudo vim /etc/lxc/lxc-usernet

username veth lxcbr0 10

sudo systemctl enable --now lxc-net.service
lxc-create -t download -n mycontainer -- -d ubuntu -r bionic -a amd64
lxc-start -n mycontainer
lxc-attach -n mycontainer

Juniper LACP PXE

chassis {
  aggregated-devices {
    ethernet {
      device-count 12;
    }
  }
  auto-image-upgrade;
}

interfaces {                            
  ge-0/0/0 {
    ether-options {
      802.3ad {
        lacp {
          force-up;
        }
        ae0;
      }
    }
  }
  ge-0/0/1 {
    ether-options {
      802.3ad ae0;
    }
  }
  ae0 {                               
    mtu 9000;
    aggregated-ether-options {
      lacp {
        passive;
      }
    }
    unit 0 {
      family ethernet-switching {
        port-mode trunk;
        vlan {
          members [ MGMT STORAGE VXLAN ];
        }
        native-vlan-id MAAS;
      }
    }
  }
}

vlans {
  MAAS {
    description "Metal as a Service";
    vlan-id 1;
  }
  MGMT {
    description "Openstack: mgmt";
    vlan-id 2;
  }
  STORAGE {
    description "Openstack: storage";
    vlan-id 3;
  }
  VXLAN {
    description "Openstack: vxlan";
    vlan-id 4;
  }
}

netplan.yml

You might think of editing /etc/netplan/50-cloud-init.yaml, but why would you when /etc/cloud/cloud.cfg.d/50-curtin-networking.cfg fucks you over?

network:
  version: 2
  ethernets:
    eth0:
      match:
        macaddress: 52:54:00:46:d6:b3
      mtu: 9000
      set-name: eth0
    eth1:
      match:
        macaddress: 52:54:00:ba:da:c5
      mtu: 9000
      set-name: eth1
  bonds:
    bond0:
      interfaces:
        - eth0
        - eth1
      parameters:
        down-delay: 0
        lacp-rate: slow
        mii-monitor-interval: 100
        mode: 802.3ad
        transmit-hash-policy: layer2
        up-delay: 0
  bridges:
    br-maas:
      interfaces:
        - bond0.1
      addresses:
        - 172.16.1.1/24
      parameters:
        forward-delay: 15
        stp: false
    br-mgmt:
      interfaces:
        - bond0.2
      addresses:
        - 172.16.2.1/24
      parameters:
        forward-delay: 15
        stp: false
  vlans:
    bond0.1:
      id: 1
      link: bond0
    bond0.2:
      id: 2
      link: bond0
    bond0.12:
      id: 12
      link: bond0
      mtu: 1500
      addresses:
        - 10.0.0.30/24
      gateway4: 10.0.0.254

Fedora 27 network bridge vlan

I’m connecting VM’s to two nets, but I have only one physical interface on the host. So VLAN comes into play. I put my eth0 under the control of my bridge “external”, I create a vlan interface eth0.4 and put it under br-maas. Here’s a quick writeup on the files, as most examples/tutorials from others include a bunch of settings that really aren’t needed.

#/etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
BRIDGE=br-external
#/etc/sysconfig/network-scripts/ifcfg-external
TYPE=Bridge
DEVICE=br-external
ONBOOT=yes
BOOTPROTO=dhcp
#/etc/sysconfig/network-scripts/ifcfg-eth0.4
TYPE=Vlan
DEVICE=eth0.4
VLAN=yes
ONBOOT=yes
BOOTPROTO=none
BRIDGE=br-maas
#/etc/sysconfig/network-scripts/ifcfg-maas
TYPE=Bridge
DEVICE=br-maas
ONBOOT=yes
BOOTPROTO=none

#IPADDR=172.16.0.33
#NETMASK=255.255.255.0

Now you can connect your VMs to the bridges, and optionally add an IP for the host to access the net as well.

Apple Configuration Profile Reference

Configuration Profile Reference

There’s a lot of stuff you can do automagically.

<plist>
<dict>
  <key>PayloadContent<key>
  <array>
    <dict>
      <key>PayloadType</key>
      <string>com.apple.wifi.managed</string>
      <key>PayloadVersion</key>
      <string>1</string>
    </dict>
    <dict>
      <key>PayloadType</key>
      <string>com.apple.wifi.managed</string>
      <key>PayloadVersion</key>
      <string>1</string>
      ...
    </dict>
  </array>

  <key>PayloadDescription</key>
  <string>Conform your Apple product to Example Corporation</string>

  <key>PayloadDisplayName</key>
  <string>Example Corporation Configuration</string>

  <key>PayloadIdentifier</key>
  <string>com.example.macos</string>

  <key>PayloadOrganization</key>
  <string>Example Corporation</string>

  <key>PayloadUUID</key>
  <string>12345678-90ab-cdef-1234-567890abcdef</string>
<!--
  <key>PayloadRemovalDisallowed</key>
  <false/>
-->
  <key>PayloadType</key>
  <string>Configuration</string>

  <key>PayloadVersion</key>
  <integer>1</integer>
<!--
  <key>PayloadScope</key>
  <string>System</string>

  <key>RemovalDate</key>
  <date>2018-03-08T12:00:00Z</date>

  <key>ConsentText</key>
  <dict>
    <key>en</key>
    <string>English</string>
    <key>jp</key>
    <string>日本語</string>
    <key>no</key>
    <string>Norsk</string>
  </dict>
-->
</dict>
</plist>

 

Automating OpenLDAP install on Debian/Ubuntu

If you install slapd from the commandline you’ll be prompted with a bunch of questions. If you install via some automation tool however, the story becomes a little different. There’s no prompt to input stuff the stuff setup needs, and you really don’t want to be prompted anyways. So… Let’s find all options available for this package.

debconf-get-selections | grep slapd

slapd slapd/password1 password
slapd slapd/internal/generated_adminpw password
slapd slapd/password2 password
slapd slapd/internal/adminpw password
# Potentially unsafe slapd access control configuration
slapd slapd/unsafe_selfwrite_acl note
slapd slapd/dump_database_destdir string /var/backups/slapd-VERSION
slapd slapd/move_old_database boolean true
slapd slapd/domain string
slapd slapd/invalid_config boolean true
slapd slapd/no_configuration boolean false
slapd slapd/password_mismatch note	
# Do you want the database to be removed when slapd is purged?
slapd slapd/purge_database boolean false
slapd slapd/allow_ldap_v2 boolean false
slapd slapd/backend select MDB
slapd slapd/dump_database select when needed
slapd slapd/upgrade_slapcat_failure error
slapd shared/organization string

All these “zany” options. Which ones are needed?

DEBCONF_DEBUG=developer dpkg-reconfigure --frontend=noninteractive slapd 2>/tmp/debug.log

DEBCONF_DEBUG=developer dumps debug code to stderr, which we cleverly dump to /tmp/debug.log. Scanning through that log we see

debconf (developer): <-- INPUT medium slapd/no_configuration
debconf (developer): --> 30 question skipped
debconf (developer): <-- INPUT medium slapd/domain
debconf (developer): --> 30 question skipped
debconf (developer): <-- INPUT medium shared/organization
debconf (developer): --> 30 question skipped
debconf (developer): <-- INPUT high slapd/password1
debconf (developer): --> 30 question skipped
debconf (developer): <-- INPUT high slapd/password2
debconf (developer): --> 30 question skipped
debconf (developer): <-- INPUT low slapd/backend
debconf (developer): --> 30 question skipped
debconf (developer): <-- INPUT low slapd/purge_database
debconf (developer): --> 30 question skipped
debconf (developer): <-- INPUT low slapd/move_old_database
debconf (developer): --> 30 question skipped
debconf (developer): <-- INPUT medium slapd/allow_ldap_v2
debconf (developer): --> 30 question skipped

Set these options before you install slapd.

Ansible example

- name: set slapd install options
  shell: "echo \"{{ item }}\" | debconf-set-selections"
  with_items:
    - slapd slapd/no_configuration boolean false
    - slapd slapd/domain string slipsprogrammor.no
    - slapd shared/organization string Slips AS
    - slapd slapd/password1 password adminpass
    - slapd slapd/password2 password adminpass
    - slapd slapd/backend select MDB
    - slapd slapd/purge_database boolean false
    - slapd slapd/move_old_database boolean true
    - slapd slapd/allow_ldap_v2 boolean false

- name: install packages
  package:
    name: "{{ item }}"
  with_items:
    - slapd
    - ldap-utils

cobbler and python development

Do yourself a favor and install virtualenvwrapper

pip install --user virtualenvwrapper

insert this into your .bashrc

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/src
source $HOME/.local/bin/virtualenvwrapper.sh

Create your own personal fork of cobbler on github, then clone that one and add a remote for cobbler

git clone https://github.com/eb4x/cobbler.git
cd cobbler/
git config --global user.name "Erik Berg"
git config user.email "c...@slipsprogrammor.no"
git remote add cobbler https://github.com/cobbler/cobbler.git
git fetch cobbler
git pull cobbler master
git branch mynewfeature

mkvirtualenv cobbler
workon cobbler

The dumbest Microserver yet.

I’ve owned a N40L, I still own and love my Gen8, and recently acquired two Gen10.

This thing has no remote management. NONE.

I installed drives into the drive-bays and it just hangs at post with a code 92 in the bottom right screen. I contacted HPE support. Told me to get HPE drives, as anything else was unsupported. Seriously? Turns out the drives had SMART disabled. So I had to boot the server up from usb, “hot-install” the drives, turn SMART on with “smartctl -s on /dev/sdX”, and hey presto, it boots.

I have the serial number, product code, country of purchase, yet with all that information I’m not able to register my product so I can get that sweet “entitlement” of BIOS/Firmware updates.

I’m probably gonna go with Supermicro for future servers.