forked from ansible-community/ansible-nomad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
160.patch
75 lines (67 loc) · 2.53 KB
/
160.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
From 31fbf6f703a6c687dcb97bff1e69f2e28c5af6c7 Mon Sep 17 00:00:00 2001
From: Shawn <[email protected]>
Date: Fri, 11 Nov 2022 05:18:53 +0000
Subject: [PATCH 1/3] chore: add Rocky to `os_supported_matrix`
---
defaults/main.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/defaults/main.yml b/defaults/main.yml
index 94de4e5f..fe5840c9 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -10,6 +10,8 @@ os_supported_matrix:
# RHEL-based
RedHat:
min_version: '6'
+ Rocky:
+ min_version: '6'
CentOS:
min_version: '6'
Fedora:
From a72efbc1d88dea103fdb2f5fa3b3a0ccd0674a17 Mon Sep 17 00:00:00 2001
From: Shawn <[email protected]>
Date: Fri, 11 Nov 2022 05:20:01 +0000
Subject: [PATCH 2/3] Update RedHat.yml
---
vars/RedHat.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/vars/RedHat.yml b/vars/RedHat.yml
index 73d2e341..dd7381b0 100644
--- a/vars/RedHat.yml
+++ b/vars/RedHat.yml
@@ -6,6 +6,7 @@ nomad_os_packages:
- git
- "{% if ( ansible_distribution == 'Fedora' and ansible_distribution_version is version('28', '<') ) or \
( ansible_distribution == 'CentOS' and ansible_distribution_version is version('8', '<') ) or \
+ ( ansible_distribution == 'Rocky' and ansible_distribution_version is version('8', '<') ) or \
( ansible_distribution == 'Amazon' and ansible_distribution_version is version('3', '<') ) or \
( ansible_distribution == 'OracleLinux' and ansible_distribution_version is version('8', '<') ) \
%}\
From 2f4e612363e083c2feaeaa5c116ec57847b9584f Mon Sep 17 00:00:00 2001
From: Shawn <[email protected]>
Date: Fri, 18 Nov 2022 04:22:39 +0000
Subject: [PATCH 3/3] fix: only create nomad volume directory if not exist
---
tasks/host_volume.yml | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tasks/host_volume.yml b/tasks/host_volume.yml
index 9fe6ce14..60b08c9f 100644
--- a/tasks/host_volume.yml
+++ b/tasks/host_volume.yml
@@ -1,3 +1,10 @@
+- name: check nomad host volumes existence
+ stat:
+ path: "{{ item.path }}"
+ become: true
+ register: nomad_host_volumes_stat
+ loop: "{{ nomad_host_volumes }}"
+
- name: create volume {{ item['name'] }}
file:
path: "{{ item['path'] }}"
@@ -5,4 +12,4 @@
group: "{{ item['group'] | default(nomad_group) }}"
state: directory
mode: "{{ item['mode'] | default('0755') }}"
- with_items: "{{ nomad_host_volumes }}"
+ loop: "{{ nomad_host_volumes | zip(nomad_host_volumes_stat.results) | selectattr('1.stat.exists', 'equalto', false) | map(attribute='0') | list }}"