Skip to content

Commit

Permalink
try moving to new ami build job name again
Browse files Browse the repository at this point in the history
  • Loading branch information
keirbadger committed Apr 29, 2024
1 parent e4eab93 commit 2ab92ff
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Role Variables

None. This role is intended for immutable infrastructure where the Ansible playbook is applied during the AMI bake (e.g. with Packer). It includes the file `/etc/cron.d/notify_updates` containing the following placeholders that should be replaced on instance creation (e.g. from UserData):

* `%JENKINS_JOB_NAME_TEMPLATE%` - the value is included in the `job` tag on the event, so that the AMI build job can be triggered.
* `%DATADOG_API_KEY_TEMPLATE%` - the API key for posting to Datadog.

Dependencies
Expand Down
4 changes: 2 additions & 2 deletions files/send_datadog_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def main(argv):
'api_key': os.getenv('DATADOG_API_TOKEN'),
}
updates = argv[0]
jenkins_job_name = os.getenv('JENKINS_JOB_NAME')
ami_build_job_name = os.getenv('AMI_BUILD_JOB_NAME')

cluster = os.getenv('CLUSTER')
stateless = bool(int(os.getenv('STATELESS_INSTANCE', 1)))
Expand All @@ -26,7 +26,7 @@ def main(argv):
text = 'update-notifier (yum-cron) has flagged ' \
'the following updates \n{}'.format(updates)
tags = [
'job:{}'.format(jenkins_job_name),
'job:{}'.format(ami_build_job_name),
'stateless:{}'.format(stateless),
'cluster:{}'.format(cluster),
'architecture:{}'.format(architecture),
Expand Down
6 changes: 0 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@
minute: '0'
job: "/usr/local/bin/notify_updates &>> /var/log/notify_updates.log"

- name: Jenkins job name for API
community.general.cronvar:
name: JENKINS_JOB_NAME
value: "%JENKINS_JOB_NAME_TEMPLATE%"
cron_file: notify_updates

- name: Datadog API token
community.general.cronvar:
name: DATADOG_API_TOKEN
Expand Down

0 comments on commit 2ab92ff

Please sign in to comment.