reworked regions and started work on aws
This commit is contained in:
+12
-3
@@ -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) }}"
|
||||
|
||||
Reference in New Issue
Block a user