ceph-ansible/tests/functional/setup.yml

78 lines
2.2 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

---
- hosts: all
gather_facts: true
become: yes
tasks:
- name: check if it is Atomic host
stat: path=/run/ostree-booted
register: stat_ostree
check_mode: no
- name: set fact for using Atomic host
set_fact:
is_atomic: '{{ stat_ostree.stat.exists }}'
- name: get root mount information
set_fact:
rootmount: "{{ ansible_mounts|json_query('[?mount==`/`]|[0]') }}"
# mount -o remount doesn't work on RHEL 8 for now
- name: add mount options to /
mount:
path: '{{ rootmount.mount }}'
src: '{{ rootmount.device }}'
opts: noatime,nodiratime,nobarrier
fstype: '{{ rootmount.fstype }}'
state: mounted
when: not (ansible_os_family == 'RedHat' and
ansible_distribution_major_version == '8')
# we need to install this so the Socket testinfra module
# can use netcat for testing
- name: install net-tools
package:
name: net-tools
state: present
register: result
until: result is succeeded
when: not is_atomic
- name: centos based systems - configure repos
block:
- name: disable fastest mirror detection
ini_file:
path: /etc/yum/pluginconf.d/fastestmirror.conf
section: main
option: enabled
value: 0
- name: install epel
package:
name: epel-release
state: present
register: result
until: result is succeeded
- name: enable local epel repository
ini_file:
path: /etc/yum.repos.d/epel.repo
section: epel
option: baseurl
value: http://apt-mirror.front.sepia.ceph.com/epel7/
- name: disable remote epel repository
ini_file:
path: /etc/yum.repos.d/epel.repo
section: epel
option: metalink
state: absent
when:
- ansible_distribution == 'CentOS'
- not is_atomic
- name: resize logical volume for root partition to fill remaining free space
lvol:
lv: root
vg: atomicos
size: +100%FREE
resizefs: yes
when: is_atomic