Ian Wienand 7683fa11b3 openafs-server : add ansible roles for OpenAFS servers
This starts at migrating OpenAFS server setup to Ansible.

Firstly we split up the groups and explicitly name hosts, as we will
me migrating each one step-by-step.  We split out 1.8 hosts into a new
afs-1.8 group; the first host is afs01.ord.openstack.org which already
has openafs 1.8 installed manually.

An openafs-server role is introduced that does the same setup as the
extant puppet.

The AFS job is renamed to infra-prod-afs as the puppet component will
eventually disappear.  Otherwise it runs in the same way, but also
runs the openafs-server role for the 1.8 servers.

Once this is merged, we can run it against afs01.ord.openstack.org to
ensure it works and is idempotent.  We can then take on upgrading the
other file servers, and work further on the database servers.

Change-Id: I7998af43961999412f58a78214f4b5387713d30e
2021-01-19 08:08:33 +11:00

86 lines
2.1 KiB
YAML

- name: Install pre-reqs
package:
name: '{{ item }}'
state: present
loop:
- apt-transport-https
- software-properties-common
- name: Ensure server directory
file:
state: directory
path: /etc/openafs/server
owner: root
group: root
mode: 0755
- name: Copy configuration files
copy:
src: '{{ item }}'
dest: '/etc/openafs/server'
owner: root
group: root
mode: 0644
loop:
- CellServDB
- ThisCell
- name: Install rxkad.keytab
shell: 'echo "{{ openafs_server_rxkad_keytab }}" | base64 -d > /etc/openafs/server/rxkad.keytab'
args:
creates: '/etc/openafs/server/rxkad.keytab'
no_log: True
- name: Ensure permissions rxkad.keytab
file:
path: '/etc/openafs/server/rxkad.keytab'
owner: root
group: root
mode: '0400'
# This is generated by aconvert from rxkad.keytab; or if we ever need
# to regenerate everything see asetkey(8) man page, which creates this
# from a keytab. It's used by openafs 1.8 instead of keytabs to
# reduce kerberos library dependencies or some such.
- name: Install KeyfileExt
shell: 'echo "{{ openafs_server_keyfileext }}" | base64 -d > /etc/openafs/server/KeyFileExt'
args:
creates: '/etc/openafs/server/KeyFileExt'
no_log: True
- name: Ensure permissions on KeyFileExt
file:
path: '/etc/openafs/server/KeyFileExt'
owner: root
group: root
mode: '0400'
- name: Install openstackci openafs PPA
apt_repository:
repo: 'ppa:openstack-ci-core/openafs'
- name: Install kernel headers dependency
package:
name:
- linux-headers-{{ ansible_kernel }}
state: present
become: yes
# NOTE(ianw) : Need to do this first and separately so that the
# modules are ready for the openafs server/client package to start.
# Avoid recommends because that drags in the client, which can't start
# without the modules which are building in this step (we do it next)
- name: Install openafs kernel modules
apt:
name: openafs-modules-dkms
state: latest
install_recommends: no
- name: Install packages
package:
name:
- openafs-fileserver
- openafs-client
- openafs-krb5
state: latest