Nomad now responds to the basic nomad.nigel.local DNS name
This commit is contained in:
parent
a3fdc5fcc7
commit
47b69d7f49
@ -6,5 +6,6 @@
|
|||||||
tags:
|
tags:
|
||||||
- setup
|
- setup
|
||||||
- nomad
|
- nomad
|
||||||
|
- proxy
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: local-server-head
|
name: local-server-head
|
||||||
|
14
ansible/roles/local-server-head/files/host-file
Normal file
14
ansible/roles/local-server-head/files/host-file
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
127.0.0.1 localhost
|
||||||
|
127.0.1.1 nigel
|
||||||
|
|
||||||
|
# Our own dns stuff
|
||||||
|
127.0.1.1 nigel.local
|
||||||
|
127.0.1.1 nomad.nigel.local
|
||||||
|
127.0.1.1 sanity.nigel.local
|
||||||
|
|
||||||
|
# The following lines are desirable for IPv6 capable hosts
|
||||||
|
::1 ip6-localhost ip6-loopback
|
||||||
|
fe00::0 ip6-localnet
|
||||||
|
ff00::0 ip6-mcastprefix
|
||||||
|
ff02::1 ip6-allnodes
|
||||||
|
ff02::2 ip6-allrouters
|
8
ansible/roles/local-server-head/files/nomad.conf
Normal file
8
ansible/roles/local-server-head/files/nomad.conf
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
server {
|
||||||
|
server_name nomad.nigel.local;
|
||||||
|
location / {
|
||||||
|
proxy_pass http://localhost:4646;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
7
ansible/roles/local-server-head/files/sanity.conf
Normal file
7
ansible/roles/local-server-head/files/sanity.conf
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
server {
|
||||||
|
server_name sanity.nigel.local;
|
||||||
|
location / {
|
||||||
|
proxy_pass http://localhost:8000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -9,6 +9,8 @@
|
|||||||
- setup
|
- setup
|
||||||
- name: Ensure nigel can use sudo without password
|
- name: Ensure nigel can use sudo without password
|
||||||
become: true
|
become: true
|
||||||
|
tags:
|
||||||
|
- setup
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/sudoers
|
path: /etc/sudoers
|
||||||
state: present
|
state: present
|
||||||
@ -21,3 +23,11 @@
|
|||||||
become: true
|
become: true
|
||||||
tags:
|
tags:
|
||||||
- nomad
|
- nomad
|
||||||
|
- name: Setup the reverse proxy outside of nomad
|
||||||
|
tags: proxy
|
||||||
|
ansible.builtin.include_tasks:
|
||||||
|
file: reverse_proxy.yaml
|
||||||
|
apply:
|
||||||
|
become: true
|
||||||
|
tags:
|
||||||
|
- proxy
|
29
ansible/roles/local-server-head/tasks/reverse_proxy.yaml
Normal file
29
ansible/roles/local-server-head/tasks/reverse_proxy.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
- name: Keep /etc/hosts up to date
|
||||||
|
ansible.builtin.copy:
|
||||||
|
dest: /etc/hosts
|
||||||
|
src: host-file
|
||||||
|
mode: "0644"
|
||||||
|
- name: Ensure nginx is setup as latest
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: nginx
|
||||||
|
- name: Copy the nomad.conf to available configurations
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: "{{ item }}"
|
||||||
|
dest: "/etc/nginx/sites-available/{{ item }}"
|
||||||
|
mode: "0644"
|
||||||
|
loop:
|
||||||
|
- nomad.conf
|
||||||
|
- sanity.conf
|
||||||
|
- name: Link the nomad.conf to sites-enabled
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "/etc/nginx/sites-enabled/{{ item }}"
|
||||||
|
state: link
|
||||||
|
src: "/etc/nginx/sites-available/{{ item }}"
|
||||||
|
mode: "0644"
|
||||||
|
loop:
|
||||||
|
- nomad.conf
|
||||||
|
- sanity.conf
|
||||||
|
- name: Restart nginx
|
||||||
|
ansible.builtin.systemd_service:
|
||||||
|
name: nginx
|
||||||
|
state: restarted
|
Loading…
Reference in New Issue
Block a user