xci: Add ansible files for sandbox noha flavor
[releng.git] / prototypes / xci / playbooks / roles / configure-nfs / tasks / main.yml
1 ---
2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
4 # Copyright (c) 2017 Ericsson AB and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10 # TODO: this is for xenial and needs to be adjusted for different distros
11 - block:
12     - name: make NFS dir
13       file:
14         dest: /images
15         mode: 777
16         state: directory
17     - name: configure NFS service
18       lineinfile:
19         dest: /etc/services
20         state: present
21         create: yes
22         line: "{{ item }}"
23       with_items:
24         - "nfs        2049/tcp"
25         - "nfs        2049/udp"
26     - name: configure NFS exports on ubuntu xenial
27       copy:
28         src: ../file/exports
29         dest: /etc/exports
30       when: ansible_distribution_release == "xenial"
31     # TODO: the service name might be different on other distros and needs to be adjusted
32     - name: restart ubuntu xenial NFS service
33       service:
34         name: nfs-kernel-server
35         state: restarted
36   when: ansible_distribution_release == "xenial"