system-config/roles/openafs-client/tasks/main.yaml
Ian Wienand 65991cf92e openafs-client: add service timeout override
Starting the openafs-client service is an intensive operation as it
walks the cache registering various things.  We've seen on our
production ARM64 mirror this can take longer than the 1:30 default
timeout.  This is a fatal issue, as the module will try to unload
while afsd is still spinning and working resulting in completely
corrupt kernel state.

This is about double the longest time we've seen, so should give
plenty of overhead.

Change-Id: I37186494b9afd72eab3a092279579f1a5fa5d22c
2021-06-16 11:50:53 +10:00

99 lines
2.2 KiB
YAML

- name: Setup OS specific variable include
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_distribution }}.{{ ansible_distribution_major_version }}.yaml"
- "{{ ansible_distribution }}.yaml"
- "{{ ansible_os_family }}.yaml"
paths:
- vars
- name: Increase udp buffer sizes
copy:
src: 99-afs-udp.conf
dest: /etc/sysctl.d/99-afs-udp.conf
owner: root
group: root
mode: '0644'
become: yes
- 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: Set timeout override
become: yes
block:
- name: Create service override directory
file:
path: '/etc/systemd/system/openafs-client.service.d'
state: directory
owner: root
group: root
mode: 0755
- name: Save override
template:
dest: '/etc/systemd/system/openafs-client.service.d/timeout.conf'
src: 'timeout.conf.j2'
group: root
mode: 0644
- name: Setup OS specific openafs-client environment
include_tasks: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ 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