Starting the poudriere role.

This commit is contained in:
Tom Alexander 2022-12-10 16:33:45 -05:00
parent 7de6bc9231
commit 2fdb47e1a1
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
9 changed files with 168 additions and 34 deletions

View File

@ -2,41 +2,42 @@
vars:
ansible_become: True
roles:
- sudo
# - sudo
- users
- package_manager
- zrepl
- zsh
- network
- sshd
- base
- firewall
- cpu
- ntp
- hosts
- build
- sound
- graphics
- gpg
- fonts
- alacritty
- sway
- emacs
- firefox
- devfs
- ssh_client
- sshfs
- jail
- fuse
- autofs
- exfat
- bhyve
- media
- kubernetes
- google_cloud_sdk
- ansible
- wireguard
- portshaker
# - package_manager
# - zrepl
# - zsh
# - network
# - sshd
# - base
# - firewall
# - cpu
# - ntp
# - hosts
# - build
# - sound
# - graphics
# - gpg
# - fonts
# - alacritty
# - sway
# - emacs
# - firefox
# - devfs
# - ssh_client
# - sshfs
# - jail
# - fuse
# - autofs
# - exfat
# - bhyve
# - media
# - kubernetes
# - google_cloud_sdk
# - ansible
# - wireguard
# - portshaker
- poudriere
- hosts: nat_dhcp:homeserver_nat_dhcp
vars:

View File

@ -0,0 +1,2 @@
dependencies:
- portshaker

View File

@ -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

View File

@ -0,0 +1,64 @@
#
# Get CPU type:
# sh -c "clang -v -fsyntax-only -march=native -x c /dev/null 2>&1 | grep -e '-target-cpu' | sed -e 's|.*-target-cpu \([[:alnum:]]*\) .*|\1|'"
#
# Check the CPU type:
# make -C /usr/src CPUTYPE=broadwell -V MACHINE_CPU
#
# Generate options file for ports
# poudriere options -j 12amd64 -p default -z stream -f /usr/local/etc/poudriere.d/12amd64-default-stream-pkglist
#
# Generate options file for specific ports
# poudriere options -j 12amd64 -p default -z stream -c lang/gcc48
#
# Build the packages
# poudriere bulk -j 12amd64 -p default -z stream -f /usr/local/etc/poudriere.d/12amd64-default-stream-pkglist
#
# List installed packages
# pkg query -e '%a = 0' '%o' | sort
- name: Install packages
package:
name:
- poudriere
- bash
- rsync
- flock
state: present
# - name: Create directories
# file:
# name: "{{ item }}"
# state: directory
# mode: 0755
# owner: root
# group: wheel
# loop:
# - /usr/ports/distfiles
# - /opt/poudriere/build_configs
# - /usr/local/poudriere/data/logs/bulk
# - name: Install Configuration
# copy:
# src: "files/{{ item.src }}"
# dest: "{{ item.dest }}"
# mode: 0600
# owner: root
# group: wheel
# loop:
# - src: poudriere.conf
# dest: /usr/local/etc/poudriere.conf
# - src: poudriere.key
# dest: /usr/local/etc/poudriere.d/poudriere.key
# - 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/

View File

@ -0,0 +1,21 @@
# - 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

View File

@ -0,0 +1,2 @@
- import_tasks: tasks/common.yaml
when: poudriere_builds is defined and poudriere_builds

View File

@ -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"'