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

93 lines
2.0 KiB
YAML
Raw Normal View History

2022-11-25 20:02:15 +00:00
- name: Create directories
file:
name: "{{ item }}"
state: directory
mode: 0755
owner: root
group: wheel
loop:
- /usr/local/etc/pkg
- /usr/local/etc/pkg/repos
2024-02-11 19:59:55 +00:00
- name: Install packages
package:
name:
- pkg-provides
state: present
2022-11-25 20:02:15 +00:00
- name: Install Configuration
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: root
group: wheel
loop:
- src: pkg.conf
dest: /usr/local/etc/pkg.conf
- name: Install Configuration
when: custom_repo is not defined
2022-11-25 20:02:15 +00:00
register: changed_config
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: root
group: wheel
loop:
- src: FreeBSD.conf
dest: /usr/local/etc/pkg/repos/FreeBSD.conf
- name: Install Configuration
when: custom_repo is defined
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0644
owner: root
group: wheel
loop:
- src: disable_freebsd_upstream.conf
dest: /usr/local/etc/pkg/repos/FreeBSD.conf
- src: poudriere.pub
dest: /usr/local/etc/pkg/poudriere.pub
- name: Install Configuration
when: custom_repo is defined
register: changed_config
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: root
group: wheel
mode: 0644
loop:
- { src: custom.conf.j2, dest: /usr/local/etc/pkg/repos/custom.conf }
2022-11-25 20:02:15 +00:00
2024-02-11 19:59:55 +00:00
- name: Install Configuration
when: pkgbase_url is defined
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
owner: root
group: wheel
mode: 0644
loop:
- { src: pkgbase.conf.j2, dest: /usr/local/etc/pkg/repos/pkgbase.conf }
2024-07-04 18:44:32 +00:00
2022-11-25 20:02:15 +00:00
# - name: Replace all packages with packages from new repo
# command: pkg upgrade -f -y
# when: changed_config.changed
2024-07-04 18:44:32 +00:00
- name: Install scripts
copy:
src: "files/{{ item.src }}"
dest: "{{ item.dest }}"
mode: 0755
owner: root
group: wheel
loop:
- src: pkgbase_diff.bash
dest: /usr/local/bin/pkgbase_diff