Skip to content

Commit

Permalink
Added AWS parking capability
Browse files Browse the repository at this point in the history
  • Loading branch information
adworjan committed Nov 10, 2023
1 parent a9c8809 commit 1284ebe
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .ansible-sign/sha256sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ daa15edee6e844e4b924c4525520e51d57bbda5714babd6f56a1d32313442edc SNOW/readme.md
f2e3f116834e07c0851da09ddd064fd4af564f049b2341ab32bbe94a921034f1 aap_metrics.yml
801e71ef40288c0ca2711b52b3703e34f5a867889d5f9be6bab1c7d1b8ded26a aap_metrics_api.yml
a9ba8167093814d5863fdd533c87d9a447418d15e03ccbf3d0d38992f56a3b2e addvmtoad.yml
8b5842d94984cfedbc03636e69cfd0ea1caa2971d46ca3645fdf55d5eaa1857f aws_parking_schedule.yml
015f24b8ce1526d6c238368d441d27e21ba69c31f40ed754a36b48ff0a17bc48 aws_parking_start.yml
b0b35c8cf39a7dfdb0692c8fc796dda38fdf448793d83e2503104b423a437007 aws_parking_stop.yml
ca9718833f5c907ce6c9a3f19a4c3f349f5ed9152b489d94181c854aa7bcb2be buildlinuxreport.yml
6c6af63ec5f37ca46646e3d8e341153c62bd2277ce3eef1077e6083948adc6f0 buildwindowsreport.yml
3dbc6c472c4a6483f0bd44ee864f515e8f5aa28637e572aea60faf3dac6c6430 certificatereport.yml
Expand Down Expand Up @@ -119,6 +122,9 @@ fffadf953aa2b60ba1422df4ff32a582a783bf844d631020253fb81ab825794b mesh_status.ym
d08544ae0a854d774e4a8da10fc366f778c462900e743167c3def4f7aa1ff0cc removewindowsuser.yml
f4b1e0d3ad05569a8b8ffc761a51ebb313f854e65883ad208e5ad77dab7d7c05 rhv_snapshot_postpatch.yml
2fe498f54dbede8e03d7ea4f33977b834472f053206c64ae35b5feca3d3af9b8 rhv_snapshot_prepatch.yml
0b5e061319a977c57136d858852e6dd4b1eea6a8c720e348d9658675236e8377 roles/aws_opt_in_start/tasks/main.yml
9eabd3b5042808f92ea0ca63aa204467b9c2b35900074fbb0ae6f47874d86e4f roles/aws_opt_in_stop/tasks/main.yml
6c8b0dca0627067f90cf42f2eb4909022d5460bb7326949d98ce33c0232844b3 roles/aws_schedule_parking/tasks/main.yml
c73129af3c33f30d38a2b559a156c6d82e91ed1a949cf8d16731ddab01002d98 roles/shadowman_aap_metrics/tasks/main.yml
dbf5388b362d3066031beeab1a10564fdffd6fc94b3673be4b5061c667445123 roles/shadowman_aap_metrics_api/tasks/main.yml
72ee574a67406e3fbfdf055736be4cc0e94a2453340a3dded5205e7599a50586 roles/shadowman_active_directory/tasks/main.yml
Expand Down
22 changes: 11 additions & 11 deletions .ansible-sign/sha256sum.txt.sig
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
-----BEGIN PGP SIGNATURE-----

iQGzBAABCAAdFiEE/bJvyFHKKJdaZDOLTiIiIXrUDNEFAmUui6wACgkQTiIiIXrU
DNE/Cgv5AWZpBWCadMSI6oZGUEwiTMfL6dd7/vdjKdTFjE/AewhNELGKexkZREQT
+k6M5Uocyuk5VmDxDLr8S5VwgswPRhYxvUSgrMPu02v0eA3WZm0uuEXXbp2MDRZw
YJ0kp5QDcrzQPUWOf2JBTWj9cfu8p4VEnmQozCr6I2lj/NVpH8WE5+lc1IwigdSE
2VKo4OV5zZIpFV5kK8bLUp+6jvURUJLMYEiRDDaj07E7JVkxdIXL8eNLHCyKKx3j
Uma10GvCGpiwmgKgBmoNm5xuzWp2RSuK3gD53ffIoUEZnNaPy5qls53DLlg7weuy
VgOgLNJB+DnnjLv1IXS05f4KO2JBXb86HsZLjDHWzxvVhuOISSZb9JlW5LL4Ios5
73DXUCl6d5Wqzf3BRTykY5PNOEvMoHo9hHa6y3ghhk9RU2GHa8B07yTBml36L1ri
ZcEyxxstJcka+dtVA5/GkAL/ODpusSrUOvjCd+7WTCX6d94XYwUKplzPILyvmHgX
QqtZUMP9
=ghvq
iQGzBAABCAAdFiEE/bJvyFHKKJdaZDOLTiIiIXrUDNEFAmVOLfwACgkQTiIiIXrU
DNHFgAwAt1cW8XJFkJrjFCBf9E11yNzUZT2DxVewDMF1Nv0TZ1fyphxueZ2XzE7J
HOMZbqL9gx10QVFGnsYos0wyXOYRzsed9PWj2b0bDaDH+KkRrXxRtZOBv3wNhEeF
Iiv8ozdxRc2nrRiJn45cf0ZdP2t3CiHkqxrbE/S58f/PLcghAvLqmlqHZLugjo4Z
1NYl2bRfg4D4ehdUaW+8PU6zo4SnfXHD/UPJRSfXftxm5uKXJKyUddbv3io9TU+U
gGA2K7DtlyhUiuBBEw2jrwhWXp6eir6jEIl6O8fpfi0WezCyzUdkbbClM6b1Ojfe
QANDN+N/b+4CUKQt3OzlvQw8f1u5OCZ/bRmGne16fbADTOUfiJkfzI1+vUWTmRYu
3VOVLFNhqpxW9uSA1ZlMUihWZ2kYr3/NkvwjdwGtNEHtQ8uHP59t7oy4ae73+NBc
JXq4nMaiv9KeAIPnI0GPrvH+JHgwZGGbp0Fbo5wMqGn0T52JZpT6BnHhj6gbOoMC
6dxUp2fv
=Al0r
-----END PGP SIGNATURE-----
7 changes: 7 additions & 0 deletions aws_parking_schedule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: AWS Scheduler for Parking
hosts: localhost
connection: local
gather_facts: false

roles:
- azure_schedule_parking
7 changes: 7 additions & 0 deletions aws_parking_start.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: AWS Start VMs
hosts: localhost
connection: local
gather_facts: false

roles:
- aws_opt_in_start
7 changes: 7 additions & 0 deletions aws_parking_stop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: AWS Stop VMs
hosts: localhost
connection: local
gather_facts: false

roles:
- aws_opt_in_stop
7 changes: 7 additions & 0 deletions roles/aws_opt_in_start/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Start EC2 Instances based on tag
amazon.aws.ec2_instance:
filters:
"tag:owner": "{{ owner }}"
"tag:env": "{{ env }}"
state: started
7 changes: 7 additions & 0 deletions roles/aws_opt_in_stop/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Stop EC2 Instances based on tag
amazon.aws.ec2_instance:
filters:
"tag:owner": "{{ owner }}"
"tag:env": "{{ env }}"
state: stopped
20 changes: 20 additions & 0 deletions roles/aws_schedule_parking/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- name: Build the Schedule for Stopping AWS instances for {{ owner }} in {{ env }}

Check warning on line 2 in roles/aws_schedule_parking/tasks/main.yml

View workflow job for this annotation

GitHub Actions / build

name[template]

Jinja templates should only be at the end of 'name'
ansible.controller.schedule:
name: Park AWS instances for {{ owner }} in {{ env }}
state: present
unified_job_template: AWSParking-Stop
rrule: "{{ query('ansible.controller.schedule_rrule', frequency, start_date=stop_date_time, timezone='GMT', every=repetition | int) }}"
extra_data:
owner: "{{ owner }}"
env: "{{ env }}"

- name: Build the Schedule for Starting AWS instances for {{ owner }} in {{ env }}

Check warning on line 12 in roles/aws_schedule_parking/tasks/main.yml

View workflow job for this annotation

GitHub Actions / build

name[template]

Jinja templates should only be at the end of 'name'
ansible.controller.schedule:
name: UnPark AWS instances for {{ owner }} in {{ env }}
state: present
unified_job_template: AWSParking-Start
rrule: "{{ query('ansible.controller.schedule_rrule', frequency, start_date=start_date_time, timezone='GMT', every=repetition | int) }}"
extra_data:
owner: "{{ owner }}"
env: "{{ env }}"

0 comments on commit 1284ebe

Please sign in to comment.