From 67cea8ed34e316e706af7773b30f9951f9fc21c6 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Tue, 13 Jul 2021 21:02:56 -0500 Subject: [PATCH] Variablize FreeBSD's loading of fusefs. --- facts/general/service.yml | 12 +++++++++--- tasks/general/acct_mgmt/mounts.yml | 2 +- tasks/general/cron/root.yml | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/facts/general/service.yml b/facts/general/service.yml index c493651..51da44f 100644 --- a/facts/general/service.yml +++ b/facts/general/service.yml @@ -27,6 +27,12 @@ when: ansible_distribution == "Archlinux" -#- name: General | Facts | Service | FreeBSD -# set_fact: -# when: ansible_system == "FreeBSD" \ No newline at end of file +- name: General | Facts | Service | Non-FreeBSD + set_fact: + load_fusefs: "echo ''" + when: ansible_system != "FreeBSD" + +- name: General | Facts | Service | FreeBSD + set_fact: + load_fusefs: "kldload fusefs" + when: ansible_system == "FreeBSD" \ No newline at end of file diff --git a/tasks/general/acct_mgmt/mounts.yml b/tasks/general/acct_mgmt/mounts.yml index 60b8439..a7f3cb8 100644 --- a/tasks/general/acct_mgmt/mounts.yml +++ b/tasks/general/acct_mgmt/mounts.yml @@ -9,7 +9,7 @@ mode: '0755' - name: General | Account Management | Mounts | Enable SSHFS (FreeBSD) - shell: "kldload fusefs" + shell: "{{ load_fusefs }}" ignore_errors: yes when: ansible_system == "FreeBSD" diff --git a/tasks/general/cron/root.yml b/tasks/general/cron/root.yml index b07dabe..3c08486 100644 --- a/tasks/general/cron/root.yml +++ b/tasks/general/cron/root.yml @@ -6,7 +6,7 @@ user: root name: "1337 SSHFS" special_time: reboot - job: "kldload fusefs && {{ sshfs_leet_cmd }}" + job: "{{ load_fusefs }} && {{ sshfs_leet_cmd }}" state: absent disabled: no when: ansible_system == "FreeBSD"