still working out bugs

This commit is contained in:
n0mad1k
2025-04-10 06:59:59 -04:00
parent 80072a6bdc
commit 43a6ddc579
4 changed files with 1721 additions and 314 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
vars.yaml vars.yaml
venv venv
deployment* deployment*
config.yml config.yml
logs/
+13 -18
View File
@@ -3,33 +3,28 @@
hosts: localhost hosts: localhost
gather_facts: false gather_facts: false
connection: local connection: local
vars: vars_files:
region: "{{ linode_region | default('us-east') }}" - vars.yaml
instance_type: "{{ size | default('g6-standard-1') }}"
instance_name: "{{ redirector_name | default('redirector') }}"
domain: "{{ domain | default('example.com') }}"
redirector_subdomain: "cdn"
linode_image: "linode/debian11"
tasks: tasks:
- name: Create Linode redirector instance - name: Create Linode redirector instance
community.general.linode_v4: community.general.linode_v4:
label: "{{ instance_name }}" access_token: "{{ linode_token }}"
label: "{{ redirector_name }}"
type: "{{ plan }}" type: "{{ plan }}"
region: "{{ region }}" region: "{{ region }}"
image: "{{ linode_image }}" image: "linode/debian11"
root_pass: "{{ lookup('password', '/dev/null length=24 chars=ascii_letters,digits') }}" root_pass: "{{ lookup('password', '/dev/null length=16') }}"
authorized_keys: authorized_keys:
- "{{ ssh_key_content }}" - "{{ lookup('file', ssh_key_path + '.pub') }}"
state: present state: present
register: redirector_instance register: redirector_instance
- name: Save redirector IP - name: Save redirector IP
set_fact: ansible.builtin.set_fact:
redirector_ip: "{{ redirector_instance.instance.ipv4[0] }}" redirector_ip: "{{ redirector_instance.instance.ipv4[0] }}"
- name: Wait for SSH to become available - name: Wait for SSH to become available
wait_for: ansible.builtin.wait_for:
host: "{{ redirector_ip }}" host: "{{ redirector_ip }}"
port: 22 port: 22
delay: 10 delay: 10
@@ -37,11 +32,11 @@
state: started state: started
- name: Add redirector to inventory - name: Add redirector to inventory
add_host: ansible.builtin.add_host:
name: redirector name: "redirector"
ansible_host: "{{ redirector_ip }}" ansible_host: "{{ redirector_ip }}"
ansible_user: "{{ ssh_user | default('root') }}" ansible_user: "{{ ssh_user | default('root') }}"
ansible_ssh_private_key_file: "{{ ssh_key | replace('.pub', '') }}" ansible_ssh_private_key_file: "{{ ssh_key_path }}"
groups: redirectors groups: redirectors
- name: Configure redirector - name: Configure redirector
+1704 -294
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -3,4 +3,5 @@ linode_api4
boto3 boto3
botocore botocore
awscli awscli
passlib passlib
paramiko