-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(super): Added Super agent and logs super agent targets (#35)
* feat(super): Added Super agent and logs super agent targets * test(super): Deployer tests for puppet * test(fossa): Remove puppet-module-gems * test: Fix tests after updating PDK
- Loading branch information
1 parent
1f0cd94
commit 46f0952
Showing
18 changed files
with
311 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"settings": { | ||
"terminal.integrated.profiles.linux": { | ||
"bash": { | ||
"path": "bash", | ||
"path": "bash" | ||
} | ||
} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--relative | ||
--no-140chars-check | ||
--no-140chars-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
test/demo-deployer/setup/super/roles/configure/tasks/install-module/linux.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
- name: Find locally-built module tarball | ||
shell: find /home/puppet-install/pkg -type f -iname "newrelic-newrelic_installer*tar.gz" -print -quit | ||
register: puppet_tarball_location | ||
|
||
- name: Install locally-built module from tarball | ||
shell: puppet module install {{ puppet_tarball_location.stdout }} | ||
register: command_output | ||
|
||
- name: ensure manifests directory exists | ||
file: | ||
path: $HOME/.puppetlabs/etc/code/manifests | ||
state: directory | ||
|
||
- name: Copy site.pp to localhost | ||
template: | ||
src: site.pp.j2 | ||
dest: $HOME/.puppetlabs/etc/code/manifests/site.pp | ||
|
||
|
||
- name: Apply newrelic-newrelic_installer module | ||
shell: sudo puppet apply --modulepath=$HOME/.puppetlabs/etc/code/modules $HOME/.puppetlabs/etc/code/manifests/site.pp | ||
register: apply_output | ||
|
||
- debug: | ||
msg: "{{ apply_output.stdout }}" |
8 changes: 8 additions & 0 deletions
8
test/demo-deployer/setup/super/roles/configure/tasks/install-module/templates/site.pp.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
class { 'newrelic_installer::install': | ||
targets => ["super-agent"], | ||
environment_variables => { | ||
"NEW_RELIC_API_KEY" => "{{ nr_api_key }}", | ||
"NEW_RELIC_ACCOUNT_ID" => {{ nr_account_id }}, | ||
"NEW_RELIC_REGION" => "{{ nr_region }}" | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
test/demo-deployer/setup/super/roles/configure/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
# Install dependencies (git, puppet, pdk) | ||
- name: Install git | ||
include_tasks: ../../../../packages/{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/git/main.yml | ||
- name: Install puppet | ||
include_tasks: ../../../../packages/{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/puppet/main.yml | ||
- name: Install puppet-development-kit | ||
include_tasks: ../../../../packages/{{ ansible_distribution }}/{{ ansible_distribution_major_version }}/puppet-development-kit/main.yml | ||
|
||
# Clone module repo and build locally | ||
- name: Clone puppet-install repository | ||
ansible.builtin.git: | ||
repo: https://github.com/newrelic/puppet-install.git | ||
dest: /home/puppet-install | ||
become: true | ||
- name: Build newrelic-newrelic_installer using PDK | ||
shell: | | ||
cd /home/puppet-install | ||
/usr/local/bin/pdk build --force | ||
become: true | ||
|
||
# Instrument infra recipe via module | ||
- name: Installing newrelic_installer module | ||
include_tasks: install-module/linux.yml | ||
vars: | ||
nr_api_key: "{{ newrelic_personal_api_key }}" | ||
nr_account_id: "{{ newrelic_account_id }}" | ||
nr_region: "{{ newrelic_region|upper }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
test/demo-deployer/targets/super/amazonlinux2-super-agent-logs.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"global_tags": { | ||
"owning_team": "virtuoso", | ||
"Environment": "development", | ||
"Department": "product", | ||
"Product": "virtuoso" | ||
}, | ||
|
||
"resources": [ | ||
{ | ||
"id": "host1", | ||
"provider": "aws", | ||
"ami_name": "amzn2-ami-hvm-2.0.????????.?-x86_64-gp2", | ||
"type": "ec2", | ||
"size": "t3.micro" | ||
} | ||
], | ||
|
||
"instrumentations": { | ||
"resources": [ | ||
{ | ||
"id": "amzn2_puppet-install_infra", | ||
"resource_ids": ["host1"], | ||
"provider": "newrelic", | ||
"local_source_path": "/mnt/deployer/puppet-install", | ||
"deploy_script_path": "/test/demo-deployer/setup/super/roles" | ||
}, | ||
{ | ||
"id": "recipeValidation", | ||
"resource_ids": ["host1"], | ||
"provider": "newrelic", | ||
"local_source_path": "/mnt/deployer/puppet-install", | ||
"deploy_script_path": "/test/demo-deployer/validate/roles", | ||
"params": { | ||
"nrql_query": "select count(*) from SystemSample where hostname like '%HOSTNAME%' since 10 minutes ago" | ||
} | ||
} | ||
] | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
test/demo-deployer/targets/super/amazonlinux2023-super-agent-logs.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"global_tags": { | ||
"owning_team": "virtuoso", | ||
"Environment": "development", | ||
"Department": "product", | ||
"Product": "virtuoso" | ||
}, | ||
|
||
"resources": [ | ||
{ | ||
"id": "host1", | ||
"provider": "aws", | ||
"type": "ec2", | ||
"size": "t3.small", | ||
"ami_name": "al2023-ami-2023.*-x86_64", | ||
"user_name": "ec2-user" | ||
} | ||
], | ||
|
||
"instrumentations": { | ||
"resources": [ | ||
{ | ||
"id": "amzn2_puppet-install_infra", | ||
"resource_ids": ["host1"], | ||
"provider": "newrelic", | ||
"local_source_path": "/mnt/deployer/puppet-install", | ||
"deploy_script_path": "/test/demo-deployer/setup/super/roles" | ||
}, | ||
{ | ||
"id": "recipeValidation", | ||
"resource_ids": ["host1"], | ||
"provider": "newrelic", | ||
"local_source_path": "/mnt/deployer/puppet-install", | ||
"deploy_script_path": "/test/demo-deployer/validate/roles", | ||
"params": { | ||
"nrql_query": "select count(*) from SystemSample where hostname like '%HOSTNAME%' since 10 minutes ago" | ||
} | ||
} | ||
] | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
test/demo-deployer/targets/super/awslinux23-super-agent.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"global_tags": { | ||
"owning_team": "virtuoso", | ||
"Environment": "development", | ||
"Department": "product", | ||
"Product": "virtuoso" | ||
}, | ||
"resources": [ | ||
{ | ||
"id": "host1", | ||
"provider": "aws", | ||
"ami_name": "al2023-ami-2023.*-x86_64", | ||
"type": "ec2", | ||
"size": "t3.nano", | ||
"user_name": "ec2-user" | ||
} | ||
], | ||
"instrumentations": { | ||
"resources": [ | ||
"resources": [ | ||
{ | ||
"id": "amzn2_puppet-install_infra", | ||
"resource_ids": ["host1"], | ||
"provider": "newrelic", | ||
"local_source_path": "/mnt/deployer/puppet-install", | ||
"deploy_script_path": "/test/demo-deployer/setup/super/roles" | ||
}, | ||
{ | ||
"id": "recipeValidation", | ||
"resource_ids": ["host1"], | ||
"provider": "newrelic", | ||
"local_source_path": "/mnt/deployer/puppet-install", | ||
"deploy_script_path": "/test/demo-deployer/validate/roles", | ||
"params": { | ||
"nrql_query": "select count(*) from SystemSample where hostname like '%HOSTNAME%' since 10 minutes ago" | ||
} | ||
} | ||
] | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
test/demo-deployer/targets/super/ubuntu20-super-agent.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"global_tags": { | ||
"owning_team": "virtuoso", | ||
"Environment": "development", | ||
"Department": "product", | ||
"Product": "virtuoso" | ||
}, | ||
|
||
"resources": [ | ||
{ | ||
"id": "host1", | ||
"provider": "aws", | ||
"type": "ec2", | ||
"size": "t3.nano", | ||
"ami_name": "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-2023*", | ||
"user_name": "ubuntu" | ||
} | ||
], | ||
|
||
"instrumentations": { | ||
"resources": [ | ||
{ | ||
"id": "amzn2_puppet-install_infra", | ||
"resource_ids": ["host1"], | ||
"provider": "newrelic", | ||
"local_source_path": "/mnt/deployer/puppet-install", | ||
"deploy_script_path": "/test/demo-deployer/setup/super/roles" | ||
}, | ||
{ | ||
"id": "recipeValidation", | ||
"resource_ids": ["host1"], | ||
"provider": "newrelic", | ||
"local_source_path": "/mnt/deployer/puppet-install", | ||
"deploy_script_path": "/test/demo-deployer/validate/roles", | ||
"params": { | ||
"nrql_query": "select count(*) from SystemSample where hostname like '%HOSTNAME%' since 10 minutes ago" | ||
} | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.