Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add Layer 2 example including interconnection and VRF #232

Merged
merged 16 commits into from
Oct 29, 2024
Merged

Conversation

ctreatma
Copy link
Contributor

@ctreatma ctreatma commented Oct 3, 2024

This serves as a working example of deploying a Metal device in hybrid mode in a VRF with a Metal-billed VRF interconnection that connects to a VPC in AWS. This example also creates an S3 VPC endpoint in AWS, and demonstrates that the VPC endpoint can be used from the Metal device for aws s3 commands.

Closes #162

examples/layer2/main.yml Outdated Show resolved Hide resolved
examples/layer2/main.yml Outdated Show resolved Hide resolved
ctreatma added a commit that referenced this pull request Oct 4, 2024
…233)

This fixes a couple problems with the parameter definitions for the
reserved IP block module:

1. The `cidr` and `network` parameters, needed for VRF IP reservations,
were not defined in the module spec
2. The `quantity` parameter, which is unsupported for VRF IP
reservations, was required in order to create _any_ IP reservation

This PR updates the reserved IP block module so that it can be used to
create a VRF IP reservation. The docs are also updated to reference the
`cidr` and `network` parameters.

This was broken out of #232.
@ctreatma ctreatma force-pushed the l2-example branch 2 times, most recently from e10d66a to e1f46b6 Compare October 8, 2024 17:22
examples/layer2/README.md Outdated Show resolved Hide resolved
@ctreatma ctreatma force-pushed the l2-example branch 2 times, most recently from fbe27c8 to 5ab1693 Compare October 9, 2024 19:07
@ctreatma ctreatma changed the title [WIP] Layer 2 example including interconnection and VRF docs: add Layer 2 example including interconnection and VRF Oct 17, 2024
@ctreatma ctreatma marked this pull request as ready for review October 17, 2024 22:02
examples/layer2/README.md Outdated Show resolved Hide resolved
examples/layer2/README.md Outdated Show resolved Hide resolved

## Variables

You can customize some variables from [vars/equinix_metal_vars.yml](vars/equinix_metal_vars.yml).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
You can customize some variables from [vars/equinix_metal_vars.yml](vars/equinix_metal_vars.yml).
You can customize the names, sizes, locations, addresses, and other resource variables in [vars/equinix_metal_vars.yml](vars/equinix_metal_vars.yml).

examples/layer2/README.md Show resolved Hide resolved
examples/layer2/main.yml Outdated Show resolved Hide resolved
examples/layer2/main.yml Outdated Show resolved Hide resolved
iface bond0.{{vlan.vxlan}} inet static
address {{ vrf_gateway_ip_range | ansible.utils.nthhost(2) }}
netmask {{ vrf_ip_reservation.netmask }}
post-up route add -net {{ vrf_gateway_ip_range }} gw {{ vrf_ip_reservation.gateway }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this makes a difference, but I was comparing to https://deploy.equinix.com/developers/guides/connecting-vlan-to-aws-direct/#test-the-connection and I don't see the gw part there, just the dev.

Copy link
Contributor

@cprivitere cprivitere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bgp string apparently has some requirements that should be called out.

An exception occurred during task execution. To see the full traceback, use -vvv. The error was:     For further information visit https://errors.pydantic.dev/2.9/v/value_error
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error in metal_virtual_circuit: 1 validation error for VrfVirtualCircuitUpdateInput\nmd5\n  Value error, must validate the regular expression /^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{10,20}$/ [type=value_error, input_value='taco123', input_type=str]\n    For further information visit https://errors.pydantic.dev/2.9/v/value_error"}

@cprivitere
Copy link
Contributor

cprivitere commented Oct 18, 2024

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (botocore and boto3) on cyclones's Python /home/cprivitere/ansible_collections/equinix/cloud/examples/layer2/.venv/bin/python. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"}

I know this is related to AWS, so maybe this isn't an issue with our setup, but is just a gotcha for people installing AWS libraries for ansible in general?

examples/layer2/aws.yml Outdated Show resolved Hide resolved
examples/layer2/aws.yml Outdated Show resolved Hide resolved
examples/layer2/aws.yml Outdated Show resolved Hide resolved
examples/layer2/aws.yml Outdated Show resolved Hide resolved
examples/layer2/aws.yml Outdated Show resolved Hide resolved
Install the AWS CLI:

```bash
$ apt install -y awscli
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be done via userdata but I think it's a better flow to save the entire AWS CLI setup until the end.

Copy link
Contributor

@cprivitere cprivitere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ctreatma ctreatma merged commit 03e43a9 into main Oct 29, 2024
1 check passed
@ctreatma ctreatma deleted the l2-example branch October 29, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create an example for L2 resources
3 participants