From 11ef6647f11ccfc0790acd9b3834d34e4d31d1a7 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 25 Nov 2022 15:02:15 -0500 Subject: [PATCH] Use latest packages on FreeBSD. --- .../roles/package_manager/files/FreeBSD.conf | 7 +++++ .../roles/package_manager/tasks/freebsd.yaml | 31 ++++++++++++++++--- 2 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 ansible/roles/package_manager/files/FreeBSD.conf diff --git a/ansible/roles/package_manager/files/FreeBSD.conf b/ansible/roles/package_manager/files/FreeBSD.conf new file mode 100644 index 0000000..4a9614d --- /dev/null +++ b/ansible/roles/package_manager/files/FreeBSD.conf @@ -0,0 +1,7 @@ +FreeBSD: { + url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", + mirror_type: "srv", + signature_type: "fingerprints", + fingerprints: "/usr/share/keys/pkg", + enabled: yes +} diff --git a/ansible/roles/package_manager/tasks/freebsd.yaml b/ansible/roles/package_manager/tasks/freebsd.yaml index b417174..ba97b59 100644 --- a/ansible/roles/package_manager/tasks/freebsd.yaml +++ b/ansible/roles/package_manager/tasks/freebsd.yaml @@ -1,5 +1,26 @@ -# - name: Install packages -# package: -# name: -# - foo -# state: present +- name: Create directories + file: + name: "{{ item }}" + state: directory + mode: 0755 + owner: root + group: wheel + loop: + - /usr/local/etc/pkg + - /usr/local/etc/pkg/repos + +- name: Install Configuration + 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: Replace all packages with packages from new repo +# command: pkg upgrade -f -y +# when: changed_config.changed