system-config/roles/openafs-client/tasks/main.yaml
Ian Wienand 22c5561df3 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
2020-01-28 21:05:27 +11:00

75 lines
1.8 KiB
YAML

- name: Setup OS specific variable include
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_distribution }}.{{ ansible_architecture }}.yaml"
- "{{ ansible_distribution }}.{{ ansible_distribution_major_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
paths:
- vars
- name: Check config path defined
fail:
msg: "openafs_client_config_path not defined"
when: not openafs_client_config_path
- name: Create configuration directory
file:
path: '{{ openafs_client_config_path }}'
state: directory
become: yes
- name: Install client base config files
template:
dest: '{{ openafs_client_config_path }}/{{ item }}'
owner: root
group: root
mode: 0644
src: '{{ item }}'
loop:
- afs.conf.client
- CellServDB
become: yes
- name: Install client templated config files
template:
dest: '{{ openafs_client_config_path }}/{{ item }}'
owner: root
group: root
mode: 0644
src: '{{ item }}.j2'
loop:
- cacheinfo
- 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:
params:
files:
- "{{ ansible_distribution }}.{{ ansible_architecture }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
- "default.yaml"
paths:
- openafs-client
- name: Ensure openafs-client service running
service:
name: openafs-client
state: started
enabled: yes
become: yes