web2 - new web and blog machine

guest os: FreeBSD / amd64

cpu: 2

memory size: 2048 MB

storage: file - 10 GB

tmux commands: ls - list session, attach - t ,

tmux keys: ctrl-B command key, ctrl-b i information, ctrl-b t time, ctrl-b d detach,

back to virtual machines page.

Links

local links: c2, vm3,

Work log

2021-07-27: vtbd0p3 - I see lots of these messages in /var/log/messages:

Jul 27 00:18:07 web2 ddclient[3764]: WARNING:  found neither ipv4 nor ipv6 address
Jul 27 00:18:08 web2 syslogd: last message repeated 1 times
Jul 27 00:38:11 web2 syslogd: last message repeated 1 times
Jul 27 01:08:13 web2 syslogd: last message repeated 1 times
Jul 27 01:08:15 web2 syslogd: last message repeated 1 times
Jul 27 01:28:15 web2 syslogd: last message repeated 1 times

all the time, not sure why. The machine still has FreeBSD 11.4-release-p11:

root@web2:~ # freebsd-version -ku
11.4-RELEASE-p9
11.4-RELEASE-p11

2021-06-20: from c2 - install ansible on the machine

tingo@kg-core2$ pwd
/home/tingo/personal/projects/2020/ansible_fbsd/infrastructure_home

bootstrap ansible

tingo@kg-core2$ ansible-playbook --become-method su --ask-become-pass fbsd-bootstrap.yml -l web2
BECOME password:

PLAY [all] ******************************************************************************************************

TASK [pkg bootstrap] ********************************************************************************************
changed: [web2]

TASK [pkg update] ***********************************************************************************************
changed: [web2]

TASK [install python and sudo] **********************************************************************************
changed: [web2]

TASK [set up wheel group to have passwordless sudo] *************************************************************
changed: [web2]

PLAY RECAP ******************************************************************************************************
web2                       : ok=4    changed=4    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

nice - using python3 meta package worked nicely

tingo@kg-core2$ ansible -m ping web2
web2 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/local/bin/python3.7"
    },
    "changed": false,
    "ping": "pong"
}

test ok, try some facts

tingo@kg-core2$ ansible -m setup web2
web2 | SUCCESS => {
    "ansible_facts": {
        "ansible_all_ipv4_addresses": [
            "10.1.150.43"
        ],
        "ansible_all_ipv6_addresses": [],
        "ansible_apparmor": {
            "status": "disabled"
        },
        "ansible_architecture": "amd64",
        "ansible_bios_date": "NA",
        "ansible_bios_vendor": "NA",
        "ansible_bios_version": "NA",
        "ansible_board_asset_tag": "NA",
        "ansible_board_name": "NA",
        "ansible_board_serial": "NA",
        "ansible_board_vendor": "NA",
        "ansible_board_version": "NA",
        "ansible_chassis_asset_tag": "NA",
        "ansible_chassis_serial": "NA",
        "ansible_chassis_vendor": "NA",
        "ansible_chassis_version": "NA",
        "ansible_date_time": {
            "date": "2021-06-20",
            "day": "20",
            "epoch": "1624220367",
            "hour": "22",
            "iso8601": "2021-06-20T20:19:27Z",
            "iso8601_basic": "20210620T221927053110",
            "iso8601_basic_short": "20210620T221927",
            "iso8601_micro": "2021-06-20T20:19:27.053110Z",
            "minute": "19",
            "month": "06",
            "second": "27",
            "time": "22:19:27",
            "tz": "CEST",
            "tz_dst": "CEST",
            "tz_offset": "+0200",
            "weekday": "Sunday",
            "weekday_number": "0",
            "weeknumber": "24",
            "year": "2021"
        },
        "ansible_default_ipv4": {
            "address": "10.1.150.43",
            "broadcast": "10.1.255.255",
            "device": "vtnet0",
            "flags": [
                "UP",
                "BROADCAST",
                "RUNNING",
                "PROMISC",
                "SIMPLEX",
                "MULTICAST"
            ],
[.. snipped ..]
        "ansible_distribution": "FreeBSD",
        "ansible_distribution_major_version": "11",
        "ansible_distribution_release": "11.4-RELEASE-p9",
        "ansible_distribution_version": "11.4",
[.. snipped ..]
        "ansible_nodename": "web2.kg4.no",
        "ansible_os_family": "FreeBSD",
        "ansible_pkg_mgr": "pkgng",
[.. snipped ..]
        "ansible_python_version": "3.7.10",
[.. snipped ..]
        "discovered_interpreter_python": "/usr/local/bin/python3.7",
[.. snipped ..]

ok, so it just installed python 3.7 anyway. Probably because pkg uses the quarterly repository

tingo@kg-core2$ ansible -m raw -a "pkg -vv | grep url" web2
web2 | CHANGED | rc=0 >>
    url             : "pkg+http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly",
Shared connection to web2.kg4.no closed.

yes, that is the reason.

2021-06-20: web2 - vtbd0p3 - freebsd-update (I should get this into ansible too) fetch

root@web2:~ # freebsd-update fetch
[..]
The following files will be updated as part of updating to
11.4-RELEASE-p11:
[..]
/usr/share/zoneinfo/Pacific/Fiji
/usr/share/zoneinfo/zone.tab

install

root@web2:~ # freebsd-update install
src component not installed, skipped
Installing updates...Scanning //usr/share/certs/blacklisted for certificates...
Scanning //usr/share/certs/trusted for certificates...
 done.

After a reboot, FreeBSD 11.4-release-p11 is in

root@web2:~ # freebsd-version -ku
11.4-RELEASE-p9
11.4-RELEASE-p11

kernel

root@web2:~ # uname -a
FreeBSD web2.kg4.no 11.4-RELEASE-p9 FreeBSD 11.4-RELEASE-p9 #0: Tue Apr  6 09:27:45 UTC 2021     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

ok

2021-06-20: from vm3 - install FreeBSD 11.4-release on it.

root@kg-vm3# vm install web2 FreeBSD-11.4-RELEASE-amd64-disc1.iso
Starting web2
  * found guest in /zs/vms/web2
  * booting...

followed by

root@kg-vm3# vm console web2

(install normally, GPT , guided partitioning, change swap to 1 GB, name the vm, add a dhcp-client-identifier (and remember to update isc-dhcpd and named on the gw) then reboot the machine) I also had to fix up my dns (named) setup, I had an alias (CNAME) for web2 in there, so I removed that.

vm info for web2

root@kg-vm3# vm info web2
------------------------
Virtual Machine: web2
------------------------
  state: running (63728)
  datastore: default
  loader: bhyveload
  uuid: cdd4afdb-d1f8-11eb-8bb3-600292b5cd2c
  uefi: default
  cpu: 2
  memory: 2048M
  memory-resident: 88260608 (84.171M)

  console-ports
    com1: tmux/web2

  network-interface
    number: 0
    emulation: virtio-net
    virtual-switch: public
    fixed-mac-address: 58:9c:fc:07:36:06
    fixed-device: -
    active-device: tap5
    desc: vmnet-web2-0-public
    mtu: 1500
    bridge: vm-public
    bytes-in: 689918 (673.748K)
    bytes-out: 23211 (22.666K)

  virtual-disk
    number: 0
    device-type: file
    emulation: virtio-blk
    options: -
    system-path: /zs/vms/web2/disk0.img
    bytes-size: 10737418240 (10.000G)
    bytes-used: 1136984064 (1.058G)

ok

2021-06-20: from vm3 - create a new vm with 2 cpus, 2048M memory and 10G disk, name it web2

root@kg-vm3# vm create -m 2048M -c 2 -s 10G web2