reworked regions and started work on aws

This commit is contained in:
n0mad1k
2025-05-01 23:43:43 -04:00
parent 9e9383eeef
commit e3fe2b0509
7 changed files with 355 additions and 180 deletions
+12 -3
View File
@@ -24,14 +24,23 @@
- linode_token is defined and linode_token != ""
fail_msg: "Linode API token is required. Set linode_token in vars.yaml or via --linode-token."
- name: Set region for C2 server
set_fact:
c2_region_value: "{{ selected_region | default(region, true) | default(linode_region, true) | default('us-east', true) }}"
when: region_choices is not defined or region_choices|length == 0
- name: Set random region for C2 server
set_fact:
c2_region_value: "{{ region_choices | random }}"
when: region_choices is defined and region_choices|length > 0 and c2_region_value is not defined
- name: Create C2 Linode instance
community.general.linode_v4:
access_token: "{{ linode_token }}"
label: "{{ c2_name }}"
type: "{{ plan }}"
region: "{{ selected_region }}"
# Use static value to avoid recursive templating
image: "{{ c2_image_static }}"
region: "{{ c2_region_value }}"
image: "linode/kali"
root_pass: "{{ lookup('password', '/dev/null length=16') }}"
authorized_keys:
- "{{ lookup('file', ssh_key_path) }}"