Open katefike opened 1 year ago
@katefike
In my ansible playbook I create a firewall and it's successful. Then I create a droplet and apply the firewall to it, but it fails without a message. In Digital Ocean the droplet exists and is correctly configured with the firewall applied.
I don't quite get it, can you clarify whether ...
firewall and droplet are created. Firewall is applied to droplet, but it does not show in the ansible execution, or
maybe this one? droplet is created and firewall is applied but task always returns failed condition. should be changed but returns changed: false
i tested latest ansible + digitalocean community collection and if i specify firewall during droplet creation - droplet creation task always endups in failure. if i omit firewall definition - task gets proper changed state and consequent runs with firewall definition work as expected.
all fails have
"msg": [
null,
true
]
all consequent and/or successful runs does not have msg [ null, true ] in them.
does not matter if it is a string or array or firewalls (should be array of strings according to manual) it still fails.
to test just use simple droplet creation and specify firewall. it will always fail if droplet gonna be created for the first time.
this is failed variant. just specified smallest droplet they offer and runned with firewall option. it failed and returned changed: false. it succeeds without firewall as explained above. returned message that ansible considers a failure:
{
"changed": false,
"data": {
"droplet": {
"backup_ids": [],
"created_at": "2024-04-11T15:35:01Z",
"disk": 10,
"features": [
"droplet_agent",
"private_networking"
],
"id": 412282114,
"image": {
"created_at": "2023-06-27T18:01:28Z",
"description": "Debian 12 Image",
"distribution": "Debian",
"id": 135438931,
"min_disk_size": 7,
"name": "12 x64",
"public": true,
"regions": [
"nyc3",
"nyc1",
"sfo1",
"nyc2",
"ams2",
"sgp1",
"lon1",
"ams3",
"fra1",
"tor1",
"sfo2",
"blr1",
"sfo3",
"syd1"
],
"size_gigabytes": 0.44,
"slug": "debian-12-x64",
"status": "available",
"tags": [],
"type": "base"
},
"kernel": null,
"locked": false,
"memory": 512,
"name": "do1",
"networks": {
"v4": [
{
"gateway": "128.199.128.1",
"ip_address": "128.199.164.169",
"netmask": "255.255.192.0",
"type": "public"
},
{
"gateway": "10.0.2.241",
"ip_address": "10.0.2.242",
"netmask": "255.255.255.240",
"type": "private"
}
],
"v6": []
},
"next_backup_window": null,
"region": {
"available": true,
"features": [
"backups",
"ipv6",
"metadata",
"install_agent",
"storage",
"image_transfer"
],
"name": "Singapore 1",
"sizes": [
"s-1vcpu-512mb-10gb",
"s-1vcpu-1gb",
"s-1vcpu-1gb-amd",
"s-1vcpu-1gb-intel",
"s-1vcpu-1gb-35gb-intel",
"s-1vcpu-2gb",
"s-1vcpu-2gb-amd",
"s-1vcpu-2gb-intel",
"s-1vcpu-2gb-70gb-intel",
"s-2vcpu-2gb",
"s-2vcpu-2gb-amd",
"s-2vcpu-2gb-intel",
"s-2vcpu-2gb-90gb-intel",
"s-2vcpu-4gb",
"s-2vcpu-4gb-amd",
"s-2vcpu-4gb-intel",
"s-2vcpu-4gb-120gb-intel",
"c-2",
"c2-2vcpu-4gb",
"s-4vcpu-8gb",
"s-4vcpu-8gb-amd",
"s-4vcpu-8gb-intel",
"g-2vcpu-8gb",
"s-4vcpu-8gb-240gb-intel",
"gd-2vcpu-8gb",
"m-2vcpu-16gb",
"c-4",
"c2-4vcpu-8gb",
"s-8vcpu-16gb",
"m3-2vcpu-16gb",
"s-8vcpu-16gb-amd",
"s-8vcpu-16gb-intel",
"g-4vcpu-16gb",
"s-8vcpu-16gb-480gb-intel",
"so-2vcpu-16gb",
"m6-2vcpu-16gb",
"gd-4vcpu-16gb",
"so1_5-2vcpu-16gb",
"m-4vcpu-32gb",
"c-8",
"c2-8vcpu-16gb",
"m3-4vcpu-32gb",
"g-8vcpu-32gb",
"so-4vcpu-32gb",
"m6-4vcpu-32gb",
"gd-8vcpu-32gb",
"so1_5-4vcpu-32gb",
"m-8vcpu-64gb",
"c-16",
"c2-16vcpu-32gb",
"m3-8vcpu-64gb",
"g-16vcpu-64gb",
"so-8vcpu-64gb",
"m6-8vcpu-64gb",
"gd-16vcpu-64gb",
"so1_5-8vcpu-64gb",
"m-16vcpu-128gb",
"c-32",
"c2-32vcpu-64gb",
"m3-16vcpu-128gb",
"c-48",
"m-24vcpu-192gb",
"g-32vcpu-128gb",
"so-16vcpu-128gb",
"m6-16vcpu-128gb",
"gd-32vcpu-128gb",
"c2-48vcpu-96gb",
"m3-24vcpu-192gb",
"g-40vcpu-160gb",
"so1_5-16vcpu-128gb",
"m-32vcpu-256gb",
"gd-40vcpu-160gb",
"so-24vcpu-192gb",
"m6-24vcpu-192gb",
"m3-32vcpu-256gb",
"so1_5-24vcpu-192gb",
"so-32vcpu-256gb",
"m6-32vcpu-256gb",
"so1_5-32vcpu-256gb"
],
"slug": "sgp1"
},
"size": {
"available": true,
"description": "Basic",
"disk": 10,
"memory": 512,
"networking_througput": 2000,
"price_hourly": 0.00595,
"price_monthly": 4,
"regions": [
"ams3",
"fra1",
"nyc1",
"sfo3",
"sgp1",
"syd1"
],
"slug": "s-1vcpu-512mb-10gb",
"transfer": 0.5,
"vcpus": 1
},
"size_slug": "s-1vcpu-512mb-10gb",
"snapshot_ids": [],
"status": "active",
"tags": [],
"vcpus": 1,
"volume_ids": [],
"vpc_uuid": "2531fec9-6fcb-4e9c-9979-517bf52e7baf"
},
"firewall": [
null,
true
]
},
"msg": [
null,
true
]
}
and this is successful creation of droplet without specifying firewall
{
"changed": true,
"data": {
"droplet": {
"backup_ids": [],
"created_at": "2024-04-22T00:14:35Z",
"disk": 10,
"features": [
"droplet_agent",
"private_networking"
],
"id": 414237389,
"image": {
"created_at": "2023-06-27T18:01:28Z",
"description": "Debian 12 Image",
"distribution": "Debian",
"id": 135438931,
"min_disk_size": 7,
"name": "12 x64",
"public": true,
"regions": [
"nyc3",
"nyc1",
"sfo1",
"nyc2",
"ams2",
"sgp1",
"lon1",
"ams3",
"fra1",
"tor1",
"sfo2",
"blr1",
"sfo3",
"syd1"
],
"size_gigabytes": 0.44,
"slug": "debian-12-x64",
"status": "available",
"tags": [],
"type": "base"
},
"kernel": null,
"locked": false,
"memory": 512,
"name": "do1",
"networks": {
"v4": [
{
"gateway": "159.65.128.1",
"ip_address": "159.65.137.188",
"netmask": "255.255.240.0",
"type": "public"
},
{
"gateway": "10.0.2.241",
"ip_address": "10.0.2.242",
"netmask": "255.255.255.240",
"type": "private"
}
],
"v6": []
},
"next_backup_window": null,
"region": {
"available": true,
"features": [
"backups",
"ipv6",
"metadata",
"install_agent",
"storage",
"image_transfer"
],
"name": "Singapore 1",
"sizes": [
"s-1vcpu-512mb-10gb",
"s-1vcpu-1gb",
"s-1vcpu-1gb-amd",
"s-1vcpu-1gb-intel",
"s-1vcpu-1gb-35gb-intel",
"s-1vcpu-2gb",
"s-1vcpu-2gb-amd",
"s-1vcpu-2gb-intel",
"s-1vcpu-2gb-70gb-intel",
"s-2vcpu-2gb",
"s-2vcpu-2gb-amd",
"s-2vcpu-2gb-intel",
"s-2vcpu-2gb-90gb-intel",
"s-2vcpu-4gb",
"s-2vcpu-4gb-amd",
"s-2vcpu-4gb-intel",
"s-2vcpu-4gb-120gb-intel",
"c-2",
"c2-2vcpu-4gb",
"s-4vcpu-8gb",
"s-4vcpu-8gb-amd",
"s-4vcpu-8gb-intel",
"g-2vcpu-8gb",
"s-4vcpu-8gb-240gb-intel",
"gd-2vcpu-8gb",
"m-2vcpu-16gb",
"c-4",
"c2-4vcpu-8gb",
"s-8vcpu-16gb",
"m3-2vcpu-16gb",
"s-8vcpu-16gb-amd",
"s-8vcpu-16gb-intel",
"g-4vcpu-16gb",
"s-8vcpu-16gb-480gb-intel",
"so-2vcpu-16gb",
"m6-2vcpu-16gb",
"gd-4vcpu-16gb",
"so1_5-2vcpu-16gb",
"m-4vcpu-32gb",
"c-8",
"c2-8vcpu-16gb",
"s-8vcpu-32gb-640gb-intel",
"m3-4vcpu-32gb",
"g-8vcpu-32gb",
"so-4vcpu-32gb",
"m6-4vcpu-32gb",
"gd-8vcpu-32gb",
"so1_5-4vcpu-32gb",
"m-8vcpu-64gb",
"c-16",
"c2-16vcpu-32gb",
"m3-8vcpu-64gb",
"g-16vcpu-64gb",
"so-8vcpu-64gb",
"m6-8vcpu-64gb",
"gd-16vcpu-64gb",
"so1_5-8vcpu-64gb",
"m-16vcpu-128gb",
"c-32",
"c2-32vcpu-64gb",
"m3-16vcpu-128gb",
"c-48",
"m-24vcpu-192gb",
"g-32vcpu-128gb",
"so-16vcpu-128gb",
"m6-16vcpu-128gb",
"gd-32vcpu-128gb",
"c2-48vcpu-96gb",
"m3-24vcpu-192gb",
"g-40vcpu-160gb",
"so1_5-16vcpu-128gb",
"m-32vcpu-256gb",
"gd-40vcpu-160gb",
"so-24vcpu-192gb",
"m6-24vcpu-192gb",
"m3-32vcpu-256gb",
"so1_5-24vcpu-192gb",
"so-32vcpu-256gb",
"m6-32vcpu-256gb",
"so1_5-32vcpu-256gb"
],
"slug": "sgp1"
},
"size": {
"available": true,
"description": "Basic",
"disk": 10,
"memory": 512,
"networking_througput": 2000,
"price_hourly": 0.00595,
"price_monthly": 4,
"regions": [
"ams3",
"fra1",
"nyc1",
"sfo3",
"sgp1",
"syd1"
],
"slug": "s-1vcpu-512mb-10gb",
"transfer": 0.5,
"vcpus": 1
},
"size_slug": "s-1vcpu-512mb-10gb",
"snapshot_ids": [],
"status": "active",
"tags": [
"edge"
],
"vcpus": 1,
"volume_ids": [],
"vpc_uuid": "2531fec9-6fcb-4e9c-9979-517bf52e7baf"
}
}
}
SUMMARY
In my ansible playbook I create a firewall and it's successful. Then I create a droplet and apply the firewall to it, but it fails without a message. In Digital Ocean the droplet exists and is correctly configured with the firewall applied.
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
My ansible playbook:
EXPECTED RESULTS
I expect that either: a. If there is an "ok" response, then the droplet has been created with the firewall applied to it. b. If there is a "failed" response, then the droplet has not been created and there is an error message.
ACTUAL RESULTS
Command:
Results:
In Digital Ocean in the droplet's "Networking" page I can see that this firewall was applied.