Browse Source

openafs-client: add option for OpenAFS cache location

Our control plane servers generally have large ephemeral storage
attached at /opt; for many uses this is enough space that we don't
need to add extra cinder volumes for a reasonable cache (as we usually
do on mirror nodes; but there we create large caches for both openafs
and httpd reverse proxy whose needs exceed even what we get from
ephemeral storage).

Add an option to set the cache location, and use /opt for our new
static01.opendev.org server.

Change-Id: I16eed1734a0a7e855e27105931a131ce4dbd0793
changes/23/704523/1
Ian Wienand 3 weeks ago
parent
commit
22c5561df3
5 changed files with 19 additions and 3 deletions
  1. +1
    -0
      playbooks/service-static.yaml
  2. +7
    -2
      roles/openafs-client/README.rst
  3. +1
    -0
      roles/openafs-client/defaults/main.yaml
  4. +9
    -0
      roles/openafs-client/tasks/main.yaml
  5. +1
    -1
      roles/openafs-client/templates/cacheinfo.j2

+ 1
- 0
playbooks/service-static.yaml View File

@@ -9,4 +9,5 @@
- kdc04.openstack.org
- role: openafs-client
openafs_client_cache_size: "{{ afs_client_cache_size | default(50000000) }}" # 50GiB
openafs_client_cache_directory: '/opt/cache/openafs'
- role: static

+ 7
- 2
roles/openafs-client/README.rst View File

@@ -20,12 +20,17 @@ role has limited platform support. Currently supported are
.. zuul:rolevar:: openafs_client_cell
:default: openstack.org

The default cell
The default cell.

.. zuul:rolevar:: openafs_client_cache_size
:default: 500000

The AFS client cache size, in kilobytes
The OpenAFS client cache size, in kilobytes.

.. zuul:rolevar:: openafs_client_cache_directory
:default: /var/cache/openafs

The directory to store the OpenAFS cache files.

.. zuul:rolevar:: openafs_client_yum_repo_url
:default: ``https://tarballs.openstack.org/project-config/package-afs-centos7``

+ 1
- 0
roles/openafs-client/defaults/main.yaml View File

@@ -1,2 +1,3 @@
openafs_client_cell: 'openstack.org'
openafs_client_cache_directory: '/var/cache/openafs'
openafs_client_cache_size: 500000

+ 9
- 0
roles/openafs-client/tasks/main.yaml View File

@@ -45,6 +45,15 @@
- ThisCell
become: yes

- name: Ensure cache location directory
file:
path: '{{ openafs_client_cache_directory }}'
state: directory
owner: root
group: root
mode: 0700
become: yes

- name: Setup OS specific openafs-client environment
include_tasks: "{{ lookup('first_found', params) }}"
vars:

+ 1
- 1
roles/openafs-client/templates/cacheinfo.j2 View File

@@ -1 +1 @@
/afs:/var/cache/openafs:{{ openafs_client_cache_size }}
/afs:{{ openafs_client_cache_directory }}:{{ openafs_client_cache_size }}

Loading…
Cancel
Save