diff --git a/.ansible-sign/sha256sum.txt b/.ansible-sign/sha256sum.txt index 3da5cf6..d45f91d 100644 --- a/.ansible-sign/sha256sum.txt +++ b/.ansible-sign/sha256sum.txt @@ -10,13 +10,10 @@ b0b35c8cf39a7dfdb0692c8fc796dda38fdf448793d83e2503104b423a437007 aws_parking_st 8b8c3e48b0872ca247149870922aefd6c4b346b9fd5c24fff9a00d20df199f3c buildawsdetailedreport.yml fbebf3d2acc8fa8b93de398c099bec0d384582365a9e885eca3ae10a46077c7f collections/requirements.yml e2981c574fb52e82efcf807f74e8fb63744b8e88ce0b4019a95c1e3f2cc4f81a devfile.yaml -4cb7ea6a459bb3d191fbe3b9fbb52bc6dbfe31e1b76adabf7b5c9e0ccf0b4f94 roles/aws_opt_in_start/defaults/main.yml -207cb6dc0bb8b3c9388ba75aa3aa74570e68f0fce8d315eb84758eb74bd889c0 roles/aws_opt_in_start/tasks/main.yml -d38d5b606954eef22a54eecc796d7d49e65a4a09459f743abca1451871795d0c roles/aws_opt_in_start/tasks/start_ec2.yml -4cb7ea6a459bb3d191fbe3b9fbb52bc6dbfe31e1b76adabf7b5c9e0ccf0b4f94 roles/aws_opt_in_stop/defaults/main.yml -9ca94921ccf52e9a5e2a437c855fdf10e0fa9689f66b02aceacb4ff477648e0d roles/aws_opt_in_stop/tasks/main.yml -b8c2121806926f58faa4e46eb3a6481271f99804c07e8c54013303cffabe2ce8 roles/aws_opt_in_stop/tasks/stop_ec2.yml -4cb7ea6a459bb3d191fbe3b9fbb52bc6dbfe31e1b76adabf7b5c9e0ccf0b4f94 roles/aws_retrieve_info/defaults/main.yml +2b7ec8404296821bb7eb30ddb85de6e5607dc67e07b805fd0373e4147057f5e3 roles/aws_opt_in_start/tasks/main.yml +82c3a93e89b77e9644b828305b383ef9db8afd1341671a59b4b40a570e6aa2b4 roles/aws_opt_in_start/tasks/start_ec2.yml +f050ee6b755e2f590a67a73b495f510c8f114c2254c7e07952cea3e6b2edcfbb roles/aws_opt_in_stop/tasks/main.yml +e019a14d1236a2f7e5c1206d4ae0d6ce3efca830f10b455808ef66c2aabcc960 roles/aws_opt_in_stop/tasks/stop_ec2.yml c4e600e0ed85b1abf7b410e67236976012c357493d83617b5d87524870b1e912 roles/aws_retrieve_info/tasks/main.yml 86bdf585a205e2367a0c090efe7f1ed59bf6040307aa38b990e39207315629e2 roles/aws_retrieve_info/tasks/retrieve_info.yml 6c8b0dca0627067f90cf42f2eb4909022d5460bb7326949d98ce33c0232844b3 roles/aws_schedule_parking/tasks/main.yml diff --git a/.ansible-sign/sha256sum.txt.sig b/.ansible-sign/sha256sum.txt.sig index bf433e8..6ad1542 100644 --- a/.ansible-sign/sha256sum.txt.sig +++ b/.ansible-sign/sha256sum.txt.sig @@ -1,14 +1,14 @@ -----BEGIN PGP SIGNATURE----- -iQGzBAABCAAdFiEE/bJvyFHKKJdaZDOLTiIiIXrUDNEFAmV5wKwACgkQTiIiIXrU -DNGExQwAn/SunHMbKxOfvQVmnWfgnOeTsFNh0HxOAIhE2NSEGF3b/Ln4ddg3OPf0 -dTh1Bfl5/eFTaG+J08Ww9aQoZ/t7v1Gsg6af6eaXcSa41nSSWmKKERXfMMLUXLL0 -w0aS7MG74QQdUBt6z713i2CZxecUf7tuRlhKPvT0Q533NpPpULePRl4BmRaSCJQN -MVcMQkwv37zAUVwGlwh/TEb563QMr4prA2GdFYOaL9DTdCadGaWDCoTSM9Oht7iX -G2Zqu9rW8ZrGWG7ZoBpZi5QO+NPQ/pv/r5RVdo5waBQR+q+lnYOuwc6QOFX7rmgl -5yFMCgLmcqdaN5jp0/To+Lw899TDngTwtbTlkskbpDkmrD4fI2U7zY/Q2FEd23By -Y6d4PjCCBRvCAEZJb5IoIqxC23ciV0Il0TcNrONaBn9UAJPgwCsMWPNipfpd9kdE -UvKA7ZFJIvsXLQwDtXINUO+3kqrW3+afits+AQYyayRwKqUnj6A/xGkQZ9wpBZRD -i09EXwrC -=+E09 +iQGzBAABCAAdFiEE/bJvyFHKKJdaZDOLTiIiIXrUDNEFAmV5wjMACgkQTiIiIXrU +DNFgvwv+J3ilpaaKV/JlUKn/0iMkaOwG0ePkRmDGbxWgYAx/uZ6g2ESRW4E3HCm0 +BwHcyc1vQWEc4IzeeWPpuXoWg/di7mJEqqtFsazu16UhgGGSf2wuLyZ+/uxTMdeO +7M3n1NfLTXaOLEn02obsiXrWM4RuP0ObGMEBUpSECxpk9V3cKGe67Oz8jg6fqkIt +j0H7WiVnWOmoRhTiOdsnpFC5gsqPuUw04Ebqu1B5ySKWcmZQB6tgGVyrZIbiRdo7 +OZliV2btRdjMgr9y/+3mHpAIpgJ2DMWPt+y4K0wptQNch8XVN8IbBYBo7BsiM+oc +LOT74GqeoUedFenF+t8xREPUcUpNbcuGNjJahwt9y3Coysde70ntiGtd5jlPcKGW +h9R3JxJzCIE9Xf0RVXpxJ+C8f1/3vZyahpzyeIS+eP1SO+Y/H9vFjhHBFlU+S+Dc +I21cQIEidFq1DySP4C4BvQeinBkz6TIv+WqJ4wEBhiDoMryAWLPOhcPrpA+Ab6dl +dP0PKc+s +=zlUg -----END PGP SIGNATURE----- diff --git a/roles/aws_opt_in_start/defaults/main.yml b/roles/aws_opt_in_start/defaults/main.yml deleted file mode 100644 index b85e044..0000000 --- a/roles/aws_opt_in_start/defaults/main.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -ec2_regions: - - 'us-east-1' - - 'us-east-2' - - 'us-west-1' - - 'us-west-2' - - 'ca-central-1' - # 'af-south-1' - # - 'ap-east-1' - # - 'ap-south-2' - # - 'ap-southeast-3' - # - 'ap-southeast-4' - - 'ap-south-1' - - 'ap-southeast-1' - - 'ap-southeast-2' - - 'ap-northeast-1' - - 'ap-northeast-2' - - 'ap-northeast-3' - - 'eu-central-1' - # - 'eu-central-2' - - 'eu-west-1' - - 'eu-west-2' - - 'eu-west-3' - # - 'eu-south-1' - # - 'eu-south-2' - - 'eu-north-1' - # - 'me-south-1' - # - 'me-central-1' - - 'sa-east-1' - # - 'us-gov-east-1' diff --git a/roles/aws_opt_in_start/tasks/main.yml b/roles/aws_opt_in_start/tasks/main.yml index e69d21a..1408f2f 100644 --- a/roles/aws_opt_in_start/tasks/main.yml +++ b/roles/aws_opt_in_start/tasks/main.yml @@ -1,5 +1,12 @@ --- +- name: Get all regions + amazon.aws.aws_region_info: + region: "us-east-2" + register: allregions + - name: Loop over all ec2 regions ansible.builtin.include_tasks: file: start_ec2.yml - loop: "{{ ec2_regions }}" + loop: "{{ allregions.regions }}" + loop_control: + label: "{{ item.region_name }}" diff --git a/roles/aws_opt_in_start/tasks/start_ec2.yml b/roles/aws_opt_in_start/tasks/start_ec2.yml index a5c1028..173f511 100644 --- a/roles/aws_opt_in_start/tasks/start_ec2.yml +++ b/roles/aws_opt_in_start/tasks/start_ec2.yml @@ -1,7 +1,7 @@ --- -- name: Start EC2 Instances based on tag in region {{ item }} +- name: Start EC2 Instances based on tag in region {{ item.region_name }} amazon.aws.ec2_instance: - region: "{{ item }}" + region: "{{ item.region_name }}" filters: "tag:owner": "{{ owner }}" "tag:env": "{{ env }}" diff --git a/roles/aws_opt_in_stop/defaults/main.yml b/roles/aws_opt_in_stop/defaults/main.yml deleted file mode 100644 index b85e044..0000000 --- a/roles/aws_opt_in_stop/defaults/main.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -ec2_regions: - - 'us-east-1' - - 'us-east-2' - - 'us-west-1' - - 'us-west-2' - - 'ca-central-1' - # 'af-south-1' - # - 'ap-east-1' - # - 'ap-south-2' - # - 'ap-southeast-3' - # - 'ap-southeast-4' - - 'ap-south-1' - - 'ap-southeast-1' - - 'ap-southeast-2' - - 'ap-northeast-1' - - 'ap-northeast-2' - - 'ap-northeast-3' - - 'eu-central-1' - # - 'eu-central-2' - - 'eu-west-1' - - 'eu-west-2' - - 'eu-west-3' - # - 'eu-south-1' - # - 'eu-south-2' - - 'eu-north-1' - # - 'me-south-1' - # - 'me-central-1' - - 'sa-east-1' - # - 'us-gov-east-1' diff --git a/roles/aws_opt_in_stop/tasks/main.yml b/roles/aws_opt_in_stop/tasks/main.yml index 141bc8d..4e52712 100644 --- a/roles/aws_opt_in_stop/tasks/main.yml +++ b/roles/aws_opt_in_stop/tasks/main.yml @@ -1,5 +1,12 @@ --- +- name: Get all regions + amazon.aws.aws_region_info: + region: "us-east-2" + register: allregions + - name: Loop over all ec2 regions ansible.builtin.include_tasks: file: stop_ec2.yml - loop: "{{ ec2_regions }}" + loop: "{{ allregions.regions }}" + loop_control: + label: "{{ item.region_name }}" diff --git a/roles/aws_opt_in_stop/tasks/stop_ec2.yml b/roles/aws_opt_in_stop/tasks/stop_ec2.yml index 0c1c0a7..dcee3aa 100644 --- a/roles/aws_opt_in_stop/tasks/stop_ec2.yml +++ b/roles/aws_opt_in_stop/tasks/stop_ec2.yml @@ -1,7 +1,7 @@ --- -- name: Stop EC2 Instances based on tag in region {{ item }} +- name: Stop EC2 Instances based on tag in region {{ item.region_name }} amazon.aws.ec2_instance: - region: "{{ item }}" + region: "{{ item.region_name }}" filters: "tag:owner": "{{ owner }}" "tag:env": "{{ env }}" diff --git a/roles/aws_retrieve_info/defaults/main.yml b/roles/aws_retrieve_info/defaults/main.yml deleted file mode 100644 index b85e044..0000000 --- a/roles/aws_retrieve_info/defaults/main.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -ec2_regions: - - 'us-east-1' - - 'us-east-2' - - 'us-west-1' - - 'us-west-2' - - 'ca-central-1' - # 'af-south-1' - # - 'ap-east-1' - # - 'ap-south-2' - # - 'ap-southeast-3' - # - 'ap-southeast-4' - - 'ap-south-1' - - 'ap-southeast-1' - - 'ap-southeast-2' - - 'ap-northeast-1' - - 'ap-northeast-2' - - 'ap-northeast-3' - - 'eu-central-1' - # - 'eu-central-2' - - 'eu-west-1' - - 'eu-west-2' - - 'eu-west-3' - # - 'eu-south-1' - # - 'eu-south-2' - - 'eu-north-1' - # - 'me-south-1' - # - 'me-central-1' - - 'sa-east-1' - # - 'us-gov-east-1'