Add a role for portshaker.
This commit is contained in:
parent
5675f317dd
commit
7de6bc9231
@ -53,3 +53,7 @@ sway_conf_files:
|
|||||||
wireguard_directory: odo
|
wireguard_directory: odo
|
||||||
enabled_wireguard:
|
enabled_wireguard:
|
||||||
- wgh
|
- wgh
|
||||||
|
poudriere_builds:
|
||||||
|
- jail: current
|
||||||
|
ports: default
|
||||||
|
set: framework
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
- google_cloud_sdk
|
- google_cloud_sdk
|
||||||
- ansible
|
- ansible
|
||||||
- wireguard
|
- wireguard
|
||||||
|
- portshaker
|
||||||
|
|
||||||
- hosts: nat_dhcp:homeserver_nat_dhcp
|
- hosts: nat_dhcp:homeserver_nat_dhcp
|
||||||
vars:
|
vars:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
- name: Set the /etc/hosts
|
- name: Set the /etc/hosts
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/hosts
|
path: /etc/hosts
|
||||||
regexp: '^{{ item.key | regex_escape() }}'
|
regexp: '^{{ item.key | regex_escape() }}\s+'
|
||||||
line: "{{ item.key }} {{ item.value | join(' ') }}"
|
line: "{{ item.key }} {{ item.value | join(' ') }}"
|
||||||
loop: "{{ etc_hosts | dict2items }}"
|
loop: "{{ etc_hosts | dict2items }}"
|
||||||
|
|
||||||
|
10
ansible/roles/portshaker/files/freebsd
Normal file
10
ansible/roles/portshaker/files/freebsd
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
. /usr/local/share/portshaker/portshaker.subr
|
||||||
|
if [ "$1" != '--' ]; then
|
||||||
|
err 1 "Extra arguments"
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
method="git"
|
||||||
|
git_clone_uri="https://github.com/freebsd/freebsd-ports.git"
|
||||||
|
git_branch="main"
|
||||||
|
run_portshaker_command $*
|
10
ansible/roles/portshaker/files/myrepo
Normal file
10
ansible/roles/portshaker/files/myrepo
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
. /usr/local/share/portshaker/portshaker.subr
|
||||||
|
if [ "$1" != '--' ]; then
|
||||||
|
err 1 "Extra arguments"
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
method="git"
|
||||||
|
git_clone_uri="https://code.fizz.buzz/talexander/ta_ports.git"
|
||||||
|
git_branch="master"
|
||||||
|
run_portshaker_command $*
|
8
ansible/roles/portshaker/files/portshaker.conf
Normal file
8
ansible/roles/portshaker/files/portshaker.conf
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#---[ Base directory for mirrored Ports Trees ]---
|
||||||
|
mirror_base_dir="/var/cache/portshaker"
|
||||||
|
|
||||||
|
#---[ Directories where to merge ports ]---
|
||||||
|
ports_trees="main"
|
||||||
|
|
||||||
|
main_ports_tree="/usr/local/portshaker/trees/main"
|
||||||
|
main_merge_from="freebsd myrepo"
|
15
ansible/roles/portshaker/tasks/common.yaml
Normal file
15
ansible/roles/portshaker/tasks/common.yaml
Normal 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
|
50
ansible/roles/portshaker/tasks/freebsd.yaml
Normal file
50
ansible/roles/portshaker/tasks/freebsd.yaml
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# Update ports tree:
|
||||||
|
# portshaker -U
|
||||||
|
# portshaker -M
|
||||||
|
#
|
||||||
|
# Force build:
|
||||||
|
# poudriere bulk -J 4 -C -j current -p default -z testing sysutils/kubectx
|
||||||
|
#
|
||||||
|
# Test build with interactive shell
|
||||||
|
# poudriere testport -i -J 4 -j current -p default -z testing sysutils/kubectx
|
||||||
|
# optional add -w to save the work directory
|
||||||
|
|
||||||
|
- name: Install packages
|
||||||
|
package:
|
||||||
|
name:
|
||||||
|
- portshaker
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Create directories
|
||||||
|
file:
|
||||||
|
name: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
mode: 0755
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- /usr/local/portshaker/trees
|
||||||
|
|
||||||
|
- name: Install Configuration
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- src: portshaker.conf
|
||||||
|
dest: /usr/local/etc/portshaker.conf
|
||||||
|
|
||||||
|
- name: Install Scripts
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: 0755
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- src: freebsd
|
||||||
|
dest: /usr/local/etc/portshaker.d/freebsd
|
||||||
|
- src: myrepo
|
||||||
|
dest: /usr/local/etc/portshaker.d/myrepo
|
21
ansible/roles/portshaker/tasks/linux.yaml
Normal file
21
ansible/roles/portshaker/tasks/linux.yaml
Normal 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
|
2
ansible/roles/portshaker/tasks/main.yaml
Normal file
2
ansible/roles/portshaker/tasks/main.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
- import_tasks: tasks/common.yaml
|
||||||
|
when: poudriere_builds is defined and poudriere_builds
|
29
ansible/roles/portshaker/tasks/peruser.yaml
Normal file
29
ansible/roles/portshaker/tasks/peruser.yaml
Normal 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"'
|
0
ansible/roles/portshaker/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/portshaker/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/portshaker/tasks/peruser_linux.yaml
Normal file
0
ansible/roles/portshaker/tasks/peruser_linux.yaml
Normal file
@ -11,6 +11,8 @@ if [[ ! -v XDG_RUNTIME_DIR ]]; then
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
export XDG_CURRENT_DESKTOP=sway
|
||||||
|
|
||||||
# Enable wayland support for firefox
|
# Enable wayland support for firefox
|
||||||
export MOZ_ENABLE_WAYLAND=1
|
export MOZ_ENABLE_WAYLAND=1
|
||||||
|
|
||||||
|
@ -5,4 +5,6 @@ set -euo pipefail
|
|||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
export XDG_CURRENT_DESKTOP=sway
|
||||||
|
|
||||||
exec sway -d &> $HOME/.config/swaylog
|
exec sway -d &> $HOME/.config/swaylog
|
||||||
|
Loading…
Reference in New Issue
Block a user