Skip to content

Commit

Permalink
Merge pull request #44 from yuichisatake/modify_for_al2023
Browse files Browse the repository at this point in the history
Modify for Amazon Linux 2023
  • Loading branch information
lufia authored Apr 23, 2024
2 parents 808cad1 + 82c6482 commit f8deaef
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
47 changes: 47 additions & 0 deletions tasks/amazonlinux2023.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
- name: import mackerel GPG key
rpm_key:
key: https://mackerel.io/file/cert/GPG-KEY-mackerel

- name: import mackerel GPG key v2
rpm_key:
key: https://mackerel.io/file/cert/GPG-KEY-mackerel-v2

- name: add repository 'mackerel' v2023
copy:
src: amazonlinux-mackerel-2023.repo
dest: /etc/yum.repos.d/mackerel.repo
owner: root
group: root
mode: 0644

- name: install mackerel-agent
dnf:
name: mackerel-agent
state: latest
ignore_errors: "{{ ansible_check_mode }}"

- name: install mackerel-agent-plugins
dnf:
name: mackerel-agent-plugins
state: latest
when: mackerel_use_plugins
ignore_errors: "{{ ansible_check_mode }}"
notify:
- restart mackerel-agent

- name: install mackerel-check-plugins
dnf:
name: mackerel-check-plugins
state: latest
when: mackerel_use_plugins
ignore_errors: "{{ ansible_check_mode }}"
notify:
- restart mackerel-agent

- name: install mkr
dnf:
name: mkr
state: latest
when: mackerel_install_mkr
ignore_errors: "{{ ansible_check_mode }}"
5 changes: 4 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
when: ansible_os_family == "RedHat" and ansible_distribution != "Amazon"

- include_tasks: amazonlinux.yml
when: ansible_distribution == "Amazon"
when: ansible_distribution == "Amazon" and ansible_distribution_major_version == "2"

- include_tasks: amazonlinux2023.yml
when: ansible_distribution == "Amazon" and ansible_distribution_major_version == "2023"

- name: check config directory
stat:
Expand Down

0 comments on commit f8deaef

Please sign in to comment.