I assume the Linode instance is supposed to have an Id of 12345678, but that’s not the Linode ID of the created instance. It’s been set to an arbitrary numeric value.
This is sort of a bug with ansible because the linode role is not idempotent.
I think there are pull requests to fix this in ansible v2, but for the time being
you will mostly likely have to work around it.
The linode_id does not set the ID at linode. It is to target that linode server
if you need to remove or change it. This means there is no linode_id when
first create it.
So to work around this issue you need to comment out the ID on first run.
Then you need to most likely need to add this to your linode task: register: linode_server then add a new task to - debug: var=linode_server
this way you can see the ID that is created. Copy that ID into linode_id on
for the next runs of the playbook to be idempotent. Hopefully they can fix this
soon.
This is sort of a bug with ansible because the linode role is not
idempotent.
I think there are pull requests to fix this in ansible v2, but for the time
being
you will mostly likely have to work around it.
Indeed. I actually write the ID to a file and then use {{ lookup(“file”, “path/to/id”) }} later in the playbook. This way I can use it after the playbook finishes in subsequent runs and in other playbooks.