Comments (6)
Hi @timdiggins
In terms of idempotency, enable_vpc/enable_vpc2
is tricky for the following reasons:
- users have no control over the IP subnet and CIDR
- if a user ever wants to have a 2nd VPC, it would no longer work
Therefore, our suggestion is to define a VPC as follows:
- name: Ensure a VPC is present
vultr.cloud.vpc:
description: default
subnet: 10.99.1.0
subnet_mask: 24
region: ams
- name: Create an instance using OS
vultr.cloud.instance:
label: web1
hostname: my-hostname
os: Debian 12 x64 (bookworm)
firewall_group: my firewall group
plan: vc2-1c-2gb
ssh_keys:
- my ssh key
vpcs:
- default
region: ams
Would this be an option?
P.s. As an inspiration, you might want to look at https://github.com/ngine-io/ansible-vultr-demo
from ansible-collection-vultr.
@resmo - thanks that's very helpful!
I can see your points, and this does the same thing with better idempotency.
But also by adapting the name to be specific to the cluster I'm setting up then have isolation between eg. staging and production clusters (and more straightforward destruction if needed - not sure if one should clean up the vpc for temporary clusters (e.g. staging), but i guess best practice)
from ansible-collection-vultr.
(Closing this - useful to have around as docs)
from ansible-collection-vultr.
@resmo sorry one more question: which parameters governs identity (and thus idempotency) in the vpc module? Is it description
+ region
?
It might help to have some documentation of this in the vpc module. (particularly asdescription
(rather than name
) doesn't sound like a label for an identity parameter)
from ansible-collection-vultr.
it's description
(or name
as it is an alias https://docs.ansible.com/ansible/latest/collections/vultr/cloud/vpc_module.html#parameter-description) only. But I see it would make sense to probably also take the region into account. This would allow to have similar "names" in many regions.
from ansible-collection-vultr.
Closing this as #98 has been merged.
from ansible-collection-vultr.
Related Issues (20)
- [Feature] - Object Storage HOT 1
- [BUG] - Wrong name-label alias in instance_info module
- [Feature] - Container Registry support
- [BUG] - traceback in CI tests
- [Missing] - VPC 2.0 parameter HOT 1
- [BUG] - instance absent fails with "Server is currently locked"
- Consider using true/false for all booleans in docs
- [Feature] State `reinstalled` HOT 1
- [Bug] vultr_tags not returned in inventory HOT 4
- [Feature] - Ability to Reboot Instance(s) HOT 1
- Typo in `instance_info` examples
- [BUG] - Idempotence check fails in vultr.cloud.firewall_rule when ICMP has port HOT 3
- [Feature] - bare metal support HOT 2
- [BUG] - Weird 401 error
- [BUG] - Useless shebangs HOT 5
- [BUG] - internal_ip no longer shows up with ansible-inventory --list HOT 6
- [Feature] - vultr_gateway_v4 not set in hostvars; gateway_v4 appears in vultr.cloud.instance_info HOT 4
- [BUG] - module "reserved_ip" crashes when adding new reserved IP HOT 2
- Add "user_schema" as parameter in instance module HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-collection-vultr.