Homelab/host_init/3-consul.yml

36 lines
938 B
YAML
Raw Normal View History

2024-02-06 20:36:51 +00:00
- 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"
2024-02-06 20:36:51 +00:00
state: present
- name: Update apk packages
community.general.apk:
update_cache: true
- name: Install consul with apk
community.general.apk:
name: consul
- name: Remove default consul config
ansible.builtin.file:
path: /etc/consul/server.json
state: absent
- name: Copy consul config to host
ansible.builtin.copy:
mode: preserve
src: ../host_config/consul.hcl
dest: /etc/consul/server.hcl
- name: Start consul service
ansible.builtin.service:
name: consul
state: started
enabled: true