-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Scaleway inventory: allows to connect via private IP #44342
Conversation
ansible_host was hardcoded and it was not possible to connect using private addresses. This allows to define multiple host variables, values are templates which can use hosts details send by API. For example this config file use private address and defines two variables: plugin: scaleway hostnames: - hostname variables: ansible_host: private_ip state: state image: image.name regions: - ams1 inventory will looks like: { "_meta": { "hostvars": { "testhost": { "ansible_host": "10.1.1.1", "arch": "x86_64", "commercial_type": "START1-M", "hostname": "testhost", "id": "af669464-0c74-4c89-8573-9fe763028448", "image": "CentOS 7.4", "organization": "2cc9a115-380d-4ac0-ba4b-8947eee71325", "public_ipv4": "163.172.1.1", "public_ipv6": "2001:bc8::1", "state": "running", "tags": [ "testtag" ] } } }, [...] }
LGTM |
shipit |
bot_status |
Componentslib/ansible/plugins/inventory/scaleway.py Metadatawaiting_on: maintainer |
shipit |
1 similar comment
shipit |
rebuild_merge |
SUMMARY
ansible_host
value was hardcoded with public IPv4 address.With this PR:
private IPv4 or public IPv6 can be used
by default
ansible_host
isn't defined (theninventory_hostname
is used, meaning value ofhostnames
parameter)other host variables can be defined, values of these variables are templates which can reference data send by Scaleway API:
inventory will look like:
ISSUE TYPE
COMPONENT NAME
lib/ansible/plugins/inventory/scaleway.py
ANSIBLE VERSION