diff --git a/ansible/group_vars/all.yml.sample b/ansible/group_vars/all.yml.sample index 2c2bba8..e1dfe5f 100644 --- a/ansible/group_vars/all.yml.sample +++ b/ansible/group_vars/all.yml.sample @@ -1,4 +1,9 @@ ansible_user: CHANGEME nomad_datacenter_name: "aperture" nomad_server_bootstrap_expect: 3 -consul_generated_encrypt_key: CHANGEME \ No newline at end of file +consul_generated_encrypt_key: CHANGEME + +nomad_jobs: +- traefik +- dcufm +- user-vms/distro diff --git a/ansible/roles/run-nomad/tasks/main.yaml b/ansible/roles/run-nomad/tasks/main.yaml new file mode 100644 index 0000000..6c5c196 --- /dev/null +++ b/ansible/roles/run-nomad/tasks/main.yaml @@ -0,0 +1,12 @@ +--- + +# TODO: Add Nomad namespaces. + +- name: Run {{ item }} Nomad Job + community.general.nomad_job: + host: "{{ lookup('ansible.builtin.env', 'NOMAD_ADDR')}}" + token: "{{ lookup('ansible.builtin.env', 'NOMAD_TOKEN')}}" + state: present + content: "{{ lookup('file', '../jobs/' - task - ''.hcl') }}" + with_items: + - "{{ groups['nomad_jobs']}}"