diff --git a/ansible_playbooks/ansible_hosts.yml b/ansible_playbooks/ansible_hosts.yml index 55ae486..1770aa9 100644 --- a/ansible_playbooks/ansible_hosts.yml +++ b/ansible_playbooks/ansible_hosts.yml @@ -1,62 +1,72 @@ --- all: - children: - servers: - vars: - nomad_network_interface: eth0 - hosts: - n1.thefij: - nomad_node_role: both - nomad_reserved_memory: 1024 - # nomad_meta: - # hw_transcode.device: /dev/dri - # hw_transcode.type: intel - nfs_mounts: - - src: 10.50.250.2:/srv/volumes - path: /srv/volumes/moxy - opts: proto=tcp,rw - nomad_unique_host_volumes: - - name: mysql-data - path: /srv/volumes/mysql - owner: "999" - group: "100" - mode: "0755" - read_only: false - - name: postgres-data - path: /srv/volumes/postgres - owner: "999" - group: "999" - mode: "0755" - read_only: false - n2.thefij: - nomad_node_role: both - nomad_node_class: ingress - nomad_reserved_memory: 1024 - nfs_mounts: - - src: 10.50.250.2:/srv/volumes - path: /srv/volumes/moxy - opts: proto=tcp,rw - nomad_unique_host_volumes: - - name: nextcloud-data - path: /srv/volumes/nextcloud - owner: "root" - group: "bin" - mode: "0755" - read_only: false - pi4: - nomad_node_role: both - nomad_node_class: ingress - nomad_reserved_memory: 512 - nomad_meta: - hw_transcode.device: /dev/video11 - hw_transcode.type: raspberry - qnomad.thefij: - ansible_host: 192.168.2.234 - nomad_node_role: both - nomad_reserved_memory: 1024 - # This VM uses a non-standard interface - nomad_network_interface: ens3 + hosts: + n1.thefij: + nomad_node_class: ingress + nomad_reserved_memory: 1024 + # nomad_meta: + # hw_transcode.device: /dev/dri + # hw_transcode.type: intel + nfs_mounts: + - src: 10.50.250.2:/srv/volumes + path: /srv/volumes/moxy + opts: proto=tcp,rw + nomad_unique_host_volumes: + - name: mysql-data + path: /srv/volumes/mysql + owner: "999" + group: "100" + mode: "0755" + read_only: false + - name: postgres-data + path: /srv/volumes/postgres + owner: "999" + group: "999" + mode: "0755" + read_only: false + n2.thefij: + nomad_node_class: ingress + nomad_reserved_memory: 1024 + nfs_mounts: + - src: 10.50.250.2:/srv/volumes + path: /srv/volumes/moxy + opts: proto=tcp,rw + nomad_unique_host_volumes: + - name: nextcloud-data + path: /srv/volumes/nextcloud + owner: "root" + group: "bin" + mode: "0755" + read_only: false + pi4: + nomad_node_class: ingress + nomad_reserved_memory: 512 + nomad_meta: + hw_transcode.device: /dev/video11 + hw_transcode.type: raspberry + qnomad.thefij: + ansible_host: 192.168.2.234 + nomad_reserved_memory: 1024 + # This VM uses a non-standard interface + nomad_network_interface: ens3 - nomad_instances: - children: - servers: {} +nomad_instances: + vars: + nomad_network_interface: eth0 + children: + nomad_servers: {} + nomad_clients: {} +nomad_servers: + hosts: + nonopi.thefij: + ansible_host: 192.168.2.170 + n1.thefij: {} + n2.thefij: {} + pi4: {} + qnomad.thefij: {} +nomad_clients: + hosts: + n1.thefij: {} + n2.thefij: {} + pi4: {} + qnomad.thefij: {} diff --git a/ansible_playbooks/nomad_wesher_restart.yml b/ansible_playbooks/nomad_wesher_restart.yml index 575ae92..692e8e6 100644 --- a/ansible_playbooks/nomad_wesher_restart.yml +++ b/ansible_playbooks/nomad_wesher_restart.yml @@ -14,7 +14,7 @@ state: restarted become: true - - name: Start Dockee + - name: Start Docker systemd: name: docker state: started diff --git a/ansible_playbooks/recover-nomad.yaml b/ansible_playbooks/recover-nomad.yaml index afbac58..cbb301d 100644 --- a/ansible_playbooks/recover-nomad.yaml +++ b/ansible_playbooks/recover-nomad.yaml @@ -1,6 +1,6 @@ --- - name: Recover Nomad - hosts: nomad_instances + hosts: nomad_servers any_errors_fatal: true tasks: diff --git a/ansible_playbooks/setup-cluster.yml b/ansible_playbooks/setup-cluster.yml index 3cdd256..e7c488d 100644 --- a/ansible_playbooks/setup-cluster.yml +++ b/ansible_playbooks/setup-cluster.yml @@ -14,7 +14,7 @@ line: "nameserver {{ non_nomad_dns }}" - name: Install Docker - hosts: nomad_instances + hosts: nomad_clients become: true vars: docker_architecture_map: @@ -44,7 +44,7 @@ # state: present - name: Create NFS mounts - hosts: nomad_instances + hosts: nomad_clients become: true vars: shared_nfs_mounts: @@ -140,6 +140,7 @@ nomad_version: "1.7.6-1" nomad_install_upgrade: true nomad_allow_purge_config: true + nomad_node_role: "{% if 'nomad_clients' in group_names %}{% if 'nomad_servers' in group_names %}both{% else %}client{% endif %}{% else %}server{% endif %}" # Where nomad gets installed to nomad_bin_dir: /usr/bin @@ -213,7 +214,7 @@ enabled: true - name: Bootstrap Nomad ACLs and scheduler - hosts: nomad_instances + hosts: nomad_servers tasks: - name: Start Nomad