Skip to content

Commit f8deaef

Browse files
authored
Merge pull request #44 from yuichisatake/modify_for_al2023
Modify for Amazon Linux 2023
2 parents 808cad1 + 82c6482 commit f8deaef

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

tasks/amazonlinux2023.yml

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
- name: import mackerel GPG key
3+
rpm_key:
4+
key: https://mackerel.io/file/cert/GPG-KEY-mackerel
5+
6+
- name: import mackerel GPG key v2
7+
rpm_key:
8+
key: https://mackerel.io/file/cert/GPG-KEY-mackerel-v2
9+
10+
- name: add repository 'mackerel' v2023
11+
copy:
12+
src: amazonlinux-mackerel-2023.repo
13+
dest: /etc/yum.repos.d/mackerel.repo
14+
owner: root
15+
group: root
16+
mode: 0644
17+
18+
- name: install mackerel-agent
19+
dnf:
20+
name: mackerel-agent
21+
state: latest
22+
ignore_errors: "{{ ansible_check_mode }}"
23+
24+
- name: install mackerel-agent-plugins
25+
dnf:
26+
name: mackerel-agent-plugins
27+
state: latest
28+
when: mackerel_use_plugins
29+
ignore_errors: "{{ ansible_check_mode }}"
30+
notify:
31+
- restart mackerel-agent
32+
33+
- name: install mackerel-check-plugins
34+
dnf:
35+
name: mackerel-check-plugins
36+
state: latest
37+
when: mackerel_use_plugins
38+
ignore_errors: "{{ ansible_check_mode }}"
39+
notify:
40+
- restart mackerel-agent
41+
42+
- name: install mkr
43+
dnf:
44+
name: mkr
45+
state: latest
46+
when: mackerel_install_mkr
47+
ignore_errors: "{{ ansible_check_mode }}"

tasks/main.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
when: ansible_os_family == "RedHat" and ansible_distribution != "Amazon"
77

88
- include_tasks: amazonlinux.yml
9-
when: ansible_distribution == "Amazon"
9+
when: ansible_distribution == "Amazon" and ansible_distribution_major_version == "2"
10+
11+
- include_tasks: amazonlinux2023.yml
12+
when: ansible_distribution == "Amazon" and ansible_distribution_major_version == "2023"
1013

1114
- name: check config directory
1215
stat:

0 commit comments

Comments
 (0)