ansible-hashistack/roles/nomad/tasks/main.yml

47 lines
1.2 KiB
YAML
Raw Normal View History

2023-09-18 17:03:08 +02:00
---
- name: check version installed
ansible.builtin.command:
cmd: nomad --version
register: nomad_version_installed
changed_when: false
failed_when: false
- name: install nomad
ansible.builtin.include_tasks: "install_{{ ansible_distribution | lower }}_binary.yml"
when: nomad_installed_version is not defined or nomad_version not in nomad_version_installed.stdout
- name: setup configs
ansible.builtin.include_tasks: "setup_nomad_configs.yml"
- name: install cni plugins
ansible.builtin.include_tasks: "cni.yml"
- name: enable nomad
ansible.builtin.service:
name: nomad
state: restarted
enabled: true
become: true
- name: set namespaces
ansible.builtin.command:
cmd: nomad namespace apply -descr "{{ item }} namespace" {{ item }}
changed_when: false
failed_when: false
loop: "{{ nomad_namespaces }}"
run_once: true
#- name: Setup csi plugins
# ansible.builtin.include_tasks: "csi_plugins.yml"
# loop:
# - azure_csi_controller
# - azure_csi_node
# when: nomad_csi_volumes is defined
# run_once: true
#
#- name: Create csi volumes
# ansible.builtin.include_tasks: "csi_volumes.yml"
# loop: "{{ nomad_csi_volumes }}"
# when: nomad_csi_volumes is defined
# run_once: true