machine_setup/ansible/roles/build/tasks/freebsd.yaml

101 lines
2.3 KiB
YAML

- name: Install packages
package:
name:
- git
state: present
- name: Create directories
file:
name: "{{ item }}"
state: directory
mode: 0755
owner: "{{ build_user.name }}"
group: "{{ build_user.group }}"
loop:
- "/usr/src"
# - "/usr/ports"
- "/usr/obj"
- name: chown the FreeBSD source
file:
name: "{{ item }}"
state: directory
owner: "{{ build_user.name }}"
group: "{{ build_user.group }}"
recurse: true
loop:
- "/usr/src"
- name: Clone FreeBSD Source
git:
repo: "https://git.FreeBSD.org/src.git"
dest: /usr/src
version: "{{ freebsd_version }}"
force: true
become: true
become_user: "{{ build_user.name }}"
diff: false
# - name: Clone Ports Tree
# git:
# repo: "https://git.FreeBSD.org/ports.git"
# dest: /usr/ports
# version: "main"
# force: true
# update: false
# become: true
# become_user: "{{ build_user.name }}"
# diff: false
- name: Install Configuration
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: root
group: wheel
loop:
- src: make.conf
dest: /etc/make.conf
- name: Install Configuration
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: "{{ build_user.name }}"
group: "{{ build_user.group }}"
loop:
- src: CUSTOM
dest: /usr/src/sys/amd64/conf/CUSTOM
- name: Install Configuration
template:
src: "templates/{{ item.src }}.j2"
dest: "{{ item.dest }}"
mode: 0644
owner: root
group: wheel
loop:
- src: src.conf
dest: /etc/src.conf
- name: Install scripts
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0700
owner: "{{ build_user.name }}"
group: "{{ build_user.group }}"
loop:
- src: freebsd_update_step1
dest: /usr/local/bin/freebsd_update_step1
- src: freebsd_update_step2
dest: /usr/local/bin/freebsd_update_step2
- src: find_popular_ports_options.bash
dest: /usr/local/bin/find_popular_ports_options
- src: find_ports_containing_option.bash
dest: /usr/local/bin/find_ports_containing_option
- src: find_packages_that_installed_kernel_modules.bash
dest: /usr/local/bin/find_packages_that_installed_kernel_modules