Nomad completely setup with --tags nomad now
This commit is contained in:
parent
ef4967cd88
commit
15dfaea8db
@ -5,16 +5,6 @@
|
||||
- name: Setup basic role on nigel
|
||||
tags:
|
||||
- setup
|
||||
- nomad
|
||||
ansible.builtin.include_role:
|
||||
name: local-server-head
|
||||
apply:
|
||||
tags:
|
||||
- setup
|
||||
- name: Setup the docker based services
|
||||
tags:
|
||||
- services
|
||||
ansible.builtin.include_role:
|
||||
name: services
|
||||
apply:
|
||||
tags:
|
||||
- services
|
||||
|
@ -13,3 +13,11 @@
|
||||
path: /etc/sudoers
|
||||
state: present
|
||||
line: "nigel ALL=(ALL) NOPASSWD:ALL"
|
||||
- name: Run through nomad installation steps
|
||||
tags: nomad
|
||||
ansible.builtin.include_tasks:
|
||||
file: nomad.yaml
|
||||
apply:
|
||||
become: true
|
||||
tags:
|
||||
- nomad
|
34
ansible/roles/local-server-head/tasks/nomad.yaml
Normal file
34
ansible/roles/local-server-head/tasks/nomad.yaml
Normal file
@ -0,0 +1,34 @@
|
||||
- name: Ensure prerequisite packages are installed
|
||||
ansible.builtin.apt:
|
||||
pkg:
|
||||
- wget
|
||||
- gpg
|
||||
- coreutils
|
||||
update_cache: true
|
||||
- name: Hashicorp repo setup
|
||||
vars:
|
||||
keypath: /usr/share/keyrings/hashicorp-archive-keyring.gpg
|
||||
gpgpath: /tmp/hashicorp.gpg
|
||||
block:
|
||||
- name: Download the hashicorp GPG Key
|
||||
ansible.builtin.get_url:
|
||||
url: https://apt.releases.hashicorp.com/gpg
|
||||
dest: "{{ gpgpath }}"
|
||||
- name: Dearmor the hashicorp gpg key
|
||||
ansible.builtin.command:
|
||||
cmd: "gpg --dearmor --yes -o {{ keypath }} {{ gpgpath }}"
|
||||
register: gpg
|
||||
changed_when: gpg.rc == 0
|
||||
- name: Add the hashicorp linux repo
|
||||
vars:
|
||||
keyfile: "{{ keypath }}"
|
||||
ansible.builtin.template:
|
||||
src: hashicorp.list
|
||||
dest: /etc/apt/sources.list.d/hashicorp.list
|
||||
mode: "0644"
|
||||
- name: Update apt repo cache
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
- name: Install nomad package
|
||||
ansible.builtin.apt:
|
||||
pkg: nomad
|
1
ansible/roles/local-server-head/templates/hashicorp.list
Normal file
1
ansible/roles/local-server-head/templates/hashicorp.list
Normal file
@ -0,0 +1 @@
|
||||
deb [signed-by={{ keyfile }}] https://apt.releases.hashicorp.com jammy main
|
Loading…
Reference in New Issue
Block a user