Skip to content

Commit

Permalink
Move VPC subnet to env var
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Hanafin authored and Daemonslayer2048 committed Jul 25, 2024
1 parent 2c04fa4 commit 329548d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 2 additions & 0 deletions roles/rke2/molecule/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ aws_secret_access_key=
It is worth noting that the EC2 driver does not provide a way to login to EC2 instances, this needs to be done manually, your ssh key can be found in `~/.cache/molecule/rke2/default/id_rsa` and the default user is `ansible`, you will be able to login like so:
`ssh ansible@000.000.000.000 -i ~/.cache/molecule/rke2/default/id_rsa` note that the keys location is dependant on the scenario name.

The `vpc_subnet_id` key has been removed as a defined variable and is pulled from the environment variable `VPC_SUBNET_ID`. Other than the AWS keys needed this is the only environment variable required.

# Available Scenarios
## default
The default scenario is the simplest possible scenario, with a single Ubuntu 20.04 master node and a single Ubuntu 20.04 worker node.
Expand Down
2 changes: 1 addition & 1 deletion roles/rke2/molecule/default/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
tags: {}
volumes: []
vpc_id: ""
vpc_subnet_id: ""
vpc_subnet_id: "{{ lookup('env', 'VPC_SUBNET_ID') }}"

# Merging defaults into a list of dicts is, it turns out, not straightforward
platforms: >-
Expand Down
2 changes: 1 addition & 1 deletion roles/rke2/molecule/default/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
security_group_name: "{{ default_security_group_name }}"
security_groups: []
vpc_id: ""
vpc_subnet_id: ""
vpc_subnet_id: "{{ lookup('env', 'VPC_SUBNET_ID') }}"

# Merging defaults into a list of dicts is, it turns out, not straightforward
platforms: >-
Expand Down
2 changes: 0 additions & 2 deletions roles/rke2/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ platforms:
instance_type: t2.medium
region: us-east-2
assign_public_ip: true
vpc_subnet_id: subnet-095d88c4efe5abf6a
tags:
deployed-with: "molecule"
molecule-scenario: "default"
Expand All @@ -19,7 +18,6 @@ platforms:
instance_type: t2.medium
region: us-east-2
assign_public_ip: true
vpc_subnet_id: subnet-095d88c4efe5abf6a
tags:
deployed-with: "molecule"
molecule-scenario: "default"
Expand Down

0 comments on commit 329548d

Please sign in to comment.