Skip to content

Commit

Permalink
common: Add FS-Cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
JGoutin committed Oct 9, 2024
1 parent 4ea4a8e commit 6c7303a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ packages.
| `common_dnssec` | | If `"yes"`, enforce DNSSEC validation locally, else use default configuration. The DNS server must support DNSSEC. |
| `common_domain` | | Domain/FQDN of the current machine. |
| `common_fail2ban_action` | `%(action_mwl)s` | Fail2ban default action. By default, ban user and send mail with detailed logs to root. |
| `common_fs_cache` | false | If `true`, configure cachefilesd to cache network file system. To use it with NFS or SMB mounts, set this value to `true` and add `fsc` to mount options. |
| `common_grub_auto_hide` | false | If `true` configure Grub to auto-hide. |
| `common_grub_cmdline_linux_default` | | Space-separated list of extra Linux kernel options passed on boot using `GRUB_CMDLINE_LINUX_DEFAULT`. |
| `common_grub_hidden_timeout` | 0 | Grub hidden timeout to set. |
Expand Down
1 change: 1 addition & 0 deletions roles/common/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ common_dnf_keepcache: false
common_dns_over_tls: opportunistic
common_dns_servers_fallback: 1.1.1.1 9.9.9.9 1.0.0.1 149.112.112.112 2606:4700:4700::1111 2620:fe::fe 2606:4700:4700::1001 2620:fe::9
common_fail2ban_action: "%(action_mwl)s"
common_fs_cache: false
common_grub_auto_hide: false
common_grub_hidden_timeout: 0
common_grub_save_default: false
Expand Down
25 changes: 25 additions & 0 deletions roles/common/tasks/fs_cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---

- name: Ensure cachefilesd is installed
ansible.builtin.dnf:
state: present
name: cachefilesd
install_weak_deps: false
retries: 10
delay: 1
register: _
until: _ is successful
when: not (_ostree | bool)

- name: Ensure cachefilesd is installed
community.general.rpm_ostree_pkg:
state: present
name: cachefilesd
when: _ostree | bool

- name: Ensure cachefilesd service is configured
ansible.builtin.systemd:
name: cachefilesd.service
state: started
enabled: true
daemon_reload: true
4 changes: 4 additions & 0 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
ansible.builtin.include_tasks: dnf.yml
when: not (_ostree | bool)

- name: FS-Cache configuration
ansible.builtin.include_tasks: fs_cache.yml
when: common_fs_cache | bool

- name: NFS mounts configuration
ansible.builtin.include_tasks: mount_nfs.yml
when: common_nfs_mount is defined
Expand Down

0 comments on commit 6c7303a

Please sign in to comment.