Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(nomad): deployer for nomad #940

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions test/deploy/nomad/install/roles/configure/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
- name: Install git
ansible.builtin.apt:
name:
- git
state: present
become: yes

- name: install nomad
shell: >
sudo apt-get update &&
sudo apt-get install wget gpg coreutils
become: yes

- name: gpgp set
shell : wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
become: yes

- name:
shell:
|
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt-get update && sudo apt-get install nomad
become: yes

- name: Clone nomad
shell: git clone https://github.com/hashicorp-education/learn-nomad-getting-started.git
become: yes

- name: cd learn-nomad-getting-started
shell: cd learn-nomad-getting-started
become: yes

- name: git checkout -b nomad-getting-started v1.1
shell: git checkout -b nomad-getting-started v1.1
become: yes

- name: Start nomad ina terminal
shell: >
sudo nomad agent -dev
-bind 0.0.0.0
-network-interface='{{ GetDefaultInterfaces | attr "name" }}'
become: yes

- name: export
shell: export NOMAD_ADDR=http://localhost:4646
become: yes

37 changes: 37 additions & 0 deletions test/manual/definitions/nomad/ubuntu18-nomad.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"global_tags": {
"owning_team": "virtuoso",
"Environment": "development",
"Department": "product",
"Product": "virtuoso"
},

"resources": [{
"id": "host1",
"provider": "aws",
"type": "ec2",
"size": "t3.large",
"ami_name": "ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-????????",
"user_name": "ubuntu"
}],
"services": [
{
"id": "docker1",
"destinations": [
"host1"
],
"source_repository": "https://github.com/newrelic/open-install-library.git",
"deploy_script_path": "test/deploy/linux/docker/install/roles",
"port": 9999
},
{
"id": "nomad",
"destinations": [
"host1"
],
"source_repository": "https://github.com/newrelic/open-install-library.git",
"deploy_script_path": "test/deploy/linux/nomad/install/roles",
"port": 4646
}
]
}