mirror of
https://github.com/davestephens/ansible-nas
synced 2025-01-26 02:05:05 +00:00
Add Nomad
This commit is contained in:
parent
e8e0d7866d
commit
c367740b8e
5 changed files with 84 additions and 0 deletions
|
@ -64,6 +64,7 @@ If you have a spare domain name you can configure applications to be accessible
|
|||
* [netboot.xyz](https://netboot.xyz/) - a PXE boot server
|
||||
* [Netdata](https://my-netdata.io/) - An extremely comprehensive system monitoring solution
|
||||
* [Nextcloud](https://nextcloud.com/) - A self-hosted Dropbox alternative
|
||||
* [Nomad](https://www.nomadproject.io/) - A simple and flexible scheduler and software orchestrator
|
||||
* [NZBget](https://nzbget.net/) - The most efficient usenet downloader
|
||||
* [Octoprint](https://octoprint.org/) - Control and monitor your 3D printer
|
||||
* [Ombi](https://ombi.io/) - web application that automatically gives your users the ability to request content
|
||||
|
|
9
roles/nomad/defaults/main.yml
Normal file
9
roles/nomad/defaults/main.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
nomad_enabled: false
|
||||
nomad_data_home: "{{ docker_home }}/nomad"
|
||||
nomad_service_name: nomad
|
||||
|
||||
# ports
|
||||
nomad_port_http: 4646
|
||||
nomad_port_rpc: 4647
|
||||
nomad_port_serf: 4648
|
39
roles/nomad/tasks/main.yml
Normal file
39
roles/nomad/tasks/main.yml
Normal file
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
- name: Install and start Nomad
|
||||
block:
|
||||
- name: Add Hashicorp GPG key
|
||||
ansible.builtin.apt_key:
|
||||
url: https://apt.releases.hashicorp.com/gpg
|
||||
state: present
|
||||
|
||||
- name: Add Hashicorp apt repository
|
||||
ansible.builtin.apt_repository:
|
||||
repo: "deb https://apt.releases.hashicorp.com {{ ansible_facts['lsb']['codename'] }} main"
|
||||
state: present
|
||||
filename: hashicorp
|
||||
|
||||
- name: Install Nomad
|
||||
ansible.builtin.apt:
|
||||
name: nomad
|
||||
state: present
|
||||
|
||||
- name: Template Nomad config
|
||||
ansible.builtin.template:
|
||||
src: nomad.hcl
|
||||
dest: /etc/nomad.d/nomad.hcl
|
||||
|
||||
- name: Start Nomad
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ nomad_service_name }}"
|
||||
state: started
|
||||
enabled: yes
|
||||
when: nomad_enabled is true
|
||||
|
||||
- name: Stop Nomad
|
||||
block:
|
||||
- name: Stop Nomad
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ nomad_service_name }}"
|
||||
state: stopped
|
||||
enabled: no
|
||||
when: nomad_enabled is false
|
22
roles/nomad/templates/nomad.hcl
Normal file
22
roles/nomad/templates/nomad.hcl
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Full configuration options can be found at https://www.nomadproject.io/docs/configuration
|
||||
|
||||
data_dir = "{{ nomad_data_home }}/data"
|
||||
bind_addr = "0.0.0.0"
|
||||
|
||||
ports {
|
||||
http = {{ nomad_port_http }}
|
||||
rpc = {{ nomad_port_rpc }}
|
||||
serf = {{ nomad_port_serf }}
|
||||
}
|
||||
|
||||
server {
|
||||
# license_path is required as of Nomad v1.1.1+
|
||||
#license_path = "/opt/nomad/license.hclic"
|
||||
enabled = true
|
||||
bootstrap_expect = 1
|
||||
}
|
||||
|
||||
client {
|
||||
enabled = true
|
||||
servers = ["0.0.0.0"]
|
||||
}
|
13
website/docs/applications/development-tools/nomad.md
Normal file
13
website/docs/applications/development-tools/nomad.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
title: "Nomad"
|
||||
---
|
||||
|
||||
Homepage: <https://www.nomadproject.io/>
|
||||
|
||||
A simple and flexible scheduler and orchestrator to deploy and manage containers and non-containerised applications across on-prem and clouds at scale.
|
||||
|
||||
## Usage
|
||||
|
||||
Set `nomad_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
|
||||
|
||||
Nomad's web interface can be found at <http://ansible_nas_host_or_ip:4646>
|
Loading…
Reference in a new issue