2013-09-03 13:34:10 -06:00
|
|
|
{% from "mysql/map.jinja" import mysql with context %}
|
2013-08-08 16:19:55 -06:00
|
|
|
|
2013-06-13 16:30:25 -06:00
|
|
|
mysqld:
|
2013-08-08 16:19:55 -06:00
|
|
|
pkg:
|
|
|
|
- installed
|
2013-08-15 21:50:58 -06:00
|
|
|
- name: {{ mysql.server }}
|
2013-06-13 16:30:25 -06:00
|
|
|
service:
|
|
|
|
- running
|
2013-08-15 21:50:58 -06:00
|
|
|
- name: {{ mysql.service }}
|
2013-06-13 16:30:25 -06:00
|
|
|
- enable: True
|
2013-08-15 16:56:33 -05:00
|
|
|
- watch:
|
|
|
|
- pkg: mysqld
|
2013-08-19 10:03:59 -05:00
|
|
|
|
|
|
|
{% if grains['os'] in ['Ubuntu', 'Debian', 'Gentoo'] %}
|
|
|
|
my.cnf:
|
|
|
|
file.managed:
|
2013-08-15 21:50:58 -06:00
|
|
|
- name: {{ mysql.config }}
|
2013-08-19 10:03:59 -05:00
|
|
|
- source: salt://mysql/files/{{ grains['os'] }}-my.cnf
|
|
|
|
- user: root
|
|
|
|
- group: root
|
|
|
|
- mode: 644
|
|
|
|
- template: jinja
|
2013-08-19 10:15:22 -05:00
|
|
|
- watch_in:
|
|
|
|
- service: mysqld
|
2013-08-19 10:03:59 -05:00
|
|
|
{% endif %}
|
2013-11-15 12:40:20 -07:00
|
|
|
|
|
|
|
# Set SELinux to permissive mode while installing mysqld otherwise the
|
|
|
|
# mysql user will not be created; restore enforcing when done.
|
|
|
|
{% if (grains['os_family'] == 'RedHat'
|
|
|
|
and salt['cmd.run']("sestatus | awk '/Current mode/ { print $3 }'") == 'enforcing') %}
|
|
|
|
selinux_permissive:
|
|
|
|
cmd.run:
|
|
|
|
- name: setenforce permissive
|
|
|
|
- prereq:
|
|
|
|
- pkg: mysqld
|
|
|
|
|
|
|
|
selinux_enforcing:
|
|
|
|
cmd.wait:
|
|
|
|
- name: setenforce enforcing
|
|
|
|
- watch_in:
|
|
|
|
- pkg: mysqld
|
|
|
|
{% endif %}
|