system-config/roles/openafs-client/tasks/main.yaml
Ian Wienand 801e7c9bd0 Add openafs-client role
The role sets up a host as an OpenAFS client.

As noted in the README, OpenAFS is not available in every
distribution, or on every architecture.  The goal is to provide
sensible defaults but allow for flexibility.

This is largely a port of the client parts of
openstack-infra/puppet-openafs.

This is a generic role because it will be used from Zuul jobs
(wheel-builds) and in the control-plane (servers mounting AFS)

Tested-By: https://review.openstack.org/589335
Needed-By: https://review.openstack.org/590636
Change-Id: Iaaa18194baca4ebd37669ea00505416ebf6c884c
2018-08-23 21:34:47 +10:00

64 lines
1.5 KiB
YAML

- name: Setup OS specific variable include
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_distribution }}.{{ ansible_architecture }}.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: Setup OS specific openafs-client environment
include: "{{ 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