Skip to content

Commit

Permalink
ansible: correctly handle non-default Nomad local code paths.
Browse files Browse the repository at this point in the history
When using the remote build functionality, the local Nomad code
path was expected to be "nomad". This isn't the case for many
people, and therefore this change fixes the behaviour, so we can
handle all Nomad local code path names.
  • Loading branch information
jrasell committed Jun 12, 2024
1 parent 8f6fdc0 commit 527c92c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ build_apt_packages: [

build_user: "ubuntu"
build_nomad_local_code_path: ""
build_nomad_local_code_dir_name: "{{ build_nomad_local_code_path | split('/') | last }}"
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@

- name: "remove_nomad_binary"
ansible.builtin.file:
path: "/home/{{ build_user }}/nomad/pkg/linux_amd64/nomad"
path: "/home/{{ build_user }}/{{ build_nomad_local_code_dir_name }}/pkg/linux_amd64/nomad"
state: "absent"

- name: "build_nomad_binary"
shell: ". /etc/profile;make pkg/linux_amd64/nomad"
args:
chdir: "/home/{{ build_user }}/nomad"
chdir: "/home/{{ build_user }}/{{ build_nomad_local_code_dir_name }}"

- name: "fetch_nomad_compiled_binary"
ansible.builtin.fetch:
src: "/home/{{ build_user }}/nomad/pkg/linux_amd64/nomad"
src: "/home/{{ build_user }}/{{ build_nomad_local_code_dir_name }}/pkg/linux_amd64/nomad"
dest: "{{ build_nomad_local_code_path }}/pkg/linux_amd64/nomad"
flat: yes

Expand Down

0 comments on commit 527c92c

Please sign in to comment.