Skip to content

Commit

Permalink
Merge pull request #13 from metno/ubuntu2404
Browse files Browse the repository at this point in the history
Add support for Ubuntu 24.04
  • Loading branch information
KjetilKnutsen authored Mar 5, 2024
2 parents 1b88cd3 + 34854b5 commit 844544f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This role configures the following.
Version
-------

* `3.3.0` --- Added support for Ubuntu 24.04
* `3.2.0` --- Added `root_keys_authorized_keys_file_owner` and `root_keys_authorized_keys_file_group`.
* `3.1.1` --- Allow Fedora CoreOS 39 to run. No tests has been done
* `3.1.0` --- Initial support for Fedora CoreOS, but with no tests. Also disabled coreos testing.
Expand Down
3 changes: 2 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ galaxy_info:
description: Configure root ssh access with ssh keys
company: MET Norway
role_name: root_keys
namespace: met
namespace: metno
standalone: true

license: GPLv2
Expand All @@ -15,6 +15,7 @@ galaxy_info:
platforms:
- name: Ubuntu
versions:
- "noble"
- "jammy"
- "focal"
- "bionic"
Expand Down
2 changes: 1 addition & 1 deletion tasks/linux.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Set sshd service name
ansible.builtin.set_fact:
sshd_service_name: '{{ "ssh" if ansible_distribution == "Ubuntu" and ansible_distribution_version | int <= 14 else "sshd" }}'
sshd_service_name: '{{ "ssh" if ansible_distribution == "Ubuntu" and ansible_distribution_version | int <= 14 else ("ssh" if ansible_distribution == "Ubuntu" and ansible_distribution_version | int == 24 else "sshd") }}' # noqa: yaml[line-length]

- name: Allow/disallow SSH password login for root
ansible.builtin.lineinfile:
Expand Down
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
- name: Check if we are running supported os
ansible.builtin.assert:
fail_msg: "{{ role_name }} only supports ubuntu versions 16, 18, 20, 22, centos versions 7, centos strem versions 8, rhel versions 8, 9!"
fail_msg: "{{ role_name }} only supports ubuntu versions 16, 18, 20, 22, 24, centos versions 7, centos strem versions 8, rhel versions 8, 9!"
success_msg: "{{ role_name }} supports {{ ansible_distribution }} version {{ ansible_distribution_version }}"
quiet: "{{ not ansible_check_mode }}"
that:
( ansible_distribution == "Ubuntu" and ansible_distribution_version|int in [16, 18, 20, 22] )
( ansible_distribution == "Ubuntu" and ansible_distribution_version|int in [16, 18, 20, 22, 24] )
or ( ansible_distribution == "CentOS" and ansible_distribution_major_version|int in [7, 8] )
or ( ansible_distribution == "RedHat" and ansible_distribution_major_version|int in [8, 9] )
or ( ansible_distribution == "Fedora" and ansible_distribution_major_version|int in [38, 39] )
Expand Down
14 changes: 8 additions & 6 deletions tests/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ CURRENT_PATH = File.dirname(File.expand_path(__FILE__))

Vagrant.configure("2") do |config|
boxes = [
{ :name => "noble", :box => "ubuntu/noble64" },
{ :name => "jammy", :box => "ubuntu/jammy64" },
# { :name => "focal", :box => "ubuntu/focal64" },
# { :name => "bionic", :box => "ubuntu/bionic64" },
# { :name => "centos7", :box => "centos/7" },
# { :name => "centos8", :box => "centos/stream8" },
# { :name => "rhel8", :box => "generic/rhel8" },
# { :name => "rhel9", :box => "generic/rhel9" },
{ :name => "focal", :box => "ubuntu/focal64" },
{ :name => "bionic", :box => "ubuntu/bionic64" },
{ :name => "xenial", :box => "ubuntu/xenial64" },
{ :name => "centos7", :box => "centos/7" },
{ :name => "centos8", :box => "generic/centos8s" },
{ :name => "rhel8", :box => "generic/rhel8" },
{ :name => "rhel9", :box => "generic/rhel9" },
]
boxes.each do |opts|
config.vm.define opts[:name] do |config|
Expand Down

0 comments on commit 844544f

Please sign in to comment.