diff --git a/ansible/environments/vm/host_vars/poudrieremrmanager b/ansible/environments/vm/host_vars/poudrieremrmanager new file mode 100644 index 0000000..348014b --- /dev/null +++ b/ansible/environments/vm/host_vars/poudrieremrmanager @@ -0,0 +1,13 @@ +os_flavor: "freebsd" +poudriere_builds: + - jail: 13amd64 + ports: default + set: framework + version: 13.2-RELEASE + # - jail: current + # ports: default + # set: framework + # version: CURRENT + # revision: af01b4722577903f91acc44f01bdcb8cdb2d65ad + # kernel: CUSTOM + # branch: main diff --git a/ansible/environments/vm/hosts b/ansible/environments/vm/hosts index 33382d9..afaa022 100644 --- a/ansible/environments/vm/hosts +++ b/ansible/environments/vm/hosts @@ -1,2 +1,9 @@ [vm] poudriereodo ansible_user=builder ansible_host=10.213.177.12 +poudrieremrmanager ansible_user=root ansible_host=poudriere +# +# Put in ~/.ssh/config +# Host poudriere +# ProxyJump talexander@mrmanager +# HostName 10.215.1.203 +# diff --git a/ansible/playbook.yaml b/ansible/playbook.yaml index aadd389..02756c0 100644 --- a/ansible/playbook.yaml +++ b/ansible/playbook.yaml @@ -55,10 +55,12 @@ roles: - jail_nat_dhcp -- hosts: poudriereodo +- hosts: poudriereodo:poudrieremrmanager vars: ansible_become: True roles: + - sudo # for poudboot script + - fstab - portshaker - poudriere diff --git a/ansible/roles/base/meta/main.yaml b/ansible/roles/base/meta/main.yaml new file mode 100644 index 0000000..44e74e2 --- /dev/null +++ b/ansible/roles/base/meta/main.yaml @@ -0,0 +1,2 @@ +dependencies: + - fstab diff --git a/ansible/roles/base/tasks/freebsd.yaml b/ansible/roles/base/tasks/freebsd.yaml index 5edd441..c0a464e 100644 --- a/ansible/roles/base/tasks/freebsd.yaml +++ b/ansible/roles/base/tasks/freebsd.yaml @@ -84,37 +84,6 @@ state: absent when: rc_conf is not defined -- name: Add fstab entries - mount: - name: "{{ item.dst }}" - src: "{{ item.src }}" - fstype: "{{ item.fstype }}" - opts: "{{ item.opts }}" - state: present - loop: - - dst: /tmp - src: tmpfs - fstype: tmpfs - opts: rw,mode=777 - - dst: /var/run - src: tmpfs - fstype: tmpfs - opts: rw,mode=755 - -- name: Add fstab entries - when: efi_dev is defined - mount: - name: "{{ item.dst }}" - src: "{{ item.src }}" - fstype: "{{ item.fstype }}" - opts: "{{ item.opts }}" - state: present - loop: - - dst: /boot/efi - src: "{{ efi_dev }}" - fstype: msdosfs - opts: rw - - name: Install scripts copy: src: "files/{{ item.src }}" diff --git a/ansible/roles/fstab/tasks/common.yaml b/ansible/roles/fstab/tasks/common.yaml new file mode 100644 index 0000000..fef1101 --- /dev/null +++ b/ansible/roles/fstab/tasks/common.yaml @@ -0,0 +1,15 @@ +- import_tasks: tasks/freebsd.yaml + when: 'os_flavor == "freebsd"' + +- import_tasks: tasks/linux.yaml + when: 'os_flavor == "linux"' + +- include_tasks: + file: tasks/peruser.yaml + apply: + become: yes + become_user: "{{ initialize_user }}" + when: users is defined + loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}" + loop_control: + loop_var: initialize_user diff --git a/ansible/roles/fstab/tasks/freebsd.yaml b/ansible/roles/fstab/tasks/freebsd.yaml new file mode 100644 index 0000000..9b5cc70 --- /dev/null +++ b/ansible/roles/fstab/tasks/freebsd.yaml @@ -0,0 +1,31 @@ +- name: Add fstab entries + mount: + name: "{{ item.dst }}" + src: "{{ item.src }}" + fstype: "{{ item.fstype }}" + opts: "{{ item.opts }}" + state: present + loop: + - dst: /tmp + src: tmpfs + fstype: tmpfs + opts: rw,mode=777 + - dst: /var/run + src: tmpfs + fstype: tmpfs + opts: rw,mode=755 + +- name: Add fstab entries + when: efi_dev is defined + mount: + name: "{{ item.dst }}" + src: "{{ item.src }}" + fstype: "{{ item.fstype }}" + opts: "{{ item.opts }}" + state: present + loop: + - dst: /boot/efi + src: "{{ efi_dev }}" + fstype: msdosfs + opts: rw + diff --git a/ansible/roles/fstab/tasks/linux.yaml b/ansible/roles/fstab/tasks/linux.yaml new file mode 100644 index 0000000..43ba876 --- /dev/null +++ b/ansible/roles/fstab/tasks/linux.yaml @@ -0,0 +1,29 @@ +# - name: Build aur packages +# register: buildaur +# become_user: "{{ build_user.name }}" +# command: "aurutils-sync --no-view {{ item }}" +# args: +# creates: "/var/cache/pacman/custom/{{ item }}-*.pkg.tar.*" +# loop: +# - foo + +# - name: Update cache +# when: buildaur.changed +# pacman: +# name: [] +# state: present +# update_cache: true + +# - name: Install packages +# package: +# name: +# - foo +# state: present + +# - name: Enable services +# systemd: +# enabled: yes +# name: "{{ item }}" +# daemon_reload: yes +# loop: +# - foo.service diff --git a/ansible/roles/fstab/tasks/main.yaml b/ansible/roles/fstab/tasks/main.yaml new file mode 100644 index 0000000..6805b9d --- /dev/null +++ b/ansible/roles/fstab/tasks/main.yaml @@ -0,0 +1,2 @@ +- import_tasks: tasks/common.yaml + # when: foo is defined diff --git a/ansible/roles/fstab/tasks/peruser.yaml b/ansible/roles/fstab/tasks/peruser.yaml new file mode 100644 index 0000000..111e886 --- /dev/null +++ b/ansible/roles/fstab/tasks/peruser.yaml @@ -0,0 +1,29 @@ +- include_role: + name: per_user + +# - name: Create directories +# file: +# name: "{{ account_homedir.stdout }}/{{ item }}" +# state: directory +# mode: 0700 +# owner: "{{ account_name.stdout }}" +# group: "{{ group_name.stdout }}" +# loop: +# - ".config/foo" + +# - name: Copy files +# copy: +# src: "files/{{ item.src }}" +# dest: "{{ account_homedir.stdout }}/{{ item.dest }}" +# mode: 0600 +# owner: "{{ account_name.stdout }}" +# group: "{{ group_name.stdout }}" +# loop: +# - src: foo.conf +# dest: .config/foo/foo.conf + +- import_tasks: tasks/peruser_freebsd.yaml + when: 'os_flavor == "freebsd"' + +- import_tasks: tasks/peruser_linux.yaml + when: 'os_flavor == "linux"' diff --git a/ansible/roles/fstab/tasks/peruser_freebsd.yaml b/ansible/roles/fstab/tasks/peruser_freebsd.yaml new file mode 100644 index 0000000..e69de29 diff --git a/ansible/roles/fstab/tasks/peruser_linux.yaml b/ansible/roles/fstab/tasks/peruser_linux.yaml new file mode 100644 index 0000000..e69de29 diff --git a/ansible/roles/portshaker/files/portshaker.conf b/ansible/roles/portshaker/files/portshaker.conf index 0f92d26..7b7f1b8 100644 --- a/ansible/roles/portshaker/files/portshaker.conf +++ b/ansible/roles/portshaker/files/portshaker.conf @@ -5,4 +5,5 @@ mirror_base_dir="/var/cache/portshaker" ports_trees="main" main_ports_tree="/usr/local/portshaker/trees/main" -main_merge_from="freebsd myrepo" +# main_merge_from="freebsd myrepo" +main_merge_from="freebsd" diff --git a/ansible/roles/poudriere/files/poudriere.conf b/ansible/roles/poudriere/files/poudriere.conf index 8b0e368..885ac70 100644 --- a/ansible/roles/poudriere/files/poudriere.conf +++ b/ansible/roles/poudriere/files/poudriere.conf @@ -10,15 +10,16 @@ # poudriere. # #ZPOOL=zroot -ZPOOL=zroot +# ZPOOL=zroot ### NO ZFS # To not use ZFS, define NO_ZFS=yes #NO_ZFS=yes +NO_ZFS=yes # root of the poudriere zfs filesystem, by default /poudriere # ZROOTFS=/poudriere -ZROOTFS=/poudriere +# ZROOTFS=/poudriere # the host where to download sets for the jails setup # You can specify here a host or an IP @@ -196,7 +197,7 @@ PARALLEL_JOBS=1 # If set, failed builds will save the WRKDIR to ${POUDRIERE_DATA}/wrkdirs # SAVE_WRKDIR=yes -# Choose the default format for the workdir packing: could be tar,tgz,tbz,txz +# Choose the default format for the workdir packing: could be tar,tgz,tbz,txz,tzst # default is tbz # WRKDIR_ARCHIVE_FORMAT=tbz WRKDIR_ARCHIVE_FORMAT=txz diff --git a/ansible/roles/poudriere/files/poudriere.d/13amd64-default-framework-make.conf b/ansible/roles/poudriere/files/poudriere.d/13amd64-default-framework-make.conf index 38a4330..770e0ce 100644 --- a/ansible/roles/poudriere/files/poudriere.d/13amd64-default-framework-make.conf +++ b/ansible/roles/poudriere/files/poudriere.d/13amd64-default-framework-make.conf @@ -6,10 +6,8 @@ # # Example from bottom of /usr/share/examples/etc/make.conf .if ${.CURDIR:N*/lang/gcc48*} && ${.CURDIR:N*/lang/gcc10*} && ${.CURDIR:N*/textproc/ripgrep*} && ${.CURDIR:N*/www/firefox*} -# Disabling tigerlake optimizations because qemu's TCG does not support avx512 -# -#CPUTYPE?=tigerlake -CPUTYPE?=x86-64-v3 +CPUTYPE?=tigerlake +#CPUTYPE?=x86-64-v3 .endif OPTIMIZED_CFLAGS=YES BUILD_OPTIMIZED=YES diff --git a/ansible/roles/poudriere/files/poudriere.d/13amd64-default-framework-pkglist b/ansible/roles/poudriere/files/poudriere.d/13amd64-default-framework-pkglist new file mode 100644 index 0000000..78ee554 --- /dev/null +++ b/ansible/roles/poudriere/files/poudriere.d/13amd64-default-framework-pkglist @@ -0,0 +1,131 @@ +archivers/unrar +archivers/unzip +archivers/zip +audio/mixertui +databases/sqlite3 +deskutils/xdg-desktop-portal +devel/git +devel/gmake +devel/hs-ShellCheck +devel/libccid +devel/libnotify +devel/py-black +devel/py-isort +devel/py-jmespath +devel/py-ptvsd +devel/py-yamllint +devel/pyenv +dns/coredns +editors/emacs +editors/mg +ftp/wget +graphics/drm-kmod +graphics/evince +graphics/gimp +graphics/graphviz +graphics/igt-gpu-tools +graphics/imv +graphics/inkscape +graphics/qt5-wayland +graphics/vulkan-loader +graphics/vulkan-tools +graphics/vulkan-validation-layers +lang/python +lang/rust-nightly +math/gnuplot +multimedia/libva-intel-driver +multimedia/libva-intel-media-driver +multimedia/libva-utils +multimedia/libvdpau-va-gl +multimedia/mpv +multimedia/pwcview +multimedia/v4l_compat +multimedia/v4l-utils +multimedia/vdpauinfo +multimedia/webcamd +multimedia/wf-recorder +net-mgmt/arpscan +net-mgmt/ipcalc +net/google-cloud-sdk +net/rsync +net/tcpdump +net/wireguard +net/wlvncc +ports-mgmt/pkg +ports-mgmt/pkg-provides +ports-mgmt/portshaker +ports-mgmt/poudriere +print/texlive-full +security/doas +security/git-crypt +security/gnupg +security/libfido2 +security/openvpn +security/pcsc-tools +security/pinentry +security/pinentry-qt5 +security/sops +security/sudo +security/u2f-devd +shells/bash +shells/zsh +sysutils/ansible +sysutils/ansible-sshjail +sysutils/bhyve-firmware +sysutils/btop +sysutils/ddrescue +sysutils/dsbmd +sysutils/exfat-utils +sysutils/flock +sysutils/fusefs-exfat +sysutils/fusefs-simple-mtpfs +sysutils/fusefs-sshfs +sysutils/helm +sysutils/htop +sysutils/kubectl +sysutils/lscpu +sysutils/lsof +sysutils/moreutils +sysutils/ncdu +sysutils/nvme-cli +sysutils/powermon +sysutils/pstree +sysutils/pv +sysutils/rust-coreutils +sysutils/tmux +sysutils/tree +sysutils/zrepl +textproc/aspell +textproc/colordiff +textproc/en-aspell +textproc/gsed +textproc/jq +textproc/kdiff3 +textproc/py-pygments +textproc/ripgrep +www/firefox +x11-fm/pcmanfm +x11-fonts/cascadia-code +x11-fonts/noto +x11-fonts/noto-emoji +x11-fonts/noto-extra +x11-fonts/source-sans-ttf +x11-fonts/sourcecodepro-ttf +x11-wm/sway +x11/alacritty +x11/grim +x11/kanshi +x11/mako +x11/slurp +x11/swaybg +x11/swayidle +x11/swaylock +x11/waybar +x11/wev +x11/wlogout +x11/wofi +x11/wtype +x11/xauth +x11/xdg-desktop-portal-wlr +x11/xeyes +x11/xhost diff --git a/ansible/roles/poudriere/tasks/freebsd.yaml b/ansible/roles/poudriere/tasks/freebsd.yaml index 5675cc0..2a83c36 100644 --- a/ansible/roles/poudriere/tasks/freebsd.yaml +++ b/ansible/roles/poudriere/tasks/freebsd.yaml @@ -37,7 +37,7 @@ owner: root group: wheel loop: - # - /usr/ports/distfiles + - /usr/ports/distfiles - /opt/poudriere/build_configs - /usr/local/poudriere/data/logs/bulk @@ -56,15 +56,15 @@ # - src: poudriere_deploy_ed25519 # dest: /usr/local/etc/poudriere.d/poudriere_deploy_ed25519 -# - name: Install Configuration directory -# copy: -# src: "files/{{ item.src }}" -# dest: "{{ item.dest }}" -# owner: root -# group: wheel -# loop: -# - src: poudriere.d -# dest: /usr/local/etc/ +- name: Install Configuration directory + copy: + src: "files/{{ item.src }}" + dest: "{{ item.dest }}" + owner: root + group: wheel + loop: + - src: poudriere.d + dest: /usr/local/etc/ - name: Install scripts copy: diff --git a/ansible/run.bash b/ansible/run.bash index e7f43a9..0a80592 100755 --- a/ansible/run.bash +++ b/ansible/run.bash @@ -28,6 +28,8 @@ elif [ "$target" = "jail_homeserver_nat_dhcp" ]; then ansible-playbook -v -i environments/jail playbook.yaml --diff --limit homeserver_nat_dhcp "${@}" elif [ "$target" = "vm_poudriereodo" ]; then ansible-playbook -v -i environments/vm playbook.yaml --diff --limit poudriereodo "${@}" +elif [ "$target" = "vm_poudrieremrmanager" ]; then + ansible-playbook -v -i environments/vm playbook.yaml --diff --limit poudrieremrmanager "${@}" elif [ "$target" = "mrmanager" ]; then ansible-playbook -v -i environments/colo playbook.yaml --diff --limit mrmanager "${@}" elif [ "$target" = "jail_mrmanager_nat_dhcp" ]; then