unable to start instance from ansible and instance is missing in ansible inventory

#1

Hello,

I try to start my instance named “backup” with the following ansible task:

  • name: Run backupServer
    scaleway_compute:
    name: backup
    state: running
    image: “”
    organization: “”
    region: “”
    commercial_type: “”
    wait: true
    tags:
    - started_with_ansible
    register: backup_facts
    until: backup_facts.msg.state_detail == ‘booted’
    retries: 10
    delay: 10

but it fails. Where it’s strange, if its booted manually from the console, I am able to stop the instance with the following ansible task:

  • name: Stop backupServer
    scaleway_compute:
    name: backup
    state: stopped
    image: “”
    organization: “”
    region: “”
    commercial_type: “”
    tags:
    - stopped_with_ansible

Worst, the instance doesn’t appear in the ansible inventory:

ansible-inventory --list -i scaleway_inventory.yml

{
“_meta”: {
“hostvars”: {
“public_ip”: {
“arch”: “x86_64”,
“commercial_type”: “START1-XS”,
“hostname”: “mail.domain.me”,
“id”: “instance_id”,
“organization”: “organization_id”,
“private_ipv4”: “private_ip”,
“public_ipv4”: “public_ip”,
“state”: “running”,
“tags”: []
}
}
},
“all”: {
“children”: [
“ams1”,
“par1”,
“ungrouped”
]
},
“ams1”: {},
“par1”: {
“hosts”: [
“public_ip”
]
},
“ungrouped”: {}
}

with scaleway_inventory.yml is limited to
plugin: scaleway

the SCW_API_KEY is in my environment.

Thanks and regards,

Eric.