Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
bf477c24
Commit
bf477c24
authored
Jun 21, 2022
by
Robin Wallace
Committed by
Kubernetes Prow Robot
Jun 22, 2022
Browse files
Options
Downloads
Patches
Plain Diff
Chnage from deprecated variable
parent
79f6cd77
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/terraform/terraform.py
+6
-6
6 additions, 6 deletions
contrib/terraform/terraform.py
with
6 additions
and
6 deletions
contrib/terraform/terraform.py
+
6
−
6
View file @
bf477c24
...
@@ -212,7 +212,7 @@ def metal_device(resource, tfvars=None):
...
@@ -212,7 +212,7 @@ def metal_device(resource, tfvars=None):
'
project_id
'
:
raw_attrs
[
'
project_id
'
],
'
project_id
'
:
raw_attrs
[
'
project_id
'
],
'
state
'
:
raw_attrs
[
'
state
'
],
'
state
'
:
raw_attrs
[
'
state
'
],
# ansible
# ansible
'
ansible_
ssh_
host
'
:
raw_attrs
[
'
network.0.address
'
],
'
ansible_host
'
:
raw_attrs
[
'
network.0.address
'
],
'
ansible_ssh_user
'
:
'
root
'
,
# Use root by default in metal
'
ansible_ssh_user
'
:
'
root
'
,
# Use root by default in metal
# generic
# generic
'
ipv4_address
'
:
raw_attrs
[
'
network.0.address
'
],
'
ipv4_address
'
:
raw_attrs
[
'
network.0.address
'
],
...
@@ -292,16 +292,16 @@ def openstack_host(resource, module_name):
...
@@ -292,16 +292,16 @@ def openstack_host(resource, module_name):
try
:
try
:
if
'
metadata.prefer_ipv6
'
in
raw_attrs
and
raw_attrs
[
'
metadata.prefer_ipv6
'
]
==
"
1
"
:
if
'
metadata.prefer_ipv6
'
in
raw_attrs
and
raw_attrs
[
'
metadata.prefer_ipv6
'
]
==
"
1
"
:
attrs
.
update
({
attrs
.
update
({
'
ansible_
ssh_
host
'
:
re
.
sub
(
"
[\[\]]
"
,
""
,
raw_attrs
[
'
access_ip_v6
'
]),
'
ansible_host
'
:
re
.
sub
(
"
[\[\]]
"
,
""
,
raw_attrs
[
'
access_ip_v6
'
]),
'
publicly_routable
'
:
True
,
'
publicly_routable
'
:
True
,
})
})
else
:
else
:
attrs
.
update
({
attrs
.
update
({
'
ansible_
ssh_
host
'
:
raw_attrs
[
'
access_ip_v4
'
],
'
ansible_host
'
:
raw_attrs
[
'
access_ip_v4
'
],
'
publicly_routable
'
:
True
,
'
publicly_routable
'
:
True
,
})
})
except
(
KeyError
,
ValueError
):
except
(
KeyError
,
ValueError
):
attrs
.
update
({
'
ansible_
ssh_
host
'
:
''
,
'
publicly_routable
'
:
False
})
attrs
.
update
({
'
ansible_host
'
:
''
,
'
publicly_routable
'
:
False
})
# Handling of floating IPs has changed: https://github.com/terraform-providers/terraform-provider-openstack/blob/master/CHANGELOG.md#010-june-21-2017
# Handling of floating IPs has changed: https://github.com/terraform-providers/terraform-provider-openstack/blob/master/CHANGELOG.md#010-june-21-2017
...
@@ -349,7 +349,7 @@ def iter_host_ips(hosts, ips):
...
@@ -349,7 +349,7 @@ def iter_host_ips(hosts, ips):
'
access_ip_v4
'
:
ip
,
'
access_ip_v4
'
:
ip
,
'
access_ip
'
:
ip
,
'
access_ip
'
:
ip
,
'
public_ipv4
'
:
ip
,
'
public_ipv4
'
:
ip
,
'
ansible_
ssh_
host
'
:
ip
,
'
ansible_host
'
:
ip
,
})
})
if
'
use_access_ip
'
in
host
[
1
][
'
metadata
'
]
and
host
[
1
][
'
metadata
'
][
'
use_access_ip
'
]
==
"
0
"
:
if
'
use_access_ip
'
in
host
[
1
][
'
metadata
'
]
and
host
[
1
][
'
metadata
'
][
'
use_access_ip
'
]
==
"
0
"
:
...
@@ -389,7 +389,7 @@ def query_list(hosts):
...
@@ -389,7 +389,7 @@ def query_list(hosts):
def
query_hostfile
(
hosts
):
def
query_hostfile
(
hosts
):
out
=
[
'
## begin hosts generated by terraform.py ##
'
]
out
=
[
'
## begin hosts generated by terraform.py ##
'
]
out
.
extend
(
out
.
extend
(
'
{}
\t
{}
'
.
format
(
attrs
[
'
ansible_
ssh_
host
'
].
ljust
(
16
),
name
)
'
{}
\t
{}
'
.
format
(
attrs
[
'
ansible_host
'
].
ljust
(
16
),
name
)
for
name
,
attrs
,
_
in
hosts
for
name
,
attrs
,
_
in
hosts
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment