Skip to content

Commit

Permalink
tasks: galera_post_install: Configure the service before securing the DB
Browse files Browse the repository at this point in the history
The DB secure tool attempts to start the DB but this may fail if the
systemd service is not configured properly. As such, we move the service
configuration tasks before those that secure the db.

Change-Id: I49f5cee0494b89d5018056fbed84f52a67aa7399
  • Loading branch information
Markos Chandras committed Jan 23, 2018
1 parent dc3d1ab commit baa97f1
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions tasks/galera_post_install.yml
Expand Up @@ -13,6 +13,35 @@
# See the License for the specific language governing permissions and
# limitations under the License.

- name: Create mariadb systemd service config dir
file:
path: "/etc/systemd/system/{{ galera_mariadb_service_name }}.service.d"
state: "directory"
group: "root"
owner: "root"
mode: "0755"

- name: Apply systemd options
template:
src: "{{ item.src }}"
dest: "/etc/systemd/system/{{ galera_mariadb_service_name }}.service.d/{{ item.dest }}"
mode: "0644"
with_items:
- { src: "systemd.environment.conf.j2", dest: "environment.conf" }
- { src: "systemd.limits.conf.j2", dest: "limits.conf" }
- { src: "systemd.restart.conf.j2", dest: "restart.conf" }
- { src: "systemd.slice.conf.j2", dest: "slice.conf" }
- { src: "systemd.timeout.conf.j2", dest: "timeout.conf" }
- { src: "systemd.without-privatedevices.conf.j2", dest: "without-privatedevices.conf" }
notify:
- Manage LB
- Reload the systemd daemon
- Restart all mysql

- name: Reload systemd service files
systemd:
daemon_reload: yes

# NOTE(cloudnull): The secure task is not needed on Debian based systems
# as all of these tasks will be run on Package install
# and running them again will cause a conflict within
Expand Down Expand Up @@ -125,31 +154,6 @@
dest: "/etc/default/mysql"
state: "link"

- name: Create mariadb systemd service config dir
file:
path: "/etc/systemd/system/{{ galera_mariadb_service_name }}.service.d"
state: "directory"
group: "root"
owner: "root"
mode: "0755"

- name: Apply systemd options
template:
src: "{{ item.src }}"
dest: "/etc/systemd/system/{{ galera_mariadb_service_name }}.service.d/{{ item.dest }}"
mode: "0644"
with_items:
- { src: "systemd.environment.conf.j2", dest: "environment.conf" }
- { src: "systemd.limits.conf.j2", dest: "limits.conf" }
- { src: "systemd.restart.conf.j2", dest: "restart.conf" }
- { src: "systemd.slice.conf.j2", dest: "slice.conf" }
- { src: "systemd.timeout.conf.j2", dest: "timeout.conf" }
- { src: "systemd.without-privatedevices.conf.j2", dest: "without-privatedevices.conf" }
notify:
- Manage LB
- Reload the systemd daemon
- Restart all mysql

- name: remove default mysql_safe_syslog
file:
path: "/etc/mysql/conf.d/mysqld_safe_syslog.cnf"
Expand Down

0 comments on commit baa97f1

Please sign in to comment.