summaryrefslogtreecommitdiff
path: root/baserock_database/image-config.yml
blob: 7b89e700558333bb841d793908771eaaa52198f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# System configuration for Baserock database server.
#
# This Ansible playbook expects to be run on a Fedora 23 Cloud image.
---
- hosts: database-mariadb
  gather_facts: False
  sudo: True
  tasks:
  # See: https://fedoramagazine.org/getting-ansible-working-fedora-23/
  - name: install Python2 and required deps for Ansible modules
    raw: dnf install -y python2 python2-dnf libselinux-python

  - name: ensure system up to date
    dnf: name=* state=latest

  - name: enable persistant journal
    shell: mkdir /var/log/journal
    args:
      creates: /var/log/journal

  - name: install lvm2 tools
    dnf: name=lvm2 state=latest

  - name: install MariaDB
    dnf: name={{ item }} state=latest
    with_items:
        - mariadb
        - mariadb-server
        - MySQL-python

  # By default this is set to /var/lib/mysql, but this causes a hidden
  # directory to be created in /var/lib/mysql (.local/share/systemd) which
  # breaks MariaDB because it expects each directory in there to represent a
  # database, and you see this when upgrading:
  #
  #   Phase 2/6: Fixing views
  #   mysqlcheck: Got error: 1102: Incorrect database name '#mysql50#.local' when selecting the database
  #
  - name: fix home directory of MySQL user
    user: name=mysql home=/

  - name: disable SELinux on subsequent boots
    selinux: state=disabled

  - name: disable SELinux on current boot
    command: setenforce 0