Update to 2022-08-03 01:00

This commit is contained in:
Daniel Berteaud
2022-08-03 01:00:22 +02:00
parent e6e442e0fb
commit a11f21e9c6
8 changed files with 71 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
---
- name: Create needed directories
file: path={{ nomad_root_dir }}/{{ item.dir }} state=directory owner={{ item.owner | default(omit) }} group={{ item.group | default(omit) }} mode={{ item.mode | default(omit) }} recurse={{ item.recurse | default(omit) }}
file: path={{ nomad_root_dir }}/{{ item.dir }} state=directory owner={{ item.owner | default(omit) }} group={{ item.group | default(omit) }} mode={{ item.mode | default(omit) }}
loop:
- dir: /
owner: root
@@ -23,13 +23,9 @@
- dir: tmp
owner: "{{ nomad_user }}"
group: "{{ nomad_user }}"
mode: u=rwX,g=-,o=-
recurse: True
- dir: data
owner: "{{ nomad_user }}"
group: "{{ nomad_user }}"
mode: u=rwX,g=-,o=-
recurse: True
- dir: etc
owner: root
group: "{{ nomad_user }}"

View File

@@ -1,5 +1,14 @@
---
# Load distribution specific variables
- include_vars: "{{ item }}"
with_first_found:
- "{{ role_path }}/vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
- "{{ role_path }}/vars/{{ ansible_os_family }}-{{ ansible_distribution_major_version }}.yml"
- "{{ role_path }}/vars/{{ ansible_distribution }}.yml"
- "{{ role_path }}/vars/{{ ansible_os_family }}.yml"
tags: nomad
- set_fact: nomad_install_mode='none'
tags: nomad
@@ -23,3 +32,10 @@
- when: nomad_bin.stat.exists and nomad_current_version != nomad_version
set_fact: nomad_install_mode='upgrade'
- debug: msg={{ nomad_conf.client.task_drivers | dict2items }}
tags: nomad
- name: Build a list of enabled task drivers
set_fact: nomad_enabled_task_drivers={{ nomad_conf.client.task_drivers | dict2items | selectattr('value.enabled', 'equalto', True) | map(attribute='key') }}
tags: nomad

View File

@@ -8,6 +8,13 @@
- unzip
tags: nomad
- name: Install task driver packages
package: name={{ nomad_task_driver_packages[item] }}
loop: "{{ nomad_enabled_task_drivers }}"
when: nomad_task_driver_packages[item] is defined and nomad_conf.client.enabled
notify: restart nomad
tags: nomad
- when: nomad_install_mode != 'none'
block:
- name: Download nomad
@@ -59,3 +66,4 @@
- pre
- post
tags: nomad