Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

24.04 support #14

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld

- name: molecule
uses: robertdebock/molecule-action@2.6.8
uses: robertdebock/molecule-action@6.0.1
with:
image: "${{ matrix.image }}"
options: parallel
Expand Down
4 changes: 4 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
galaxy_info:
namespace: acromedia
role_name: mariadb
author: Matt Breden
description: Installs MariaDB on Ubuntu
company: Acro Media Inc.
Expand All @@ -11,5 +13,7 @@ galaxy_info:
- trusty
- xenial
- bionic
- jammy
- noble
galaxy_tags: []
dependencies: []
3 changes: 3 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
privileged: true
pre_build_image: true
tmpfs:
- /run
- /tmp
provisioner:
name: ansible
playbooks:
Expand Down
26 changes: 21 additions & 5 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
- set_fact:
_supported_ubuntu_versions:
- '18.04'
- '20.04'
- '22.04'
- '24.04'

- name: Check if OS is Ubuntu LTS
fail: msg="Server must be Ubuntu LTS"
when: ansible_distribution != 'Ubuntu'
or (ansible_distribution_version != '18.04'
and ansible_distribution_version != '20.04'
and ansible_distribution_version != '22.04')
assert:
that:
- ansible_distribution == 'Ubuntu'
- ansible_distribution_version in _supported_ubuntu_versions
fail_msg: Server must be Ubuntu LTS

- name: Check for existence of /root/.my.cnf
stat: path=/root/.my.cnf
Expand Down Expand Up @@ -62,11 +69,20 @@

- block:
- name: Ensure mysql is running and starts on boot
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version is version("24.04", "<")
service:
name: mysql
state: started
enabled: true

# Service name changes in newer Ubuntu versions
- name: Ensure mariadb is running and starts on boot
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version is version("24.04", ">=")
service:
name: mariadb
state: started
enabled: true

- name: Get list of hosts for the anonymous user.
command: mysql -NBe 'SELECT Host FROM mysql.user WHERE User = ""'
register: mysql_anonymous_hosts
Expand Down
Loading