diff --git a/roles/rke2/molecule/README.md b/roles/rke2/molecule/README.md index f4c7f60..0847c96 100644 --- a/roles/rke2/molecule/README.md +++ b/roles/rke2/molecule/README.md @@ -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. diff --git a/roles/rke2/molecule/default/create.yml b/roles/rke2/molecule/default/create.yml index c128de6..50ffe4a 100644 --- a/roles/rke2/molecule/default/create.yml +++ b/roles/rke2/molecule/default/create.yml @@ -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: >- diff --git a/roles/rke2/molecule/default/destroy.yml b/roles/rke2/molecule/default/destroy.yml index 54ca53b..ea99382 100644 --- a/roles/rke2/molecule/default/destroy.yml +++ b/roles/rke2/molecule/default/destroy.yml @@ -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: >- diff --git a/roles/rke2/molecule/default/molecule.yml b/roles/rke2/molecule/default/molecule.yml index f6834ea..73833d3 100644 --- a/roles/rke2/molecule/default/molecule.yml +++ b/roles/rke2/molecule/default/molecule.yml @@ -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" @@ -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"