Initial Commit w/ Host Playbooks
This commit is contained in:
30
host_init/4-nomad.yml
Normal file
30
host_init/4-nomad.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
- name: Install Nomad on Alpine Linux
|
||||
hosts: all
|
||||
|
||||
tasks:
|
||||
- name: Enable community packages
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/apk/repositories
|
||||
regexp: '^#http://dl-cdn.alpinelinux.org/alpine/v3.18/community'
|
||||
line: 'http://dl-cdn.alpinelinux.org/alpine/v3.18/community'
|
||||
state: present
|
||||
|
||||
- name: Update apk packages
|
||||
community.general.apk:
|
||||
update_cache: true
|
||||
|
||||
- name: Install nomad with apk
|
||||
community.general.apk:
|
||||
name: nomad
|
||||
|
||||
- name: Copy nomad config to host
|
||||
ansible.builtin.copy:
|
||||
mode: preserve
|
||||
src: ../host_config/nomad.hcl
|
||||
dest: /etc/nomad.d/server.hcl
|
||||
|
||||
- name: Start nomad service
|
||||
ansible.builtin.service:
|
||||
name: nomad
|
||||
state: started
|
||||
enabled: true
|
||||
Reference in New Issue
Block a user